Community

@Service loading resource file fails

created by Luca Merolla in EJB 3.0 - View the full discussion

Hi there,

 

I was trying to implement a cache with Infinispan and the annotation @Service for making it Singleton, so in the constructor I have put something like this:

 

...
manager = new DefaultCacheManager("mycache.xml"); 
cache = manager.getCache("testCache"); 
...

 

It fails on the startup of the application, it can't find the mycache.xml files.
I have tried also with different paths like resources/mycache.xml and /mycache.xml

 

The fact is that *properties files are loaded correctly with resources/file.properties but those are loaded after the application has been deployed.
I suppose the problem is because the @Service is trying to load the files from different locations or in a different way. or the resources are not available until the application is deployed.

 

Does anybody of you have experienced this problem before?

 

Cheers,
Luca

Reply to this message by going to Community

Start a new discussion in EJB 3.0 at Community