G
Grzesiek
Hi
Im using jDeveloper 10.1.3.3 and using wizard i created CMP entity
bean from table i created myself. The bean has only local and local
home interfaces. Now i want to creat a class that accesses the bean,
for example to display a record on the screen. I realised that i cant
just type in a new class:
InitialContext ic = new InitialContext();
myBeanLocalHome myBeanLocalHome =
(myBeanLocalHome)ic.lookup("myBean");
beacose i get error:
javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource file: java.naming.factory.initial
But ok, i can type:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.PROVIDER_URL,
"ormi://localhost:23791/default");
env.put(Context.SECURITY_PRINCIPAL,"oc4jadmin");
env.put(Context.SECURITY_CREDENTIALS,"password");
there is no error but "myBean" is not found :-(
Whats the problem?
thanx in advance
Im using jDeveloper 10.1.3.3 and using wizard i created CMP entity
bean from table i created myself. The bean has only local and local
home interfaces. Now i want to creat a class that accesses the bean,
for example to display a record on the screen. I realised that i cant
just type in a new class:
InitialContext ic = new InitialContext();
myBeanLocalHome myBeanLocalHome =
(myBeanLocalHome)ic.lookup("myBean");
beacose i get error:
javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource file: java.naming.factory.initial
But ok, i can type:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.PROVIDER_URL,
"ormi://localhost:23791/default");
env.put(Context.SECURITY_PRINCIPAL,"oc4jadmin");
env.put(Context.SECURITY_CREDENTIALS,"password");
there is no error but "myBean" is not found :-(
Whats the problem?
thanx in advance