This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
Author

EJB 3 and Websphere Application Server 8

Martin Reuter
Greenhorn

Joined: Sep 11, 2008
Posts: 3
Hello,
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
Greenhorn

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
Greenhorn

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

http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Fcejb_bindingsejbfp.html
Claude Moore
Ranch Hand

Joined: Jun 24, 2005
Posts: 430
    
    1

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.


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: EJB 3 and Websphere Application Server 8
 
Similar Threads
Error: javax.naming.NameNotFoundException: SignOn not bound
newbie error
Please help me to create jar for ejb
java.lang.NoClassDefFoundError
Here is the complete JBoss Config. for EJB