I am trying to get the EntityContext's environment . Since Sun deprecated the
getEnvironment() method. I have to use the JNDI interface.
My code looks like this:
try {
InitialContext ic1 = new InitialContext();
InitialContext ic2 = (InitialContext)ic1.lookup("java:comp/env");
Hashtable env = ic2.getEnvironment();
Enumeration keys = env.keys();
while(keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = env.get(key);
System.err.println(key.toString() + " = " + value.toString());
}
} catch (Exception e) {
}
My problem is that I am getting an Exception
java.lang.ClassCastException: com.evermind.util.r
at
com.tsis.utils.net.JNDIEnvironment.showEnvironment(JNDIEvironment.java:32)
....
....
....
on the line:
InitialContext ic2 = (InitialContext)ic1.lookup("java:comp/env");
I looked in the orion.jar file and that file is there. Not sure what to make of
this. Does anybody have any idea what is going on??