我试图将应用程序(.ear文件)部署到JBoss 5,我收到以下错误.该应用程序在4.2.2下部署正常.
15:31:33,172 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/ASE/ext/jboss-5.0.0.GA/server/all/dep loy/UGC-WS.ear state=PreReal mode=Manual requiredState=Real org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/C:/ASE/ext/jboss-5.0.0.GA/server/all/deploy/UGC-WS. ear/ugc-ws.war at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177) at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439) at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157) at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210) at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598) at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553) at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781) at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545) at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304) at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205) at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405) at org.jboss.Main.boot(Main.java:209) at org.jboss.Main$1.run(Main.java:547) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.ClassCastException: org.jboss.metadata.ear.spec.JavaModuleMetaData at org.jboss.wsf.container.jboss50.deployment.metadata.JSEArchiveMetaDataAdapter.buildMetaData(JSEArchiveMetaDataAdap ter.java:76) at org.jboss.wsf.container.jboss50.deployment.metadata.ContainerMetaDataAdapter.buildContainerMetaData(ContainerMetaD ataAdapter.java:76) at org.jboss.wsf.container.jboss50.deployment.metadata.ContainerMetaDataDeploymentAspect.create(ContainerMetaDataDepl oymentAspect.java:51) at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.create(DeploymentAspectManagerImpl.java:121) at org.jboss.wsf.container.jboss50.BareWSFRuntime.create(BareWSFRuntime.java:61) at org.jboss.wsf.container.jboss50.deployer.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:84) at org.jboss.wsf.container.jboss50.deployer.AbstractDeployerHookEJB.deploy(AbstractDeployerHookEJB.java:43) at org.jboss.wsf.container.jboss50.deployer.AbstractWebServiceDeployer.internalDeploy(AbstractWebServiceDeployer.java :60) at org.jboss.wsf.container.jboss50.deployer.WebServiceDeployerEJB.internalDeploy(WebServiceDeployerEJB.java:112) at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50) at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171) ... 19 more 15:31:33,203 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS F OR DETAILS): *** CONTEXTS IN ERROR: Name -> Error vfszip:/C:/ASE/ext/jboss-5.0.0.GA/server/all/deploy/UGC-WS.ear -> java.lang.ClassCastException: org.jboss.metadata.ear.spec.J avaModuleMetaData
这是来自控制台的错误消息,我无法从中得到很多...
该应用程序只包含Web服务和一个在启动时加载以初始化和缓存某些数据的servlet.
我们有一个EAR文件,其中包含我们使用的库的一些JAR文件(其中一个名为ugc-ws.jar),还有一个带有web.xml的WAR文件来加载一个servlet - 这个WAR文件也有在它的lib目录中使用相同的ugc-ws.jar,因为servlet在JAR中.所以基本上我们有主要的EAR文件,并且在其中有多个jar文件,以及一个WAR文件 - 它的lib目录中也有一个JAR文件.并且错误看起来像来自WAR.
这是"jar -tf ugc-ws.war"的输出:
>jar -tf ugc-ws.war META-INF/ META-INF/MANIFEST.MF WEB-INF/ WEB-INF/web.xml WEB-INF/lib/ WEB-INF/jboss-web.xml WEB-INF/lib/ugc-ws.jar
仅仅是为了测试,我从.EAR重新启动.WAR文件,应用程序部署没有任何错误,但显然没有来自WAR的数据,我无法使用该应用程序.我正在部署的方式就是将.EAR文件放到server\all\deploy目录中.
我已经尝试将ugc-ws.jar分成两个独立的jar,一个只有webservices,另一个只有servlet,但我仍然收到同样的错误.
奇怪的是,这在JBoss 4中运行良好,但在JBoss 5上运行不正常.
谢谢
这并不奇怪.
JBoss 4.2不符合Java5EE标准.JBoss 5.0 IS兼容.
在我看来,你在战争的某个地方有一个有问题的设置.该错误仅出现在JBoss 5中,因为在此版本中强制执行.
只是一个快速猜测.你的jboss-web.xml可能有错误的dtd. 看看这个.
我还建议您重新阅读JBoss文档,特别是5.0的发行说明以及他们为4.2用户提供的任何迁移技巧