wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes EJB 3 and Websphere Application Server 8 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB 3 and Websphere Application Server 8" Watch "EJB 3 and Websphere Application Server 8" New topic

EJB 3 and Websphere Application Server 8

Martin Reuter

Joined: Sep 11, 2008
Posts: 3
i want to use EJB 3 in my WAS8 application but it doesn't work.

First of all i created an remote-interface:

Then i created a session bean class:

So far so good. But now i want to call the session bean from a normal (no servlet, no ejb) java class but i doesn't work (NamingNotFoundException):

What is missing here or what is wrong? I tried a lot of things but nothing worked.

Thanks for your help!
saqib rashids

Joined: Mar 31, 2013
Posts: 6
It's been sometime since I have worked in EJB 3, but as long as I remember EJBs are (by default) bound in JNDI at the following location:
java:global/<applicationName>/<moduleName>/<bean component name>!<fully qualified interface name>

For example: java:global/myApp/myModule/MyBeanComponent!com.foo.MyBeanComponentLocalInterface

You can try looking up your EJB based on the above Jndi Url scheme.
saqib rashids

Joined: Mar 31, 2013
Posts: 6
As a reference, see the link:

Claude Moore
Ranch Hand

Joined: Jun 24, 2005
Posts: 427

Moreover, just remember that if you need to access EJBs from a plain Java client which runs outside the EJB container (for example, a swing application), you need to have EJB container's client jars on Java client classpath,
otherwise it won't work.

You may try and read following url which explains
required steps.

Just another - even if unrequired - advice from me. Even it seems a cool thing - and it have seemed so to me for a long time, believe me - nowadays I would not expose EJB functionalities
via EJB client. Simply, it's too complex, since you need to provide ejb client jars with your application and these client jars may need to be updated when you install fixes on your
appserver; you'll have to deal with firewalls and so on.

It's by far better use REST or SOAP webservices. With EJB 3, you can expose your services as webservices just with a couple of annotations (@Webservice and @Webmethod)

Hope this may help you, man.

I agree. Here's the link: http://aspose.com/file-tools
subject: EJB 3 and Websphere Application Server 8
Similar Threads
newbie error
Please help me to create jar for ejb
Here is the complete JBoss Config. for EJB
Error: javax.naming.NameNotFoundException: SignOn not bound