This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Client  and Server EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply locked New topic

Client and Server EJB

liliane fahmy

Joined: Aug 24, 2012
Posts: 22
Hi all
I have client and server projects.
The server project is a Message -driven project which receive message from the Client .
The problem is :I want to a add EJB module(EJB session bean) in Client project as the server(message driven bean project) can call this session bean .
I tried it by using Netbean:when the client attempt to connect to MDB ,it throw null pointer and the code is as follows:
Connection connection = connectionFactory.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(queue);
Message message = session.createTextMessage();
the exception is :Exception in thread "main" java.lang.NullPointerException
at terminalserver.Main.main(

Although I try to create Entreprise application client project to send a message to my MDB ,it work correctly.
The summary of my problem ,I want my 2 EJB Project,the first has MDB and the other has Session bean and can call each other.
Any help to make my project work .
Thanks and best regards.
Ranganathan Kaliyur Mannar

Joined: Oct 16, 2003
Posts: 1101

Please do not create duplicate posts, it doesn't help anyone. Locking this thread. Please continue your discussion in the other post

I agree. Here's the link:
subject: Client and Server EJB
jQuery in Action, 3rd edition