0
我试图使用Spring的@PropertySource注解加载属性文件。属性文件存储在Wildfly 8模块中。我得到的错误消息是:Spring 3 @PropertySource在Wildfly 8模块中找不到属性文件
class path resource [campaigner.properties] cannot be opened because it does not exist
以下是应用程序服务使用的Java代码。
@Configuration
@PropertySource("classpath:campaigner.properties")
class ServiceConfigImpl implements ServiceConfig
{
@Autowired
private Environment env;
@Bean(name = "serviceConfig")
public ServiceConfig getServiceConfig()
{
return new ServiceConfigImpl(this.env);
}
}
这是我放在我的.ear文件的META-INF目录下的jboss-deployment-structure.xml。
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="com.dr_dee_sw.campaigner" />
</dependencies>
</deployment>
</jboss-deployment-structure>
我还放了MANIFEST.MF文件中META-INF目录
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.9.4
Created-By: 1.7.0_71-b14 (Oracle Corporation)
Dependencies: com.dr_dee_sw.campaigner
这是我的模块文件,我已经把WILDFLY_HOME \模块\ COM \ dr_dee_sw \活动家\主目录以及campaigner.properties文件
<module xmlns="urn:jboss:module:1.1" name="com.dr_dee_sw.campaigner">
<resources>
<resource-root path="."/>
</resources>
</module>
我在想什么?