【发布时间】:2018-02-23 19:34:45
【问题描述】:
当我在 Jboss 7.x EAP 中部署打包在耳中的 Spring Boot 应用程序时,我收到以下错误:
server.default-host./pepe: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./pepe: java.lang.RuntimeException: java.lang.IllegalStateException: Failed to load property source from location 'classpath:/application.xml'
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Failed to load property source from location 'classpath:/application.xml'
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:231)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
... 6 more
Caused by: java.lang.IllegalStateException: Failed to load property source from location 'classpath:/application.xml'
at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.loadIntoGroup(ConfigFileApplicationListener.java:476)
at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:465)
at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:386)
at org.springframework.boot.context.config.ConfigFileApplicationListener.addPropertySources(ConfigFileApplicationListener.java:225)
at org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:195)
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:182)
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:168)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:296)
at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:154)
at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:134)
at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:87)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:184)
耳朵的结构如下:
├── META-INF
│ ├── application.xml
│ └── jboss-deployment-structure.xml
├── evaluateboot_be-web-0.0.1-SNAPSHOT.war
└── lib
├── asm-5.0.4.jar
├── aspectjweaver-1.8.13.jar
├── bcpkix-jdk15on-1.55.jar
├── bcprov-jdk15on-1.55.jar
├── bval-core-1.1.2.jar
├── cache-api-1.0.0.jar
├── ccf2-8.0.0.4_MAPFRE.jar
├── cxf-core-3.1.12.jar
├── cxf-rt-bindings-soap-3.1.12.jar
├── cxf-rt-databinding-jaxb-3.1.12.jar
├── cxf-rt-frontend-jaxws-3.1.12.jar
├── cxf-rt-frontend-simple-3.1.12.jar
├── cxf-rt-security-3.1.12.jar
├── cxf-rt-security-saml-3.1.12.jar
├── cxf-rt-transports-http-3.1.12.jar
├── cxf-rt-ws-security-3.1.12.jar
├── cxf-rt-wsdl-3.1.12.jar
├── cxf-spring-boot-autoconfigure-3.1.12.jar
├── cxf-spring-boot-starter-jaxws-3.1.12.jar
├── dom4j-1.6.1.jar
├── ehcache-2.10.4.jar
├── evaluateboot-bo-0.0.1-SNAPSHOT.jar
├── evaluateboot_be-commons-0.0.1-SNAPSHOT.jar
├── evaluateboot_be-crud-dl-api-0.0.1-SNAPSHOT.jar
├── evaluateboot_be-crud-sr-api-0.0.1-SNAPSHOT.jar
├── evaluateboot_be-crud-sr-impl-0.0.1-SNAPSHOT.jar
├── evaluateboot_be.zeroConfig-0.0.1-SNAPSHOT.jar
├── guava-19.0.jar
├── hibernate-validator-5.3.6.Final.jar
├── httpclient-4.5.3.jar
├── httpcore-4.4.8.jar
├── jackson-annotations-2.8.0.jar
├── jackson-core-2.8.10.jar
├── jackson-databind-2.8.10.jar
├── jasypt-1.9.2.jar
├── jaxen-1.1.1_CXF_MAPFRE.jar
├── jboss-logging-3.3.1.Final.jar
├── jcl-over-slf4j-1.7.25.jar
├── jdom-1.1.jar
├── joda-time-2.9.9.jar
├── jul-to-slf4j-1.7.25.jar
├── log4j-over-slf4j-1.7.25.jar
├── logback-classic-1.1.11.jar
├── spring-aspects-4.3.13.RELEASE.jar
├── spring-beans-4.3.13.RELEASE.jar
├── spring-boot-1.5.9.RELEASE.jar
├── spring-boot-actuator-1.5.9.RELEASE.jar
├── spring-boot-autoconfigure-1.5.9.RELEASE.jar
├── spring-boot-starter-1.5.9.RELEASE.jar
...
我使用的 Spring Boot 版本是 1.5.9。
为什么 Spring Boot 会尝试加载位于 META-INF 文件夹中的 ear 部署描述符?
同样的耳朵在 Websphere 8.5.5.x 中正确部署
【问题讨论】:
标签: java spring spring-boot jboss7.x ear