2012-11-27 113 views
-1

我嘗試在JBoss 7.1.1上部署包含war文件的ear-file。無法在JBoss 7.1.1上部署.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的創建爆炸版耳和戰爭文件:

$JBOSS_HOME/standalone/tmp/vfs/tempe4d6b1edc6852af5/bof-ear.ear-870d0776055a3379/contents/bof-war.war/ 

這個戰爭目錄是e MPTY。這就是爲什麼無法找到文件/WEB-INF/spring.context.cfg.xml的原因。

任何建議可能是錯誤或缺少我的ear-file? 非常感謝!

問候, 菲利克斯

+0

這個問題是不可讀的。請重新格式化。 –

+0

你是如何生成耳朵文件及其內部戰爭的?你用過jar命令嗎,日食......? – Toni

+0

我使用maven構建項目,所以ear文件由maven-ear-plugin生成。 – Felix

回答

0

我想我剛剛發現了問題:由於某些原因,耳朵存檔內的戰爭不是歸檔,但其分解的文件夾。在手動將耳邊的戰爭加入進來之後,JBoss很高興。我只需要現在就明白,爲什麼maven不會在耳朵檔案中創建一個戰爭檔案。

相關問題