Hi, I asked this question in the EJB and J2EE forum but couldn't get an appropriate answer. This forum is more EJB spec oriented, so I try again. If I deploy .properties files in the root of my .ear file. My classes can find them via getResource() or getResourceAsStream() as they where on the class path (at least on WebSphere). But I don't know if this is according to the EJB / J2EE spec. I couldn't find a statement if files in the root of the .ear are automatically included in the classpath and available to the ejb and web modules within the enterprise project.
Hi Peter, I guess that ear root must be in the classpath regardless of the appserver because otherwise how would it find classes? Now, if my above statement is correct then it would not matter what appserver you are using, if you put properties file in the ear root it is going to work via getResourceAsStream() thing. Any other ideas? Regards Maulin
I'm not surprised that the spec does not mention files, because they are banned:
An enterprise bean must not use the java.io package to attempt to access files and directories in the file system.
Although it may be too late to change things now, a solution consistent with the spec would be to store such data in a database for subsequent loading into a Properties or HashMap, or to use the bean's java:comp/env context.
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
posted 16 years ago
Originally posted by Maulin Vasavada: I guess that ear root must be in the classpath regardless of the appserver because otherwise how would it find classes?
I could've guessed that too, because it works for me. But I still don't know if this is just WebSpher magic or is this according to the specs?
Those who dance are thought mad by those who hear not the music. This tiny ad plays the bagpipes:
Devious Experiments for a Truly Passive Greenhouse!