cancel
Showing results for 
Search instead for 
Did you mean: 

How to consume Stateless session bean (ejb3.0)

Former Member
0 Kudos

Hi,

Using SAP NWDS, and Java EE 5 engine, I created an EJB 3.0 project (using the wizard) that includes my bean, local and remote classes with the correponding annotation.

Now I have headhackes trying to consume (at least to call a methode from my bean).

Here is the framework:

Ejb project includes: myClassBean, myClassLocal (interface), myClassRemote(interface).

In another java project, I try to use my bean method like this:


InitialContext ctx = new InitialContext();
myClassRemote classRemote= (myClassRemote) ctx.lookup("sap.com/<name of the ear>/myClassBean");
	
ResultSet rs = classRemote.getMyMethod("param");

Thus this implementation do not work. The nasted exception is NameNotFound exception during the look up.

I readt a lot of document on the sdn and sap portal but all describe the creation of ejb and not really their consumption.

Can you help?

Thanks in advance,

Marc

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you very much for your help and support. THis was really helpful

Former Member
0 Kudos

Hi,

Thanks for the (so) quick answer, but ideed no, this not helps.

As mentioned I parsed a lot of documentation already, including the one you just propose.

The code I inserted to the initial post was wrote based on this document but with no success.

Is that the right approach? if yes, what are the missing steps (ejb 3.0)?

Thanks,

Marc

Vlado
Advisor
Advisor
0 Kudos

OK, as I can see above the lookup string is incorrect. Please check again in the before mentioned article.

-Vladimir

Vlado
Advisor
Advisor
0 Kudos

Hi Marc,

Hope <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/605ff5f2-e589-2910-3ead-e558376e6f3d">this</a> answers your questions!

Cheers,

Vladimir