Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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: 40912
840
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);
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic