ejb lookup problem


EJB programming & troubleshooting: ejb lookup problem

  1. ejb lookup problem (6 messages)

    i am using jboss and tomcat. I am trying to run the sun's ejb example application RMS. I was able to deploy but when i run it i get

    javax.naming.namenotfoundexception beans.rmsbean not bound

    does anyone have any idea regarding this.

    InitialContext ctx = new InitialContext();
    Object home = ctx.lookup("beans.RMSBean");
    RMSHome rmsHome = (RMSHome) PortableRemoteObject.narrow(home, RMSHome.class);
    rms = rmsHome.create();

    in my jboss.xml i have


    and in my ejb-jar.xml i have

     <description>no description</description>

    I am new to ejb and have no idea how to fix this. any help will be greatly appreciated. thanks

    Threaded Messages (6)

  2. ejb lookup problem[ Go to top ]


    i am not familiar with jboss/tomcat but one thing is to make sure you are obtaining your initial context properly, especially if your ejbs are on a different server than the client. typically you have to provide some information so the initial context is properly obtained, such as the provider url and the context factory.

    Tinou Bao
  3. ejb lookup problem[ Go to top ]

    my ejb and client are on the same server. i have my provider.url set to localhost in JBoss's jndi.properties file. also the contextfactory is given in that file. I am hoping that jboss looks for these settings in the jndi.properties file when making a call to context.
  4. ejb lookup problem[ Go to top ]


     Try to lookup your bean through JNDIView by going to the following URL.

    http://localhost:8082 (substitute localhost by any m/c)

    Then click on 'service=JNDIView'

    In the page that you get, click on the "list" button.

    java.lang.String [list](boolean)param0 True False

    This will list out everything you can access through JNDI.

    Now verify if your object exists in the Global JNDI Namespace. Access your Bean with the "parent/Child" string for your lookup.

    Hope this helps.

  5. ejb lookup problem[ Go to top ]

    no it does not show up in jndiview under global jndi.

    before that it has application and gives my application name. but under that it gives java:comp namespace of Interest bean. I don't know why it is using jboss's example of Interest as namespace.

    can anyone help to solve this. I undeployed jBoss's Interest example but still I see the same as follows in jndiview:

    Application: file:/C:/jboss/JBoss-2.2.1_Tomcat-3.2.1/jboss/tmp/deploy/Default/RMSApp.ear
    java:comp namespace of the Interest bean:
      +- UserTransaction (class: javax.transaction.UserTransaction)
      +- env (class: org.jnp.interfaces.NamingContext)

  6. ejb lookup problem[ Go to top ]

    Did you get any error when you deployed your bean ?

    Try changing the JNDI name from "." to "/"
  7. ejb lookup problem[ Go to top ]

    now i am able to see my beans under jndiview

    but still i am getting the following error
    I replaced beans.RMSBean with beans/RMSBean but got the same error

    [EmbeddedTomcat] ctx : javax.naming.InitialContext@2fbbe3
    [EmbeddedTomcat] getRMSConn() fails
    javax.naming.NameNotFoundException: beans.RMSBean not bound
    [EmbeddedTomcat] javax.naming.NameNotFoundException: beans.RMSBean not bound
    [EmbeddedTomcat] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedF
    romServer(Unknown Source)
    [EmbeddedTomcat] at sun.rmi.transport.StreamRemoteCall.executeCall(Unknow
    n Source)
    [EmbeddedTomcat] at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    [EmbeddedTomcat] at org.jnp.server.NamingServer_Stub.lookup(Unknown Sourc
    [EmbeddedTomcat] at org.jnp.interfaces.NamingContext.lookup(NamingContext
    [EmbeddedTomcat] at org.jnp.interfaces.NamingContext.lookup(NamingContext
    [EmbeddedTomcat] at javax.naming.InitialContext.lookup(Unknown Source)
    [EmbeddedTomcat] at RMS.JSP.getRMSConn(jsp.java:53)
    [EmbeddedTomcat] at RMS.JSP.getAllCategories(jsp.java:156)
    [EmbeddedTomcat] at _0002fprojSearchInfo_0002ejspprojSearchInfo_jsp_1._js
    [EmbeddedTomcat] at org.apache.jasper.runtime.HttpJspBase.service(HttpJsp
    [EmbeddedTomcat] at javax.servlet.http.HttpServlet.service(HttpServlet.ja
    [EmbeddedTomcat] at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
    [EmbeddedTomcat] at org.apache.jasper.servlet.JspServlet.serviceJspFile(J
    [EmbeddedTomcat] at org.apache.jasper.servlet.JspServlet.service(JspServl
    [EmbeddedTomcat] at javax.servlet.http.HttpServlet.service(HttpServlet.ja
    [EmbeddedTomcat] at org.apache.tomcat.core.ServletWrapper.doService(Servl
    [EmbeddedTomcat] at org.apache.tomcat.core.Handler.service(Handler.java:2
    [EmbeddedTomcat] at org.apache.tomcat.core.ServletWrapper.service(Servlet
    [EmbeddedTomcat] at org.apache.tomcat.core.ContextManager.internalService
    [EmbeddedTomcat] at org.apache.tomcat.core.ContextManager.service(Context
    [EmbeddedTomcat] at org.apache.tomcat.service.http.HttpConnectionHandler.
    [EmbeddedTomcat] at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolT
    [EmbeddedTomcat] at org.apache.tomcat.util.ThreadPool$ControlRunnable.run
    [EmbeddedTomcat] at java.lang.Thread.run(Unknown Source)

    can somebody help