-
2. Re: Locating xml files from my bean
gags_78 Jun 28, 2002 9:36 AM (in response to gags_78)Thanks a million Adrian however I'm not sure what you mean by env entries.. Is there an example within the samples?
Thanks,
Mark. -
3. Re: Locating xml files from my bean
adrian.brock Jun 28, 2002 10:02 AM (in response to gags_78)env entries are part of the spec.
They allow properties to be bound into jndi using ejb-jar.xml just for that application.
That part of the link isn't relevent for your problem.
Regards,
Adrian -
4. Re: Locating xml files from my bean
gags_78 Jun 28, 2002 10:50 AM (in response to gags_78)CHeers adrian,
Why aren't ejb's supposed to be allowed to access static files within the ear file?
By the way I am able to access my properties file no bother but I can't access any other file. Will this code return an inputStream of some sort?
Thread.currentThread().getContextClassLoader().getResourceAsStream("META-INF/normal.xml");
Sorry for the trouble.
Thanks,
Mark. -
5. Re: Locating xml files from my bean
adrian.brock Jun 28, 2002 12:44 PM (in response to gags_78)Yes, getResourceAsStream returns an InputStream
The ejb spec "recommends" that ejbs do not access the
file system directly. In fact is suggests using a
security manager to stop them doing so.
Running a security manager introduces extra overhead,
so if you trust your apps it isn't necessary.
Using code like
new File("normal.xml")
will try to locate normal.xml in your current directory.
Which is probably ${jboss_dist}/bin
For completeness, I believe it is possible to bind
a file system into jndi, but I have never done this,
and it is probably not relevent to your problem.
Regards,
Adrian -
6. Re: Locating xml files from my bean
gags_78 Jun 28, 2002 3:57 PM (in response to gags_78)Can't thank you enough Adrian. That's really sorted me out.
Thanks again,
Mark.