access entity bean

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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top