I have created an entity bean with a method getMember. My session bean has this code - for which I am receiveing a javax.naming.NameNotFoundException: Missing Node - Member. How do I write this lookup???
public java.lang.String getMember(Integer memberid)
{
String strMemberName = null;
try {
Context ctx = new InitialContext();
// Object obj = ctx.lookup("java:comp/env/ejb/member");
Object obj = ctx.lookup("java:comp/env/Member");
MemberHome aMemberHome = (MemberHome)PortableRemoteObject.narrow(obj,MemberHome.class);
Member aMember = aMemberHome.findByPrimaryKey(memberid);
strMemberName = aMember.getFname();
return strMemberName;
} catch (ClassCastException cce) {
cce.printStackTrace();
return "ClassCastException " + cce.getMessage();
} catch (NamingException ne) {
ne.printStackTrace();
return "NamingException " + ne.getMessage();
} catch (FinderException fe) {
fe.printStackTrace();
return "FinderException " + fe.getMessage();
}
}
C:\BES\jdk\jdk1.4.1\bin\javaw -classpath "C:\TMP\whitepaper\classes;C:\BES\lib\asrt.jar;C:\BES\lib\lm.jar;C:\BES\lib\xmlrt.jar;C:\BES\lib\vbjorb.jar;C:\BES\lib\vbejb.jar;C:\BES\lib\vbsec.jar;C:\BES\lib\beandt.jar;C:\BES\lib\dx.jar;C:\BES\lib\axis\axis-bes.jar;C:\BES\lib\axis\axis-ant.jar;C:\BES\SonicMQ\lib\sonic_Client.jar;C:\OracleDriver\lib\ojdbc14.jar;C:\BES\jdk\jdk1.4.1\demo\jfc\Java2D\Java2Demo.jar;C:\BES\jdk\jdk1.4.1\demo\plugin\jfc\Java2D\Java2Demo.jar;C:\BES\jdk\jdk1.4.1\jre\lib\charsets.jar;C:\BES\jdk\jdk1.4.1\jre\lib\ext\dnsn s.jar;C:\BES\jdk\jdk1.4.1\jre\lib\ext\ldapsec.jar;C:\BES\jdk\jdk1.4.1\jre\lib\ext\localedata.jar;C:\BES\jdk\jdk1.4.1\jre\lib\ext\sunjce_provider.jar;C:\BES\jdk\jdk1.4.1\jre\lib\im\indicim.jar;C:\BES\jdk\jdk1.4.1\jre\lib\jaws.jar;C:\BES\jdk\jdk1.4.1\jre\lib\jce.jar;C:\BES\jdk\jdk1.4.1\jre\lib\jsse.jar;C:\BES\jdk\jdk1.4.1\jre\lib\rt.jar;C:\BES\jdk\jdk1.4.1\jre\lib\sunrsasign.jar;C:\BES\jdk\jdk1.4.1\lib\dt.jar;C:\BES\jdk\jdk1.4.1\lib\htmlconverter.jar;C:\BES\jdk\jdk1.4.1\lib\tools.jar" -Dvbroker.agent.enableLocator=false -DORBInitRef=NameService=iioploc://11.112.1.135:9999/NameService whitepaper.ProfileSessionTestClient1
-- Initializing bean access.
-- Succeeded initializing bean access through Home interface.
-- Execution time: 1547 ms.
-- Calling create()
-- Succeeded: create()
-- Execution time: 31 ms.
-- Return value from create(): Stub[repository_id=RMI:whitepaper.ProfileSession:0000000000000000,key=Se ...
-- Calling getMember(1)
-- Succeeded: getMember(1)
-- Execution time: 250 ms.
-- Return value from getMember(1): NamingException Missing Node - Member.
This is a copy of the error from the printstacktrace �
javax.naming.NameNotFoundException: Missing Node - Member
at com.inprise.j2ee.jndi.java.javaContext.internal_lookup(javaContext.java:522)
at com.inprise.j2ee.jndi.java.javaContext.internal_lookup(javaContext.java:532)
at com.inprise.j2ee.jndi.java.javaContext.internal_lookup(javaContext.java:532)
at com.inprise.j2ee.jndi.java.javaContext.internal_lookup(javaContext.java:532)
at com.inprise.j2ee.jndi.java.javaContext.lookup(javaContext.java:991)
at com.inprise.j2ee.jndi.java.javaContext.lookup(javaContext.java:996)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at whitepaper.ProfileSessionBean.getMember(ProfileSessionBean.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.inprise.ejb.ConcreteMethod.invoke(ConcreteMethod.java:32)
at com.inprise.ejb.EJBContext.invoke(EJBContext.java:166)
at com.inprise.ejb.Dispatcher.doInvoke(Dispatcher.java:1301)
at com.inprise.ejb.Dispatcher.invokeSecurityCheck(Dispatcher.java:1023)
at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:816)
at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:595)
at com.inprise.ejb.EJBHome.dispatcherInvokeBeanMethod(EJBHome.java:55)
at com.inprise.ejb.EJBHome$ComponentInterfaceMethodCache.invokeDispatcherMethod(EJBHome.java:1502)
at com.inprise.ejb.EJBHome.invokeDispatcherMethod(EJBHome.java:34)
at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:416)
at whitepaper.ProfileSessionPOAInvokeHandler.getMember(ProfileSessionPOAInvokeHandler.java:35)
at whitepaper.ProfileSessionPOAInvokeHandler.getMember(ProfileSessionPOAInvokeHandler.java:69)
at whitepaper.ProfileSessionPOA._invoke(ProfileSessionPOA.java:62)
at whitepaper.ProfileSessionPOA._invoke(ProfileSessionPOA.java:43)
at com.inprise.vbroker.poa.POAImpl.invoke(POAImpl.java:2693)
at com.inprise.vbroker.poa.ActivationRecord.invoke(ActivationRecord.java:109)
at com.inprise.vbroker.poa.ServerInterceptorManager$ARWrapper.invoke(ServerInterceptorManager.java:110)
at com.inprise.vbroker.GIOP.GiopProtocolAdapter.doRequest(GiopProtocolAdapter.java:824)
at com.inprise.vbroker.IIOP.ServerProtocolAdapter.doRequest(ServerProtocolAdapter.java:68)
at com.inprise.vbroker.GIOP.GiopProtocolAdapter.dispatchMessage(GiopProtocolAdapter.java:1106)
at com.inprise.vbroker.orb.TPDispatcherImpl$TPDispatcher.run(TPDispatcherImpl.java:106)
at com.inprise.vbroker.orb.ThreadPool$PoolWorker.run(ThreadPool.java:76)
ejbcontainer:
EJB Container Statistics
ejbcontainer: ========================
ejbcontainer: TimeWed May 05 18:13:21 MDT 2004
ejbcontainer: Memory (used)5572 Kb(max 5572 Kb)
ejbcontainer: Memory (total)65152 Kb(max 65152 Kb)
ejbcontainer: Memory (free)91.0%
ejbcontainer: ------------------------
ejbcontainer: Home (remote)ProfileSession
ejbcontainer: READY1
ejbcontainer: Total in memory1
ejbcontainer: Total in use1
ejbcontainer: ------------------------
ejbcontainer: Home (local)Member
ejbcontainer: Total in memory0
ejbcontainer: Total in use0
ejbcontainer: ========================