Discussions

EJB design: where to put the customized xml config file and how to read it

  1. hello all i am new to ejb3, i write a stateless session bean, and i write a xml file as customized configuration, i want to read it from my sessionbean, not sure where i should put the file (META-INF?)? and how can i read it in my session bean? Thanks a lot
  2. am not sure, but you can try the following : pack the xml in the same ejb jar, and in your session bean you can do a this.getClassLoader().getResourceAsString("/conf/config.xml") kind of work. This I have done from a servlet to read from WEB-INF, so hope this works here too.
  3. Thanks, yes, it works if i put it with the code, but if i put it in META-INFO directory, it doesn't work, how can i read the file in the MEAT-INFO?
  4. it believe it is META-INF, it must work if u read it as getResourceAsStream("/META-INF/config.xml"), it is case sensitive. If it doesnt work it may be for unknown good reasons, leave it and use a different folder.
  5. Thank you very very............much!!!!!!!!!!!!!!! it works very well
  6. Another solution[ Go to top ]

    I also had this problem, but with my <a href="private" rel="nofollow">http://www.scalematrix.com/cloud-computing/">private cloud solution</a> I was able to track all my data down. That means I don't have to share resources anymore, I know exactly where my data is and I have complete administrative control over it. You could also try this for a change.