在将 J2EE 项目迁移到 Jboss 6.1 时需要帮助
Posted
技术标签:
【中文标题】在将 J2EE 项目迁移到 Jboss 6.1 时需要帮助【英文标题】:Need help on migrating J2EE project to Jboss 6.1 【发布时间】:2017-06-07 23:34:36 【问题描述】:我正在尝试将 J2EE 项目从 Websphere 迁移到 JBoss 6.1 和 EJB 3.0。
我已经成功配置了所有数据源,但是当我启动服务器时,出现异常(见下文):
有谁知道发生了什么,请给我一些建议吗?非常感谢。
08:56:54,715 INFO [org.jboss.web] (ServerService Thread Pool -- 65) JBAS018210: Register web context: /payment
08:56:54,716 INFO [org.apache.catalina.core] (ServerService Thread Pool -- 65) JBWEB001093: The listener com.sun.faces.config.ConfigureListener is already configured for this context, the duplicate definition has been ignored
08:56:54,716 INFO [org.apache.catalina.core] (ServerService Thread Pool -- 65) JBWEB001093: The listener com.sun.faces.config.ConfigureListener is already configured for this context, the duplicate definition has been ignored
08:56:54,763 INFO [org.apache.catalina.core.ContainerBase.[jboss.web]. [default-host].[/payment]] (ServerService Thread Pool -- 65) Initializing Spring root WebApplicationContext
08:56:55,256 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/payment]] (ServerService Thread Pool -- 65) JBWEB000287: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB- INF/applicationContext.xml]; nested exception is java.lang.NoClassDefFoundError: org/jboss/virtual/VirtualFileVisitor
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitio ns(XmlBeanDefinitionReader.java:412) [spring-beans- 3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDe finitions(AbstractBeanDefinitionReader.java:143) [spring-beans- 3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDe finitions(AbstractBeanDefinitionReader.java:178) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) [spring-web-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93) [spring-web-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) [spring-web-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) [spring-web-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) [spring-web-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.8.0_45]
at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_45]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_45]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.NoClassDefFoundError: org/jboss/virtual/VirtualFileVisitor
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:348) [spring-core-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:269) [spring-core-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1197) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:204) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:204) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1335) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:136) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE]
... 24 more
Caused by: java.lang.ClassNotFoundException: org.jboss.virtual.VirtualFileVisitor from [Module "deployment.payment.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118) [jboss-modules.jar:1.3.0.Final-redhat-2]
... 37 more
08:56:55,303 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 65) Initializing Mojarra 2.1.19-jbossorg-1 20131024-0833 for context '/payment'
08:56:56,812 INFO [org.hibernate.validator.internal.util.Version] (ServerService Thread Pool -- 65) HV000001: Hibernate Validator 4.3.1.Final-redhat-1
08:56:58,181 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 65) Monitoring jndi:/default-host/payment/WEB-INF/faces-config.xml for modifications
08:56:58,197 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 65) JBWEB001103: Error detected during context /payment start, will stop it
08:56:58,197 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/payment]] (ServerService Thread Pool -- 65) Closing Spring root WebApplicationContext
08:56:58,197 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 65) MSC000001: Failed to start service jboss.web.deployment.default- host./payment: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./payment: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java: 96)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.8.0_45]
at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_45]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_45]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161)
at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService. java:60)
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93)
... 6 more
08:56:58,452 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "payment.war" (runtime-name : "payment.war")
08:56:58,452 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.web.deployment.default-host./payment: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./payment: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
08:56:58,468 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
08:56:58,468 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
08:56:58,468 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14) started (with errors) in 16031ms - Started 496 of 559 services (2 services failed or missing dependencies, 59 services are passive or on-demand)
【问题讨论】:
据我回忆,您需要升级您的 spring 框架,因为它的某些版本检测到它们在(旧版本)JBoss 上并希望能够访问 JBoss VFS ,在较新的 JBoss 版本中不再存在。 【参考方案1】:这个文件是否存在于你的战争文件 org/jboss/virtual/VirtualFileVisitor 中? 你能检查一下这个文件已经在 JBOSS 中提供并且需要从那里加载。
【讨论】:
以上是关于在将 J2EE 项目迁移到 Jboss 6.1 时需要帮助的主要内容,如果未能解决你的问题,请参考以下文章
作为部署安装时的 jboss-eap-6.1 oracle 驱动程序定义
从 JBoss 7 迁移到 WildFly 9 时使用 CMT 的 EJB
将 glassfish JEE8 weapp 迁移到 Wildfly10 (Jboss) - eclipseLink 不创建数据库表