• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

ejb 3.0 lookup

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author & internet detective
Posts: 42134
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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);
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic