简体   繁体   中英

Cannot find properties file in class path - Error while deploying EAR

Getting the following ERROR while trying to deploy a EAR project in JBoss AS 7. (MSC service thread 1-5) Context initialization failed. java.io.FileNotFoundException: class path resource [.properties] cannot be opened because it does not exist

A more detailed snapshot of the errors is given below.

16:20:08,548 ERROR [org.springframework.web.servlet.DispatcherServlet]
(MSC service thread 1-5) Context initialization failed:
org.springframework.beans.factory.BeanDefinitionStoreException: 
Failed to parse configuration class [xx.xx.Config]; nested exception
is java.io.FileNotFoundException: class path resource
[wwwr.properties] cannot be opened because it does not exist at
org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:181)
[spring-context-4.2.1.RELEASE.jar:4.2.1.RELEASE]  Caused by:
java.io.FileNotFoundException: class path resource [wwwr.properties]
cannot be opened because it does not exist



16:20:08,588 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyWeb]]
(MSC service thread 1-5)  StandardWrapper.Throwable:
org.springframework.beans.factory.BeanDefinitionStoreException: Failed
to parse configuration class [com.xx.Config];  nested exception is
java.io.FileNotFoundException: class path resource [wwwr.properties]
cannot be opened because it does not exist

I am using JBoss AS7 server and MyEclipse as IDE.

Well I found the solution to be involving the following steps

1) Make sure that the property file is in the Class Path of the projects involved or at least in the modules deployed in Jboss. 1- a) Verify that the modules.xml file has the right entries

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.xx.yy">
<resources>
<resource-root path="./properties/"/>

2) Verify that the Manifest.mf file in the EAR has the required dependencies.

Dependencies: com.xx.yy

3) Clean build and Deploy to server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM