• 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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: 42055
926
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);
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic