• Post Reply Bookmark Topic Watch Topic
  • New Topic

ejb 3.0 lookup  RSS feed

 
riccardo alfrilli
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
i'm trying to use annotation with ejb 3.0 in an application client project

this is my session bean Remote Interface:



this is my Ejb Implementation:


and finally the application client main:



it's return a nullpointerexception.I'm using netbeans 6.1 and glassfish somebody can help?tnx
 
Nitin Takale
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dude,

Since you are using netbeans I'm guessing that you are using Glassfish So..

come back to command prompt.........

set path to jdk/bin then set classpath to GLASSFISH_HOME/lib/javaee.jar and appserv-rt.jar and then check out.

Hope it'll solve your problem
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36446
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nitin,
Can you adjust your display name from "NITIN TAKALE" to "Nitin Takale" ? It's a bit jarring to read all in uppercase. You can easily change it in your profile.

Thanks.
 
riccardo alfrilli
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tnx for the answer!to solve my problem i hate to create an enterprise application with ejb module and application client module...now that's work!
 
Jetendra Ivaturi
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is how we look up in weblogic, where HelloWorldEJB is a mapped name.

Hashtable p=new Hashtable();
p.put(Context.PROVIDER_URL,"t3://localhost:7001");
p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");


Context context = new InitialContext(p);
pw.println("got the context");
Object ref=context.lookup("HelloWorldEJB#stateless.bean.CalculatorRemote");
CalculatorRemote helloWorldEJB = (CalculatorRemote)PortableRemoteObject.narrow(ref,CalculatorRemote.class);
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!