This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes How to run client for EJB3, Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "How to run client for EJB3," Watch "How to run client for EJB3," New topic
Author

How to run client for EJB3,

Ram Venkat
Greenhorn

Joined: Nov 28, 2007
Posts: 29
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


Ram Venkat<br />----------<br />SCJP 1.4<br />SCWCD 1.4<br />SCBCD 5 (In Process..)
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3652

NullPointer exceptions are insanely common, you might want to be a tad more specific. Also consult glassfish tutorials for getting started with glassfish.


My Blog: Down Home Country Coding with Scott Selikoff
Bill Shirley
Ranch Hand

Joined: Nov 08, 2007
Posts: 457
particularly, give the exact copy/pasted code (or a snippet), and the exact output, and

use the CODE tags


Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);
Ram Venkat
Greenhorn

Joined: Nov 28, 2007
Posts: 29
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.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to run client for EJB3,
 
Similar Threads
How to run EJB3 client
How does context.lookup work ?
lookup an EJB3 using local interface from helper classes in weblogic10
Help needed to deploy HelloWorld EJB
EJB directory Structure and Look up string