• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to run client for EJB3,

 
Ram Venkat
Greenhorn
Posts: 29
  • 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
 
Scott Selikoff
author
Saloon Keeper
Posts: 4010
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NullPointer exceptions are insanely common, you might want to be a tad more specific. Also consult glassfish tutorials for getting started with glassfish.
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
particularly, give the exact copy/pasted code (or a snippet), and the exact output, and

use the CODE tags
 
Ram Venkat
Greenhorn
Posts: 29
  • 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