On Apr 19, 2010, at 2:35 PM, Thiago Veronezi wrote:

try {
final ClassLoader loader;
loader = EjbServer.class.getClassLoader();
Properties prop = new Properties();
prop.load(loader.getResourceAsStream("jndi.properties"));

//Getting the openejb.xml file
File openejbXmlFile = FileUtils.getFile(SystemParams.tempFolder, config)
prop.put("openejb.configuration", openejbXmlFile.getAbsolutePath());
this.ctx = new InitialContext(prop);
} catch (Exception e) {
        throw new SystemException(e); //My custom exception
}               

This is cool. Just as a side note, the InitialContext class will go looking for jndi.properties files in the classpath and load them. Try without the 'prop.load(loader.getResourceAsStream("jndi.properties"));' and see if it doesn't just magically work.

-David

Reply via email to