I'm trying to load a properties file using Spring's @PropertySource annotation. The properties file is stored in a Wildfly 8 module. The error message that I'm getting is:
class path resource [campaigner.properties] cannot be opened because it does not exist
Here's the Java code, which is used by the application's services.
@Configuration
@PropertySource("classpath:campaigner.properties")
class ServiceConfigImpl implements ServiceConfig
{
@Autowired
private Environment env;
@Bean(name = "serviceConfig")
public ServiceConfig getServiceConfig()
{
return new ServiceConfigImpl(this.env);
}
}
Here's my jboss-deployment-structure.xml, which I'm putting in the META-INF directory of my .ear file.
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="com.dr_dee_sw.campaigner" />
</dependencies>
</deployment>
</jboss-deployment-structure>
I've also put a MANIFEST.MF file in the META-INF directory
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
Here's my module file, which I've put in WILDFLY_HOME\modules\com\dr_dee_sw\campaigner\main directory, along with the campaigner.properties file
<module xmlns="urn:jboss:module:1.1" name="com.dr_dee_sw.campaigner">
<resources>
<resource-root path="."/>
</resources>
</module>
What am I missing?