File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to run EJB3 client

 
Ram Venkat
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am very new to EJB3, configure following environment.
JAVA_HOME=java 5.0
J2EE_HOME=j2ee 1.5
Application server = glassfish,
BOOK = EJB3 IN ACTION


i successfully deplyed ear file (contails Interface ,bean class),
i written simple client with main method. looks like following

@EJB
RemoteInt remote = null;
p s v m(){
remote.display();
}

i am getting NullPointerException,


What are the class/jar files in need to place in CLASSPATH


Thanks
 
Tushar Roy
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dnt think that dependency injection happens on simple class with main method....It happens only on container managed classes like servlets, JSF ,other EJBs.....
 
Ram Venkat
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Finally i found solution for this problem



@EJB
RemoteInt remote = null; It's creating problem because it's assigned to null;
p s v m(){
remote.display();
}

i changed to above code to
@EJB
[B]RemoteInt remote;

It's working now.

but can any one give explanation on this.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic