我尝试在JBoss 7.1.1上部署包含war文件的ear文件。
ear的META-INF /目录中的application.xml如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<application version="6">
<module>
<web>
<web-uri>bof-war.war</web-uri>
<context-root>/bof-war</context-root>
</web>
</module>
</application>
部署失败,但出现以下异常:
14:06:21,265 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "bof-ear.ear"
14:06:21,313 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "bof-war.war"
14:06:22,835 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Tomcat6InjectionProvider:org.apache.catalina.util.DefaultAnnotationProcessor' for service type 'com.sun.faces.spi.injectionprovider'
14:06:22,835 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Jetty6InjectionProvider:org.mortbay.jetty.plus.annotation.InjectionCollection' for service type 'com.sun.faces.spi.injectionprovider'
14:06:22,836 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015893: Encountered invalid class name 'org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer' for service type 'org.xmlpull.v1.XmlPullParserFactory'
14:06:23,027 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.2)
14:06:23,037 INFO [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.
14:06:23,039 INFO [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.
14:06:23,041 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/bof-war]] (MSC service thread 1-1) No Spring WebApplicationInitializer types detected on classpath
14:06:23,057 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/bof-war]] (MSC service thread 1-1) Initializing Spring root WebApplicationContext
14:06:23,057 INFO [org.springframework.web.context.ContextLoader] (MSC service thread 1-1) Root WebApplicationContext: initialization started
14:06:23,104 INFO [ch.homegate.base.jsf2.spring.PrimaryResolverXmlWebApplicationContext] (MSC service thread 1-1) Refreshing Root WebApplicationContext: startup date [Tue Nov 27 14:06:23 CET 2012]; root of context hierarchy
14:06:23,123 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (MSC service thread 1-1) Loading XML bean definitions from ServletContext resource [/WEB-INF/spring.context.cfg.xml]
14:06:23,124 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-1) Context initialization failed: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/spring.context.cfg.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/spring.context.cfg.xml]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341) [spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) [spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174) [spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209) [spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180) [spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131) [spring-context-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:530) [spring-context-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:444) [spring-context-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/spring.context.cfg.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:140) [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328) [spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
... 20 more
在部署过程中,JBoss会创建ear和war文件的爆炸版本:
$JBOSS_HOME/standalone/tmp/vfs/tempe4d6b1edc6852af5/bof-ear.ear-870d0776055a3379/contents/bof-war.war/
此war-directory为空。这就是为什么无法找到文件/WEB-INF/spring.context.cfg.xml的原因。
我的耳文中有什么可能错误或缺失的建议吗? 非常感谢提前!
此致 菲利克斯
答案 0 :(得分:0)
我想我刚刚发现了问题:由于某种原因,耳内存档中的战争不是存档而是爆炸文件夹。在手动将战争放入耳内之后,JBoss很高兴。我现在必须要找出,为什么maven不会在ear存档中创建一个war存档。