Hi,
Please reply directly as I am not on this alias.
In the Apache JDO project we download the fscontext.jar and providerutil.jar from Sun which is a PITA because of the licensing.
Is there an equivalent functionality available in Geronimo that can be used? I downloaded the naming and naming-builder jars but I can't tell at first glance if they have the goods.
What we use the jars for is to bind an instance to a naming context and then look it up:
protected PersistenceManagerFactory getPMF(String name) {
Context context = null;
try {
//We need a JNDI context which contains a PMF instance.
//For this reason, we create a JNDI context,
//create a PMF instance and bind that to the context.
context = new InitialContext();
if (name.equals(validPropertiesFile)) {
PersistenceManagerFactory pmf =
JDOHelper.getPersistenceManagerFactory(new File(name));
verifyProperties(pmf, loadProperties(validPropertiesFile));
context.bind(jndiName, pmf);
}
return JDOHelper.getPersistenceManagerFactory(jndiName, context);
} catch (NamingException e) {
throw new JDOFatalException("Caught NamingException trying to bind " +
e.getMessage(), e);
} finally {
if (context != null) {
try {
context.unbind(jndiName);
context.close();
} catch (NamingException e) {
fail("Caught NamingException trying to unbind or close." +
e.getMessage());
// stay quiet
}
}
}
}
Thanks for any help,
Craig
Craig Russell
P.S. A good JDO? O, Gasp!