gpt4 book ai didi

gradle - Wildfly Swarm部署问题-无法解决工件 'xalan:serializer:2.7.1.jbossorg-2'

转载 作者:行者123 更新时间:2023-12-03 04:01:08 27 4
gpt4 key购买 nike

使用gradle脚本:

buildscript {
version = System.getProperty('swarmVersion') ?: '2017.1.1'

repositories {
mavenLocal()
mavenCentral()
}

dependencies {
classpath "io.spring.gradle:dependency-management-plugin:1.0.0.RC2"
classpath "org.wildfly.swarm:wildfly-swarm-plugin:$version"
}
}

apply plugin: "io.spring.dependency-management"
apply plugin: 'wildfly-swarm'
apply plugin: 'java'
apply plugin: 'application'

mainClassName = 'test.Main'

swarm {
properties {
swarm.http.port = 8080
}
}

repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://maven.repository.redhat.com/nexus/content/repositories/releases/'
}
maven {
url 'https://maven.repository.redhat.com/nexus/content/repositories/thirdparty-releases/'
}
}

dependencyManagement {
imports {
mavenBom "org.wildfly.swarm:bom-all:$version"
}
}

dependencies {
compile "org.wildfly.swarm:jaxrs"
}

测试主
  package test;

import test.resources.TestResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.wildfly.swarm.Swarm;
import org.wildfly.swarm.jaxrs.JAXRSArchive;

public class Main {

public static void main(String... args) throws Exception {

Swarm swarm = new Swarm();
JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class);
deployment.addClass(TestResource.class);
deployment.addAllDependencies();
swarm.start();
swarm.deploy(deployment);
}
}

我在启动jar时收到此错误:
2017-01-24 12:00:35,363 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."8cf83a03-d940-4e8b-b223-f9a9e00976ce.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."8cf83a03-d940-4e8b-b223-f9a9e00976ce.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "8cf83a03-d940-4e8b-b223-f9a9e00976ce.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYUT0049: Error loading SCI from module: javax.servlet.jstl.api:main
at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:118)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
... 5 more
Caused by: org.jboss.modules.ModuleLoadException: Error loading module from modules/org/apache/xalan/main/module.xml
at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:228)
at org.wildfly.swarm.bootstrap.modules.ClasspathModuleFinder.findModule(ClasspathModuleFinder.java:80)
at org.jboss.modules.ModuleLoader.findModule(ModuleLoader.java:439)
at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:342)
at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:289)
at org.jboss.modules.Module.addPaths(Module.java:1079)
at org.jboss.modules.Module.link(Module.java:1449)
at org.jboss.modules.Module.relinkIfNecessary(Module.java:1477)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:225)
at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:109)
... 6 more
Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to resolve artifact 'xalan:serializer:2.7.1.jbossorg-2' (position: END_TAG seen ...esources>\n <artifact name="xalan:serializer:2.7.1.jbossorg-2"/>... @5:57)
at org.jboss.modules.xml.ModuleXmlParser.parseArtifact(ModuleXmlParser.java:838)
at org.jboss.modules.xml.ModuleXmlParser.parseResources(ModuleXmlParser.java:739)
at org.jboss.modules.xml.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:535)
at org.jboss.modules.xml.ModuleXmlParser.parseDocument(ModuleXmlParser.java:340)
at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:226)
... 15 more

2017-01-24 12:00:35,371 ERROR [org.jboss.as.controller.management-operation] (main) WFLYCTL0013: Operation ("add") failed - address: (("deployment" => "8cf83a03-d940-4e8b-b223-f9a9e00976ce.war")) - failure description: {
"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"8cf83a03-d940-4e8b-b223-f9a9e00976ce.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"8cf83a03-d940-4e8b-b223-f9a9e00976ce.war\".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment \"8cf83a03-d940-4e8b-b223-f9a9e00976ce.war\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYUT0049: Error loading SCI from module: javax.servlet.jstl.api:main
Caused by: org.jboss.modules.ModuleLoadException: Error loading module from modules/org/apache/xalan/main/module.xml
Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to resolve artifact 'xalan:serializer:2.7.1.jbossorg-2' (position: END_TAG seen ...esources>\\n <artifact name=\"xalan:serializer:2.7.1.jbossorg-2\"/>... @5:57) "},
"WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"8cf83a03-d940-4e8b-b223-f9a9e00976ce.war\".INSTALL"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}
2017-01-24 12:00:35,374 ERROR [org.jboss.as.server] (main) WFLYSRV0021: Deploy of deployment "8cf83a03-d940-4e8b-b223-f9a9e00976ce.war" was rolled back with the following failure message:
{
"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"8cf83a03-d940-4e8b-b223-f9a9e00976ce.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"8cf83a03-d940-4e8b-b223-f9a9e00976ce.war\".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment \"8cf83a03-d940-4e8b-b223-f9a9e00976ce.war\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYUT0049: Error loading SCI from module: javax.servlet.jstl.api:main
Caused by: org.jboss.modules.ModuleLoadException: Error loading module from modules/org/apache/xalan/main/module.xml
Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to resolve artifact 'xalan:serializer:2.7.1.jbossorg-2' (position: END_TAG seen ...esources>\\n <artifact name=\"xalan:serializer:2.7.1.jbossorg-2\"/>... @5:57) "},
"WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"8cf83a03-d940-4e8b-b223-f9a9e00976ce.war\".INSTALL"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}

最佳答案

Wildfly Swarm的gradle插件存在很多问题,例如

https://issues.jboss.org/browse/SWARM-542

https://issues.jboss.org/browse/SWARM-826

this comment并没有使我确信它们很快就会被修复。

为此,目前我的方法只是假设可靠地使用Gradle构建Swarm应用程序的唯一方法是开始使用Maven构建空心的Swarm uberjar,然后使用Gradle或(我已经完成),在Docker中。

您会错过自动分数检测(无论如何对于我来说似乎都不起作用),但另一方面,如果您没有为每个构建都构建整个uberjar,您会获得更快的构建时间。当然,由于Maven显然是Red Hat的一等公民,因此您将自己与不受供应商支持的构建工具脱钩。

有关空心uberjars的更多信息:

https://wildfly-swarm.gitbooks.io/wildfly-swarm-users-guide/content/getting-started/tooling/maven-plugin.html

要使用uberjar部署应用程序,您只需将WAR添加到命令行即可:

java -jar my-hollow-swarm.jar my-application.war

顺便说一句,您还可以传递配置和其他详细信息:
java -jar my-hollow-swarm.jar my-application.war -c /etc/config.xml
java -jar my-hollow-swarm.jar my-application.war --help

关于gradle - Wildfly Swarm部署问题-无法解决工件 'xalan:serializer:2.7.1.jbossorg-2',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41826619/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com