Meaningless Drivel is fun!*
The moose likes EJB and other Java EE Technologies and the fly likes calling EJB method 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
Bookmark "calling EJB method" Watch "calling EJB method" New topic
Author

calling EJB method

Norman Meister
Greenhorn

Joined: Jul 03, 2009
Posts: 23
Hi All,
I have never worked with EJBs so I am kind of stuck with one problem.

I have to make use of one existing EJB project through my external standard java class. The existing EJB project makes use to some other packages which are also EJB projects and I am not allowed to change any functionality of the EJB project but to use them as it is.

I am just initilizing the class object of the EJB project and calling its method. Within the EJB project there is a method which is calling another method of the EJB class.

The problem is I dont see the EJB objects getting initilized first and then calling its method as it happens in a normal scenario, hence when that method gets called i get a null pointer execption.

Let me give you some idea by posting some code snippet.



I get an error message before the sequence reaches loadProfile(..), which in my sense is due to the fact that 'profileService' never was initilized in the EJB project.

profileService is object of another EJB project, which looks somethign like this:




Now I am calling the main EJB like this:




So my confusion is how can I make use of profileService.loadProfile(wsseHeader, userCredentials); ??

I tried to initilize:

but I get jndi binding and lots of other exception.

Please help.
E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 892
    
    9
Same advice as that given here: https://forums.oracle.com/forums/thread.jspa?threadID=2410474&tstart=0
Rajit vreddi
Greenhorn

Joined: Jul 05, 2012
Posts: 17
try this..

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: calling EJB method