3 Replies Latest reply on Mar 10, 2003 2:01 PM by Peter Doornbosch

    Ejb2.0 + relation + local interface = Not Bind

    sachinsisodia Newbie

      Hello Guys
      all of u did the fine job for me till now and hope u can help me to sort out this problem too.

      First i m creating
      1. User ejb with local interface
      2. UserInfo with local interface

      User has one to one mapping with UesrInfo ejb only unidirection.

      Now i call these 2 by a Session Bean which is in the same JVM

      Now it is compiled and deploy successfully and jboss console gives the message that User and UserInfo table is created successfully

      Now i wants to try to call this session bean through my client


      But when i tried jboss console gives the following message:

      14:39:08,846 ERROR [STDERR] javax.naming.NameNotFoundException: Userr not bound
      14:39:08,846 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(Naming
      Server.java:495)
      14:39:08,846 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(Naming
      Server.java:503)
      14:39:08,846 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingS
      erver.java:509)
      14:39:08,846 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServ
      er.java:282)
      14:39:08,846 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(Namin
      gContext.java:464)
      14:39:08,846 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(Namin
      gContext.java:443)
      14:39:08,846 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialCon
      text.java:350)
      14:39:08,846 ERROR [STDERR] at user.UserManagementEJB.addUser(UserManagement
      EJB.java:35)
      14:39:08,846 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
      )
      14:39:08,846 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$Conta
      inerInterceptor.invoke(StatelessSessionContainer.java:660)
      14:39:08,846 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedCo
      nnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      14:39:08,846 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanc
      eInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
      14:39:08,846 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.i
      nvokeNext(AbstractTxInterceptor.java:107)
      14:39:08,846 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWit
      hTransactions(TxInterceptorCMT.java:178)
      14:39:08,846 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke
      (TxInterceptorCMT.java:60)
      14:39:08,846 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.inv
      oke(SecurityInterceptor.java:130)
      14:39:08,846 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(L
      ogInterceptor.java:204)
      14:39:08,846 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.invok
      e(StatelessSessionContainer.java:313)
      14:39:08,862 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java
      :712)
      14:39:08,862 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MB
      eanServerImpl.java:517)
      14:39:08,862 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.
      invoke(JRMPInvoker.java:382)
      14:39:08,862 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method
      )
      14:39:08,862 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(Unic
      astServerRef.java:241)
      14:39:08,862 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.j
      ava:152)
      14:39:08,862 ERROR [STDERR] at java.security.AccessController.doPrivileged(N
      ative Method)
      14:39:08,862 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Trans
      port.java:148)
      14:39:08,862 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMess
      ages(TCPTransport.java:465)
      14:39:08,862 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$Connection
      Handler.run(TCPTransport.java:706)
      14:39:08,862 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484)


      Note: I changed the name of the User ejb to Userr coz User is a key word in the sql server

      Why it is giving error that userr is not bind. i already successfully deploy the jar file
      it is mean that only Userr is nt bind and the another local bean Userinfo is binded

      I m using jboss.
      i tried to sereach this problem what i didn't get any satisfactory ans yetCould any body tell me, why thses error comes, i tried all the option bt i encounter the same error


      thanx in advance

      with regards
      sachin

        • 1. Re: Ejb2.0 + relation + local interface = Not Bind
          Peter Doornbosch Apprentice

          The error message means that your EJB is not bound with the jndi name 'Userr'. Maybe it is still deployed with the jndi name 'User'?
          You can check the jndi names by surfing to the jmx-console (http://localhost:8080/jmx-console): select the MBean called JNDIView, hit the button 'list' and browse through the list to find your bean and see what it is called.
          JBoss looks for the jndi-name in the jboss.xml file in the ejb.jar and when it's not specified there, it takes the name of the EJB as specified in the ejb-jar.xml

          Hth
          peter

          • 2. Re: Ejb2.0 + relation + local interface = Not Bind
            sachinsisodia Newbie

            Hi peter,
            thanx to reply me,
            i sloved that probelm which i was facing for last one week.
            i checked the jndi view and the userr is being binded successfully there.

            Bt when i tried to lookup that bean with "Local/Userr",
            that problem was sloved (Could any body explain me, is there any need to lookup with local) bt i get another exception:


            11:08:02,682 ERROR [LogInterceptor] TransactionRolledbackLocalException, causedB
            y:
            java.lang.InstantiationException: user.UserrEJB
            at java.lang.Class.newInstance0(Native Method)
            at java.lang.Class.newInstance(Class.java:237)
            at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.createBeanClassInst
            ance(JAWSPersistenceManager.java:165)


            Does anybody know where the problem could be?
            Any tips would be really apreciated.
            Thanks in advance

            cheers

            sachin

            • 3. Re: Ejb2.0 + relation + local interface = Not Bind
              Peter Doornbosch Apprentice

              Probably, the constructor of your bean is throwing an exception. Put a try-catch block in it and check if this is the case...