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

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top