-
where to put the customized xml config file and how to read it (5 messages)
- Posted by: zhebin cong
- Posted on: July 04 2008 09:43 EDT
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 lotThreaded Messages (5)
- Re: where to put the customized xml config file and how to read by James David on July 07 2008 01:23 EDT
- Re: where to put the customized xml config file and how to read by zhebin cong on July 07 2008 23:29 EDT
- Re: where to put the customized xml config file and how to read by James David on July 08 2008 04:34 EDT
- Re: where to put the customized xml config file and how to read by zhebin cong on July 07 2008 23:29 EDT
- Re: where to put the customized xml config file and how to read by zhebin cong on July 13 2008 07:50 EDT
- Another solution by Noe Samuhel on June 15 2011 10:09 EDT
-
Re: where to put the customized xml config file and how to read[ Go to top ]
- Posted by: James David
- Posted on: July 07 2008 01:23 EDT
- in response to zhebin cong
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. -
Re: where to put the customized xml config file and how to read[ Go to top ]
- Posted by: zhebin cong
- Posted on: July 07 2008 23:29 EDT
- in response to James David
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? -
Re: where to put the customized xml config file and how to read[ Go to top ]
- Posted by: James David
- Posted on: July 08 2008 04:34 EDT
- in response to zhebin cong
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. -
Re: where to put the customized xml config file and how to read[ Go to top ]
- Posted by: zhebin cong
- Posted on: July 13 2008 07:50 EDT
- in response to zhebin cong
Thank you very very............much!!!!!!!!!!!!!!! it works very well -
Another solution[ Go to top ]
- Posted by: Noe Samuhel
- Posted on: June 15 2011 10:09 EDT
- in response to zhebin cong
I also had this problem, but with my <a href="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.