Hi all,
I am new to EJB's and First time creating EJB's in Websphere Version: 5.1.2. I have created the bean project in the Websphere and written a method myMethod() in which I have written "Hello Bean".
This is running absolutely fine when I test the Bean with the websphere's own JNDI explorer and its giving me the message what I have written in myMethod().
The same thing when I tried to Run using 1. Servlet OR 2. JSP OR 3. Plain Java class with main() (I created the new dynamic web project)I am not getting the desired output and getting the error.
There are no compilation error in the code also the packaging and placing of Beans is not an issue because the websphere is itself creating everything.
***********Error in Running servlet is ************
[2/27/07 16:01:46:950 IST] 7b388473 WebGroup I SRVE0180I: [HelloWeb] [/HelloWeb] [Servlet.LOG]: Test: init
[2/27/07 16:01:47:294 IST] 7b388473 SystemErr R javax.naming.NameNotFoundException: Context: localhost/nodes/localhost/servers/server1, name: jndiname: First component in name jndiname not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL

mg.org/CosNaming/NamingContext/NotFound:1.0
[2/27/07 16:01:47:294 IST] 7b388473 SystemErr R at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:968)
[2/27/07 16:01:47:294 IST] 7b388473 SystemErr R at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:1399)
[2/27/07 16:01:47:294 IST] 7b388473 SystemErr R at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown Source)
[2/27/07 16:01:47:294 IST] 7b388473 SystemErr R at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3491)
[2/27/07 16:01:47:294 IST] 7b388473 SystemErr R at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1519)
[2/27/07 16:01:47:294 IST] 7b388473 SystemErr R at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1480)
[2/27/07 16:01:47:294 IST] 7b388473 SystemErr R at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1187)
[2/27/07 16:01:47:294 IST] 7b388473 SystemErr R at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1067)
[2/27/07 16:01:47:294 IST] 7b388473 SystemErr R at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
Let me know if you need any further help from my side I can provide the code of my Home/Remore/Implementation class But as I said everything is created by Websphere and there is no problem with the code as its running fine with its own JNDI explorer.
**************My EJB deployment descriptor is as below (This is created by Websphere)**********
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar id="ejb-jar_ID">
<display-name>FirstEJB</display-name>
<enterprise-beans>
<session id="HelloBean">
<ejb-name>HelloBean</ejb-name>
<home>com.HelloBeanHome</home>
<remote>com.HelloBean</remote>
<ejb-class>com.HelloBeanBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>
Thanks in advance for any help.
PS: I have also added the class path entry in my dynamic project where my servlet/jsp is located.
[ March 01, 2007: Message edited by: Mark Spritzler ]