exception while calling a EJB using local interfaces

Discussions

EJB design: exception while calling a EJB using local interfaces

  1. I'm unable to call a deployed stateful session bean using Local home interfaces.
    I'm getting the following exception:

    javax.naming.NameNotFoundException: Unable to resolve 'CountLocalHome' Resolved:
     '' Unresolved:'CountLocalHome' ; remaining name 'CountLocalHome'
            at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:17
    4)
            at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:263)
            at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:230)
            at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown Source)

            at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:337)
            at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:332)
            at javax.naming.InitialContext.lookup(InitialContext.java:345)
            at StatefulEjb.doGet(StatefulEjb.java:15)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1058)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:401)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:306)
            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:5445)
            at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
    eManager.java:780)
            at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3105)
            at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2588)
            at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)

    But when i call the EJB using Remote interfaces, it is running.
    Any one help me.
    Seshagiri
  2. Is both are collocated?
    If so,are you try to access the localinterface outside of EAR?
    i mean client in a war and then bean in a separate module?

    u.
  3. Have you specified both the remote and local JNDI name in the weblogic-ejb-jar.xml file? For example: <jndi-name>com.mycompany.CountHome
        <local-jndi-name>com.mycompany.CountLocalHome
  4. I entered the jndi in the xml file