4 Replies Latest reply on Jan 16, 2006 11:25 AM by wade wang

    Runtime error -- javax.naming.NameNotFoundException: contain

    wade wang Newbie

      I am using jboss-4.0.3SP1 and all option. Deployment of my ear file
      is ok and I can see my stateless session bean from jmx-console. But when I run it I get the following error. Any helps would be greatly appreciated.
      Here is my application.xml:


      <display-name>Payment Posting</display-name>
      Payment Posting


      entities.par



      paymentpostingsessionbeans.ejb3




      <web-uri>paymentposting.war</web-uri>
      <context-root>paymentposting</context-root>





      java.lang.RuntimeException: javax.naming.NameNotFoundException: containers not bound
      13:20:49,776 INFO [STDOUT] at org.jboss.ejb3.LocalProxy.readObject(LocalProxy.java:54)
      13:20:49,776 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      13:20:49,776 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      13:20:49,776 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      13:20:49,776 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
      13:20:49,776 INFO [STDOUT] at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
      13:20:49,836 INFO [STDOUT] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
      13:20:49,836 INFO [STDOUT] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
      13:20:49,836 INFO [STDOUT] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      13:20:49,836 INFO [STDOUT] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
      13:20:49,836 INFO [STDOUT] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
      13:20:49,836 INFO [STDOUT] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
      13:20:49,836 INFO [STDOUT] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      13:20:49,836 INFO [STDOUT] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      13:20:49,836 INFO [STDOUT] at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
      13:20:49,836 INFO [STDOUT] at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:57)
      13:20:49,836 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:637)
      13:20:49,836 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      13:20:49,836 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialContext.java:351)
      13:20:49,836 INFO [STDOUT] at com.ameripath.aarms.paymentposting.business.ServiceLocator.getSessionFacade(

        • 1. Re: Runtime error -- javax.naming.NameNotFoundException: con
          Cyril JOUI Newbie

          Hello !

          Can you post more explicit information ? (in Code section please).
          How do you call you EJB ?
          Which EJB ... ?

          Thanks.

          • 2. Re: Runtime error -- javax.naming.NameNotFoundException: con
            wade wang Newbie

             

            The interface
            package com.ameripath.aarms.paymentposting.business;
            
            import java.util.Vector;
            
            public interface SessionFacade {
             Vector retrieveLineItems(String encounterNo);
            }
            
            The Bean
            package com.ameripath.aarms.paymentposting.business;
            
            import java.util.Vector;
            import javax.ejb.*;
            
            import com.ameripath.aarms.paymentposting.data.LineItem;
            
            @Stateless
            @Local ({SessionFacade.class})
            public class SessionFacadeBean implements SessionFacade {
            
             public Vector retrieveLineItems(String encounterNo) {
             Vector lineItems = new Vector();
            
             lineItems.add(new LineItem(encounterNo, "1", "88305", "330"));
             lineItems.add(new LineItem(encounterNo, "2", "99879", "400"));
             lineItems.add(new LineItem(encounterNo, "3", "12345", "120"));
            
             return lineItems;
             }
            }
            
            The invoker
            public SessionFacade getSessionFacade() {
             SessionFacade sessionFacade = null;
             try {
             InitialContext ctx = new InitialContext();
             sessionFacade =
             (SessionFacade) ctx.lookup(SessionFacade.class.getName());
             } catch (Exception e) {
             e.printStackTrace ();
             }
             return sessionFacade;
             }
            


            • 3. Re: Runtime error -- javax.naming.NameNotFoundException: con
              Cyril JOUI Newbie

              Can you put the application.xml and all written log when you deploy your ear file please ?

              Is your Invoker in a web application ?

              you can try to do :

              InitialContext ctx = new InitialContext();
              NamingEnumeration e = ctx.list("");
              while(e.hasMoreElement()) {
               NameClassPair p = (NameClassPair)e.nextElement();
               System.out.println(p.getName());
              }
              


              You will see all JNDI entries for the root object of JNDI service.
              (and see if your EJB name is in annuary)


              • 4. Re: Runtime error -- javax.naming.NameNotFoundException: con
                wade wang Newbie

                The application is in the original post. Anyway, here u go again:

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

                <display-name>PaymentPosting</display-name>
                Payment Posting


                entities.par



                business.ejb3




                <web-uri>paymentposting.war</web-uri>
                <context-root>paymentposting</context-root>




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

                ==============================================
                And the here is log for deployment:

                10:17:32,325 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.3SP1/server/all/deploy/paymentposting.ear
                10:17:44,391 INFO [JaccHelper] Initialising JACC Context for deployment: business.ejb3
                10:17:44,781 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=com.ameripath.aarms.paymentposting.ejb.stateless.SessionFacadeBean, class=com.ameripath.aarms.paymentposting.ejb.stateless.SessionFacadeBean, type=STATELESS
                10:17:48,446 INFO [JaccHelper] com.ameripath.aarms.paymentposting.ejb.stateless.SessionFacadeBean has no @SecurityDomain - skipping JACC configuration
                10:17:48,456 INFO [JaccHelper] JACC Policy Configuration for deployment has been put in service
                10:17:48,456 INFO [Ejb3Deployment] EJB3 deployment time took: 4085
                10:17:48,466 INFO [JaccHelper] Initialising JACC Context for deployment: entities.par
                10:17:48,577 INFO [Ejb3Deployment] default entity manager name: entities
                10:17:50,890 INFO [Environment] Hibernate 3.1
                10:17:50,930 INFO [Environment] hibernate.properties not found
                10:17:50,940 INFO [Environment] using CGLIB reflection optimizer
                10:17:51,060 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
                10:17:53,924 INFO [Configuration] processing extends queue
                10:17:53,924 INFO [Configuration] processing collection mappings
                10:17:53,934 INFO [Configuration] processing association property references
                10:17:53,934 INFO [Configuration] processing foreign key constraints
                10:17:54,124 INFO [Configuration] processing extends queue
                10:17:54,124 INFO [Configuration] processing collection mappings
                10:17:54,124 INFO [Configuration] processing association property references
                10:17:54,124 INFO [Configuration] processing foreign key constraints
                10:17:54,164 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.InjectedDataSourceConnectionProvider
                10:17:54,765 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
                10:17:54,765 INFO [SettingsFactory] RDBMS: HSQL Database Engine, version: 1.8.0
                10:17:54,765 INFO [SettingsFactory] JDBC driver: HSQL Database Engine Driver, version: 1.8.0
                10:17:55,005 INFO [Dialect] Using dialect: org.hibernate.dialect.HSQLDialect
                10:17:55,586 INFO [TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)
                10:17:55,596 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
                10:17:55,606 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
                10:17:55,606 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
                10:17:55,606 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
                10:17:55,606 INFO [SettingsFactory] JDBC batch size: 15
                10:17:55,606 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
                10:17:55,636 INFO [SettingsFactory] Scrollable result sets: enabled
                10:17:55,636 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
                10:17:55,636 INFO [SettingsFactory] Connection release mode: after_statement
                10:17:55,636 INFO [SettingsFactory] Default batch fetch size: 1
                10:17:55,636 INFO [SettingsFactory] Generate SQL with comments: disabled
                10:17:55,636 INFO [SettingsFactory] Order SQL updates by primary key: disabled
                10:17:55,636 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
                10:17:55,666 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
                10:17:55,666 INFO [SettingsFactory] Query language substitutions: {}
                10:17:55,666 INFO [SettingsFactory] Second-level cache: enabled
                10:17:55,666 INFO [SettingsFactory] Query cache: disabled
                10:17:55,666 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
                10:17:55,676 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
                10:17:55,676 INFO [SettingsFactory] Structured second-level cache entries: disabled
                10:17:55,716 INFO [SettingsFactory] Statistics: disabled
                10:17:55,716 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: enabled
                10:17:55,716 INFO [SettingsFactory] Default entity-mode: POJO
                10:17:56,297 INFO [SessionFactoryImpl] building session factory
                10:17:56,317 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
                10:17:56,327 INFO [Configuration] processing extends queue
                10:17:56,327 INFO [Configuration] processing collection mappings
                10:17:56,327 INFO [Configuration] processing association property references
                10:17:56,327 INFO [Configuration] processing foreign key constraints
                10:17:56,337 INFO [Configuration] processing extends queue
                10:17:56,337 INFO [Configuration] processing collection mappings
                10:17:56,337 INFO [Configuration] processing association property references
                10:17:56,337 INFO [Configuration] processing foreign key constraints
                10:17:56,337 INFO [SchemaExport] Running hbm2ddl schema export
                10:17:56,347 INFO [SchemaExport] exporting generated schema to database
                10:17:56,347 INFO [SchemaExport] schema export complete
                10:17:56,357 INFO [Configuration] processing extends queue
                10:17:56,357 INFO [Configuration] processing collection mappings
                10:17:56,357 INFO [Configuration] processing association property references
                10:17:56,357 INFO [Configuration] processing foreign key constraints
                10:17:56,357 INFO [Configuration] processing extends queue
                10:17:56,357 INFO [Configuration] processing collection mappings
                10:17:56,357 INFO [Configuration] processing association property references
                10:17:56,357 INFO [Configuration] processing foreign key constraints
                10:17:56,367 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                10:17:56,377 INFO [SessionFactoryImpl] Checking 0 named queries
                10:17:56,387 INFO [Ejb3Deployment] Create EntityManager with JNDI name: entities
                10:17:56,437 INFO [JaccHelper] JACC Policy Configuration for deployment has been put in service
                10:17:56,437 INFO [Ejb3Deployment] EJB3 deployment time took: 7971
                10:17:56,717 INFO [ProxyDeployer] no declared remote bindings for : com.ameripath.aarms.paymentposting.ejb.stateless.SessionFacadeBean
                10:17:56,818 INFO [EJB3Deployer] Deployed: file:/C:/jboss-4.0.3SP1/server/all/tmp/deploy/tmp5523paymentposting.ear-contents/business.ejb3
                10:17:56,828 INFO [EJB3Deployer] Deployed: file:/C:/jboss-4.0.3SP1/server/all/tmp/deploy/tmp5523paymentposting.ear-contents/entities.par
                10:17:56,828 INFO [TomcatDeployer] deploy, ctxPath=/paymentposting, warUrl=.../tmp/deploy/tmp5523paymentposting.ear-contents/paymentposting-exp.war/
                10:17:56,938 INFO [WebappClassLoader] validateJarFile(C:\jboss-4.0.3SP1\server\all\.\tmp\deploy\tmp5523paymentposting.ear-contents\paymentposting-exp.war\WEB-INF\lib\javax.servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
                10:17:57,959 INFO [STDOUT] [INFO-10:17:57:
                ==========================================

                ==========================================
                And ctx.list(""); returns an empty result.