1 2 Previous Next 18 Replies Latest reply on Jun 30, 2007 2:49 PM by jaikiran pai

    Exception javax.naming.NameNotFoundException

    ganesh pol Newbie

      I am new to EJB and trying on EJB sample application in
      EJB 2.0
      JBOSS Server 4.0.1


      ______________________________________________________________
      my code for getting remote object is

      public IUserSessionEJBObject getUserRemoteObject(String jndiName){
      System.out.println("looking for JNDI name "+jndiName);
      InitialContext context=null;
      Object obj=null;
      IUserSessionEJBObject userRemoteObject=null;
      IUserSessionEJBHome userSessionEJBHome=null;

      try{
      context= new InitialContext();
      obj=context.lookup(jndiName);
      userSessionEJBHome=(IUserSessionEJBHome)PortableRemoteObject.narrow(obj,IUserSessionEJBHome.class);
      System.out.println("USer EJB HOME Object"+userSessionEJBHome);
      }catch(NamingException namingEx){
      System.err.println("naming Exception occured");
      namingEx.printStackTrace();
      }
      try{
      userRemoteObject=userSessionEJBHome.create();
      }catch(CreateException creEx){
      System.err.println("create Exception occured");
      creEx.printStackTrace();
      }catch(RemoteException reEx){
      System.err.println("Remote Ex occured");
      reEx.printStackTrace();
      }
      System.out.println("USer EJB HOME Object"+userSessionEJBHome);

      return userRemoteObject;
      }

      ________________________________________________________
      ejb-jar.xml

      <?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>

      mfsc
      <display-name>mfsc</display-name>

      <enterprise-beans>

      <!-- Session Beans -->

      <display-name>UserSession</display-name>
      <ejb-name>UserSession</ejb-name>

      com.pspl.common.admin.user.components.IUserSessionEJBHome
      com.pspl.common.admin.user.components.IUserSessionEJBObject
      <ejb-class>com.pspl.common.admin.user.components.UserSessionBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>


      </enterprise-beans>

      <assembly-descriptor>

      </assembly-descriptor>

      </ejb-jar>
      _____________________________________________________________
      jboss.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">



      <enterprise-beans>


      <ejb-name>UserSession</ejb-name>
      <jndi-name>ejb/UserSession</jndi-name>


      </enterprise-beans>

      <resource-managers>
      </resource-managers>


      _______________________________________________________

      but i got following Exception

      19:29:13,120 INFO [STDOUT] looking for JNDI name ejb/UserSession
      19:29:13,135 INFO [STDOUT] naming Exception occured
      19:29:13,135 INFO [STDOUT] javax.naming.NameNotFoundException: UserSession not bound
      19:29:13,135 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
      19:29:13,135 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
      19:29:13,135 INFO [STDOUT] at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
      19:29:13,135 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
      19:29:13,135 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServer.java:252)
      19:29:13,135 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
      19:29:13,135 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
      19:29:13,135 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialContext.java:351)
      19:29:13,135 INFO [STDOUT] at com.pspl.common.delegate.CommonDelegate.getUserRemoteObject(CommonDelegate.java:46)


      I am not getting where i did mistake????

        • 1. Re: Exception javax.naming.NameNotFoundException
          jaikiran pai Master

           

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">



          <enterprise-beans>


          <ejb-name>UserSession</ejb-name>
          <jndi-name>ejb/UserSession</jndi-name>


          </enterprise-beans>

          <resource-managers>
          </resource-managers>


          Is this your actual jboss.xml that you have deployed? If so, then you will have to change it to


          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
          
          
          
           <enterprise-beans>
          
           <session>
           <ejb-name>UserSession</ejb-name>
           <jndi-name>ejb/UserSession</jndi-name>
           </session>
          
           </enterprise-beans>
          
           <resource-managers>
           </resource-managers>




          • 2. Re: Exception javax.naming.NameNotFoundException
            ganesh pol Newbie

            I checked it
            it is exactly same as following

            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">



            <enterprise-beans>


            <ejb-name>UserSession</ejb-name>
            <jndi-name>ejb/UserSession</jndi-name>


            </enterprise-beans>

            <resource-managers>
            </resource-managers>


            • 3. Re: Exception javax.naming.NameNotFoundException
              jaikiran pai Master

              As i mentioned in my earlier post, you will have to change that jboss.xml to include the

              <session>
              tags.

              • 4. Re: Exception javax.naming.NameNotFoundException
                ganesh pol Newbie

                I made same changes as you told in xml but still facing problem

                • 5. Re: Exception javax.naming.NameNotFoundException
                  jaikiran pai Master

                  Follow these steps and post the output:

                  - Go to http://localhost:8080/jmx-console
                  - Look for service=JNDIView on this page and click on it
                  - On the page that comes up, click on the Invoke button beside the list() method
                  - The page that comes up will show the JNDI tree (actual jndi-names and the objects bound).

                  Post the output.

                  And by the way, you are still seeing the

                  19:29:13,135 INFO [STDOUT] javax.naming.NameNotFoundException: UserSession not bound


                  exception right?

                  • 6. Re: Exception javax.naming.NameNotFoundException
                    ganesh pol Newbie

                    i made changes to xml as you told before

                    <?xml version="1.0" encoding="UTF-8"?>
                    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
                    
                    <jboss>
                    
                     <enterprise-beans>
                    
                     <session>
                     <ejb-name>UserSession</ejb-name>
                     <jndi-name>ejb/UserSession</jndi-name>
                     </session>
                    
                     </enterprise-beans>
                    
                     <resource-managers>
                     </resource-managers>
                    
                    </jboss>
                    


                    • 7. Re: Exception javax.naming.NameNotFoundException
                      jaikiran pai Master

                      Looked at the jboss.xml file again and realized that you have missed one more tag in that. Your jboss.xml should look like the following:

                      <?xml version="1.0" encoding="UTF-8"?>
                      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
                      
                      <jboss>
                      
                      
                      
                       <enterprise-beans>
                      
                      
                       <session>
                       <ejb-name>UserSession</ejb-name>
                       <jndi-name>ejb/UserSession</jndi-name>
                      
                       </session>
                      
                       </enterprise-beans>
                      
                       <resource-managers>
                       </resource-managers>
                      
                      </jboss>
                      
                      


                      • 8. Re: Exception javax.naming.NameNotFoundException
                        jaikiran pai Master

                        Ok, you have now got the jboss.xml right. Can you post the output of the JNDI tree.

                        • 9. my jndi name is not present in it
                          ganesh pol Newbie

                          i follow the steps as you told me but my jndi name is not present on the page even ejb module is not shown

                          __________________________________________________________
                          following is part of view which is showing JNDI names


                          Ejb Module: example.jar

                          java:comp namespace of the test/MyTestSession bean:

                          +- env (class: org.jnp.interfaces.NamingContext)


                          java:comp namespace of the ejb/CalculatorSessionBean bean:

                          +- env (class: org.jnp.interfaces.NamingContext)


                          java: Namespace

                          +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
                          +- DefaultDS (class: javax.sql.DataSource)
                          +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
                          +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
                          +- comp (class: javax.naming.Context)
                          +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
                          +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
                          +- jaas (class: javax.naming.Context)
                          | +- JmsXARealm (class: org.jboss.security.plugins.SecurityDomainContext)
                          | +- jbossmq (class: org.jboss.security.plugins.SecurityDomainContext)
                          | +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
                          +- timedCacheFactory (class: javax.naming.Context)
                          Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy
                          +- TransactionPropagationContextExporter (class: org.jboss.tm.TransactionPropagationContextFactory)
                          +- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)
                          +- Mail (class: javax.mail.Session)
                          +- TransactionPropagationContextImporter (class: org.jboss.tm.TransactionPropagationContextImporter)
                          +- TransactionManager (class: org.jboss.tm.TxManager)


                          Global JNDI Namespace

                          +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
                          +- UIL2ConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
                          +- UserTransactionSessionFactory (proxy: $Proxy11 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory,interface org.jboss.proxy.IClientContainer)
                          +- HTTPConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
                          +- console (class: org.jnp.interfaces.NamingContext)
                          | +- PluginManager (proxy: $Proxy36 implements interface org.jboss.console.manager.PluginManagerMBean)
                          +- UIL2XAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
                          +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)
                          +- HTTPXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
                          +- topic (class: org.jnp.interfaces.NamingContext)
                          | +- testDurableTopic (class: org.jboss.mq.SpyTopic)
                          | +- testTopic (class: org.jboss.mq.SpyTopic)
                          | +- securedTopic (class: org.jboss.mq.SpyTopic)
                          +- queue (class: org.jnp.interfaces.NamingContext)
                          | +- A (class: org.jboss.mq.SpyQueue)
                          | +- testQueue (class: org.jboss.mq.SpyQueue)
                          | +- ex (class: org.jboss.mq.SpyQueue)
                          | +- DLQ (class: org.jboss.mq.SpyQueue)
                          | +- D (class: org.jboss.mq.SpyQueue)
                          | +- C (class: org.jboss.mq.SpyQueue)
                          | +- B (class: org.jboss.mq.SpyQueue)
                          +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
                          +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
                          +- ejb (class: org.jnp.interfaces.NamingContext)
                          | +- CalculatorSessionBean (proxy: $Proxy53 implements interface org.jboss.proxy.IClientContainer,interface calculator.session.calculatorHome,interface javax.ejb.Handle)
                          | +- test (class: org.jnp.interfaces.NamingContext)
                          | | +- MyTestSessionBean (proxy: $Proxy51 implements interface org.jboss.proxy.IClientContainer,interface test.session.MyTestSessionHome,interface javax.ejb.Handle)
                          +- jmx (class: org.jnp.interfaces.NamingContext)
                          | +- invoker (class: org.jnp.interfaces.NamingContext)
                          | | +- RMIAdaptor (proxy: $Proxy35 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt,interface org.jboss.proxy.IClientContainer)
                          | +- rmi (class: org.jnp.interfaces.NamingContext)
                          | | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
                          +- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
                          +- UILXAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
                          +- UILConnectionFactory[link -> ConnectionFactory] (class: javax.nami




                          ___________________________________________________________
                          this time i will post you the actual whole code


                          my Servlet class
                          /**
                          *
                          */
                          package com.pspl.common.admin.user.web;

                          import java.io.IOException;

                          import javax.servlet.RequestDispatcher;
                          import javax.servlet.ServletException;
                          import javax.servlet.http.HttpServlet;
                          import javax.servlet.http.HttpServletRequest;
                          import javax.servlet.http.HttpServletResponse;

                          import com.pspl.common.delegate.CommonDelegate;
                          import com.pspl.common.delegate.ICommonDelegate;
                          import com.pspl.common.models.UserModel;

                          /**
                          * @author ganesh_pol
                          *
                          */
                          public class LoginServlet extends HttpServlet {

                          /* (non-Javadoc)
                          * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
                          */
                          @Override
                          protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
                          processRequest(req,resp);
                          }

                          /* (non-Javadoc)
                          * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
                          */
                          @Override
                          protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
                          processRequest(req,resp);
                          }

                          private void processRequest(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
                          String mode=req.getParameter("mode");
                          System.out.println("mode is"+mode);
                          if(mode==null || "".equals(mode)){
                          dispatchRequest(req,resp,"/login.jsp");
                          }else if("process".equalsIgnoreCase(mode)){
                          if(isValidUser(req)){
                          System.out.println("valid user");
                          dispatchRequest(req,resp,"/home.jsp");
                          }else{
                          dispatchRequest(req,resp,"/login.jsp");
                          }
                          }
                          }

                          private void dispatchRequest(HttpServletRequest req, HttpServletResponse resp,String view) throws ServletException, IOException {
                          RequestDispatcher rd=req.getRequestDispatcher(view);
                          rd.forward(req, resp);
                          }

                          private boolean isValidUser(HttpServletRequest request){
                          boolean isValid=false;
                          String userName=request.getParameter("userName");
                          String password=request.getParameter("password");
                          UserModel user=CommonDelegate.getInstance().authenticateUser(userName, password);
                          if(user!=null){
                          isValid=true;
                          }

                          return isValid;
                          }

                          }

                          __________________________________________________________
                          my delegator code

                          package com.pspl.common.delegate;

                          import java.rmi.RemoteException;

                          import javax.ejb.CreateException;
                          import javax.naming.InitialContext;
                          import javax.naming.NamingException;
                          import javax.rmi.PortableRemoteObject;

                          import com.pspl.common.admin.user.components.IUserSessionEJBHome;
                          import com.pspl.common.admin.user.components.IUserSessionEJBObject;
                          import com.pspl.common.admin.user.components.UserSessionBean;
                          import com.pspl.common.models.UserModel;

                          public class CommonDelegate implements ICommonDelegate {
                          public static final CommonDelegate COMMON_DELEGATE=new CommonDelegate();

                          public static final CommonDelegate getInstance(){
                          return COMMON_DELEGATE;
                          }


                          public IUserSessionEJBObject getUserRemoteObject(String jndiName){
                          System.out.println("looking for JNDI name"+jndiName);
                          InitialContext context=null;
                          Object obj=null;
                          IUserSessionEJBObject userRemoteObject=null;
                          IUserSessionEJBHome userSessionEJBHome=null;

                          try{
                          context= new InitialContext();
                          obj=context.lookup(jndiName);
                          userSessionEJBHome=(IUserSessionEJBHome)PortableRemoteObject.narrow(obj,IUserSessionEJBHome.class);
                          System.out.println("USer EJB HOME Object"+userSessionEJBHome);
                          }catch(NamingException namingEx){
                          System.err.println("naming Exception occured");
                          namingEx.printStackTrace();
                          }
                          try{
                          userRemoteObject=userSessionEJBHome.create();
                          }catch(CreateException creEx){
                          System.err.println("create Exception occured");
                          creEx.printStackTrace();
                          }catch(RemoteException reEx){
                          System.err.println("Remote Ex occured");
                          reEx.printStackTrace();
                          }
                          System.out.println("USer EJB HOME Object"+userSessionEJBHome);

                          return userRemoteObject;
                          }


                          public UserModel authenticateUser(String userName, String password) {
                          IUserSessionEJBObject userService=getUserRemoteObject("ejb/UserSession");
                          UserModel user=null;
                          try{
                          user=userService.authenticateUser(userName, password);
                          }catch(RemoteException reEx){
                          System.err.println("Remote Exception occured");
                          reEx.printStackTrace();
                          }

                          return user;
                          }

                          }
                          ___________________________________________________



                          • 10. Re: Exception javax.naming.NameNotFoundException
                            ganesh pol Newbie

                            I am still waiting for your help

                            • 11. Re: Exception javax.naming.NameNotFoundException
                              jaikiran pai Master

                              How did you deploy your bean? Also, can you post the logs when the server was starting up? That will show whether your bean was deployed or not. And if it was deployed, what jndi name it was bound to. In all probability, your bean is not getting deployed

                              • 12. Re: Exception javax.naming.NameNotFoundException
                                ganesh pol Newbie

                                I am using example on roseindia.net to sart the learning

                                ___________________________________________________
                                i put my ear file in

                                C:\devTools\jboss-4.0.1\jboss-4.0.1\server\default\deploy
                                with name mfsc.ear
                                ___________________________________________________

                                following is o/p of console

                                ==============================================================================

                                JBoss Bootstrap Environment

                                JBOSS_HOME: C:\devTools\jboss-4.0.1\jboss-4.0.1\bin\\..

                                JAVA: C:\devTools\jdk-1_5_0_11\bin\java

                                JAVA_OPTS: -Dprogram.name=run.bat -Xms128m -Xmx512m

                                CLASSPATH: C:\devTools\jdk-1_5_0_11\lib\tools.jar;C:\devTools\jboss-4.0.1\jboss-4.0.1\bin\\run.jar

                                ==============================================================================

                                1:09:05,978 INFO [Server] Starting JBoss (MX MicroKernel)...
                                1:09:05,978 INFO [Server] Release ID: JBoss [Zion] 4.0.1 (build: CVSTag=JBoss_4_0_1 date=200412230944)
                                1:09:05,978 INFO [Server] Home Dir: C:\devTools\jboss-4.0.1\jboss-4.0.1
                                1:09:05,978 INFO [Server] Home URL: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/
                                1:09:05,978 INFO [Server] Library URL: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/lib/
                                1:09:05,978 INFO [Server] Patch URL: null
                                1:09:05,978 INFO [Server] Server Name: default
                                1:09:05,978 INFO [Server] Server Home Dir: C:\devTools\jboss-4.0.1\jboss-4.0.1\server\default
                                1:09:05,978 INFO [Server] Server Home URL: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/
                                1:09:05,994 INFO [Server] Server Data Dir: C:\devTools\jboss-4.0.1\jboss-4.0.1\server\default\data
                                1:09:05,994 INFO [Server] Server Temp Dir: C:\devTools\jboss-4.0.1\jboss-4.0.1\server\default\tmp
                                1:09:05,994 INFO [Server] Server Config URL: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/conf/
                                1:09:05,994 INFO [Server] Server Library URL: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/lib/
                                1:09:05,994 INFO [Server] Root Deployment Filename: jboss-service.xml
                                1:09:05,994 INFO [Server] Starting General Purpose Architecture (GPA)...
                                1:09:06,260 INFO [ServerInfo] Java version: 1.5.0_11,Sun Microsystems Inc.
                                1:09:06,260 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.5.0_11-b03,Sun Microsystems Inc.
                                1:09:06,260 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
                                1:09:06,605 INFO [Server] Core system initialized
                                1:09:07,733 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
                                1:09:07,795 INFO [WebService] Using RMI server codebase: http://ps4701:8083/
                                1:09:08,046 INFO [NamingService] Started jndi bootstrap jnpPort=1099, rmiPort=1098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null
                                Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
                                1:09:13,950 INFO [Embedded] Catalina naming disabled
                                1:09:14,342 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
                                1:09:14,467 INFO [Catalina] Initialization processed in 454 ms
                                1:09:14,467 INFO [StandardService] Starting service jboss.web
                                1:09:14,483 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.0.28
                                1:09:14,499 INFO [StandardHost] XML validation disabled
                                1:09:14,514 INFO [Catalina] Server startup in 47 ms
                                1:09:14,624 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/deploy/http-invoker
                                sar/invoker.war/
                                1:09:15,203 INFO [TomcatDeployer] deploy, ctxPath=/ws4ee, warUrl=file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/tmp/deploy/tmp987jbos
                                -ws4ee-exp.war/
                                1:09:15,313 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/deploy/jbossweb-tomcat50.s
                                r/ROOT.war/
                                1:09:15,485 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/deploy/jms/j
                                ossmq-httpil.sar/jbossmq-httpil.war/
                                1:09:17,365 INFO [MailService] Mail Service bound to java:/Mail
                                1:09:17,756 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/defaul
                                /deploy/jboss-local-jdbc.rar
                                1:09:17,882 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/defaul
                                /deploy/jboss-xa-jdbc.rar
                                1:09:18,069 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/defaul
                                /deploy/jms/jms-ra.rar
                                1:09:18,179 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/defaul
                                /deploy/mail-ra.rar
                                1:09:18,931 INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=DataSourceBi
                                ding,name=DefaultDS to JNDI name 'java:DefaultDS'
                                1:09:18,947 WARN [ConfiguredIdentityLoginModule] Creating LoginModule with no configured password!
                                1:09:19,166 INFO [A] Bound to JNDI name: queue/A
                                1:09:19,166 INFO [B] Bound to JNDI name: queue/B
                                1:09:19,166 INFO [C] Bound to JNDI name: queue/C
                                1:09:19,166 INFO [D] Bound to JNDI name: queue/D
                                1:09:19,166 INFO [ex] Bound to JNDI name: queue/ex
                                1:09:19,181 INFO [testTopic] Bound to JNDI name: topic/testTopic
                                1:09:19,181 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
                                1:09:19,181 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
                                1:09:19,181 INFO [testQueue] Bound to JNDI name: queue/testQueue
                                1:09:19,228 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
                                1:09:19,260 INFO [DLQ] Bound to JNDI name: queue/DLQ
                                1:09:19,401 INFO [ConnectionFactoryBindingService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=Conne
                                tionFactoryBinding,name=JmsXA to JNDI name 'java:JmsXA'
                                1:09:19,432 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/deploy/jmx-cons
                                le.war/
                                1:09:19,604 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/deploy/manageme
                                t/web-console.war/
                                1:09:20,106 INFO [EARDeployer] Init J2EE application: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/deploy/example.ear
                                1:09:20,513 INFO [EjbModule] Deploying test/MyTestSession
                                1:09:20,560 INFO [EjbModule] Deploying ejb/CalculatorSessionBean
                                1:09:20,622 INFO [EJBDeployer] Deployed: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/tmp/deploy/tmp1038example.ear-contents/exampl
                                .jar
                                1:09:20,920 INFO [TomcatDeployer] deploy, ctxPath=/example, warUrl=file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/tmp/deploy/tmp1038e
                                ample.ear-contents/example-exp.war/
                                1:09:21,014 INFO [EARDeployer] Started J2EE application: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/deploy/example.ear
                                1:09:21,045 INFO [EARDeployer] Init J2EE application: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/deploy/example2.ear
                                1:09:21,077 INFO [TomcatDeployer] deploy, ctxPath=/example2, warUrl=file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/tmp/deploy/tmp1039
                                xample2.ear-contents/example2-exp.war/
                                1:09:21,186 INFO [EARDeployer] Started J2EE application: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/deploy/example2.ear
                                1:09:21,202 INFO [EARDeployer] Init J2EE application: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/deploy/mfsc.ear
                                1:09:21,358 INFO [TomcatDeployer] deploy, ctxPath=/mfsc, warUrl=file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/tmp/deploy/tmp1040mfsc
                                ear-contents/mfsc-exp.war/
                                1:09:21,452 INFO [EARDeployer] Started J2EE application: file:/C:/devTools/jboss-4.0.1/jboss-4.0.1/server/default/deploy/mfsc.ear
                                1:09:21,593 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
                                1:09:21,656 INFO [ChannelSocket] JK2: ajp13 listening on /0.0.0.0:8009
                                1:09:21,656 INFO [JkMain] Jk running ID=0 time=0/16 config=null
                                1:09:21,672 INFO [Server] JBoss (MX MicroKernel) [4.0.1 (build: CVSTag=JBoss_4_0_1 date=200412230944)] Started in 15s:568ms
                                1:29:46,763 INFO [STDOUT] mode isnull
                                1:29:59,399 INFO [STDOUT] mode isprocess
                                1:29:59,399 INFO [STDOUT] looking for JNDI nameejb/UserSession
                                1:29:59,415 INFO [STDOUT] naming Exception occured
                                1:29:59,415 INFO [STDOUT] javax.naming.NameNotFoundException: UserSession not bound
                                1:29:59,415 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
                                1:29:59,415 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
                                1:29:59,415 INFO [STDOUT] at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
                                1:29:59,415 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
                                1:29:59,415 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServer.java:252)
                                1:29:59,415 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
                                1:29:59,415 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
                                1:29:59,415 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialContext.java:351)
                                1:29:59,415 INFO [STDOUT] at com.pspl.common.delegate.CommonDelegate.getUserRemoteObject(CommonDelegate.java:32)
                                1:29:59,415 INFO [STDOUT] at com.pspl.common.delegate.CommonDelegate.authenticateUser(CommonDelegate.java:54)
                                1:29:59,415 INFO [STDOUT] at com.pspl.common.admin.user.web.LoginServlet.isValidUser(LoginServlet.java:66)
                                1:29:59,415 INFO [STDOUT] at com.pspl.common.admin.user.web.LoginServlet.processRequest(LoginServlet.java:48)
                                1:29:59,415 INFO [STDOUT] at com.pspl.common.admin.user.web.LoginServlet.doPost(LoginServlet.java:39)
                                1:29:59,415 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                                1:29:59,415 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
                                1:29:59,415 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
                                1:29:59,415 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
                                1:29:59,415 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
                                1:29:59,415 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
                                1:29:59,415 INFO [STDOUT] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
                                1:29:59,415 INFO [STDOUT] at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
                                1:29:59,415 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
                                1:29:59,415 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
                                1:29:59,415 INFO [STDOUT] at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
                                1:29:59,415 INFO [STDOUT] at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
                                1:29:59,415 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
                                1:29:59,415 ERROR [Engine] StandardWrapperValve[LoginServlet]: Servlet.service() for servlet LoginServlet threw exception
                                ava.lang.NullPointerException
                                at com.pspl.common.delegate.CommonDelegate.getUserRemoteObject(CommonDelegate.java:40)
                                at com.pspl.common.delegate.CommonDelegate.authenticateUser(CommonDelegate.java:54)
                                at com.pspl.common.admin.user.web.LoginServlet.isValidUser(LoginServlet.java:66)
                                at com.pspl.common.admin.user.web.LoginServlet.processRequest(LoginServlet.java:48)
                                at com.pspl.common.admin.user.web.LoginServlet.doPost(LoginServlet.java:39)
                                at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                                at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
                                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
                                at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
                                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
                                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
                                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
                                at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
                                at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
                                at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
                                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
                                at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
                                at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
                                at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
                                at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
                                at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
                                at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
                                at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
                                at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
                                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
                                at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
                                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
                                at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
                                at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
                                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                                at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
                                at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
                                at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
                                at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
                                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
                                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
                                at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
                                at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
                                at java.lang.Thread.run(Thread.java:595)

                                • 13. Re: Exception javax.naming.NameNotFoundException
                                  jaikiran pai Master

                                  Ganesh,

                                  Looking at the logs i dont see the UserSession bean getting deployed. Can you post the ejb-jar.xml that you are deploying (i do see that you have already posted one, but is it the one you are using for deploying - it does not look correct). Also, post the output of the following command from the command prompt:

                                  - Go to C:\devTools\jboss-4.0.1\jboss-4.0.1\server\default\deploy from the command prompt
                                  - Run the following command:

                                  jar -tf mfsc.ear




                                  • 14. Re: Exception javax.naming.NameNotFoundException
                                    ganesh pol Newbie

                                    sorry for giving late reply
                                    following is printed when i run the jar command

                                    C:\devTools\jboss-4.0.1\jboss-4.0.1\server\default\deploy>jar -tf mfsc.ear
                                    META-INF/
                                    META-INF/MANIFEST.MF
                                    META-INF/application.xml
                                    mfsc.jar
                                    mfsc.war

                                    C:\devTools\jboss-4.0.1\jboss-4.0.1\server\default\deploy>

                                    _____________________________________________________________

                                    contents of my ejb-jar.xml is same as which i posted earlier

                                    1 2 Previous Next