File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 1100

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

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Client and Server EJB
It's not a secret anymore!