1 2 Previous Next 16 Replies Latest reply on Apr 20, 2005 3:24 PM by bill.burke

    javax.naming.NameNotFoundException EJB3.0 Preview 4

    bill.burke

      are you sure you have the correct JBOSS_HOME env var set? Also, the jmx-console http://localhost:8080/jmx-console has a JNDI View MBean that allows you to see what is published in JNDI. You can use this to ensure that things are deployed.

      Also, make sure you are using JDK 5.0 and JBoss booted up properly.

        • 1. Re:  javax.naming.NameNotFoundException EJB3.0 Preview 4
          hareshpatel

          Hi Bill,
          I have re-checked JBOSS_HOME and I am using JDK5.0. JBOSS has started properly.

          http://localhost:8080/jmx-console has a JNDI View MBean does not show ShoppingCart bean.

          I appriciate your help.

          • 2. Re:  javax.naming.NameNotFoundException EJB3.0 Preview 4
            mrhightech

            Strange... I have found that if I use

            ant run
            instead of building the code with
            ant
            by itself, I get the same error as you do.

            I have not investigated the build.xml file however, but I was under the impression the build/deploy tasks were run when the run task was called.

            Try it, I think it will fix your problem

            Cheers

            • 3. Re:  javax.naming.NameNotFoundException EJB3.0 Preview 4
              bill.burke

              Yeah sorry....

              The problem could be that the EJB jar file doesn't deploy quickly enough before the client runs.

              $ ant
              $ ant run

              • 4. Re:  javax.naming.NameNotFoundException EJB3.0 Preview 4
                swizard

                EJB3.0 Preview 5 has same error
                what shell i do..
                i just fellow instruction
                it didn't work

                • 5. Re:  javax.naming.NameNotFoundException EJB3.0 Preview 4
                  bill.burke

                  I don't know what to tell you...I cannot reproduce this problem and neither can anybody else.

                  • 6. Re:  javax.naming.NameNotFoundException EJB3.0 Preview 4
                    swizard

                    we(two person) try 4.0.1sp1, 4.0.2rc1 in each two machine
                    with ejb3_preview_5
                    two windows machine , two linux machine
                    all machine response same

                    i remember jboss AS can hot-deploy tutorial.ejb3 several month ago..

                    but even i delete, redeploy(i mean copy) tutorial.ejb3 in manual, JBossAS doesn't try to reploy..

                    hotdeploy doesn't matter, i does not work restart JbossAs

                    i think it's not our fault

                    plz check http://docs.jboss.org/ejb3/tutorial/installing.html
                    whether tutorial instruction work




                    • 7. Re:  javax.naming.NameNotFoundException EJB3.0 Preview 4
                      bill.burke

                      You should not be using 4.0.2RC1. EJB3 will not work with this. (Please read installing.html that you provided as a link).

                      So this is all a redeployment problem?

                      Can somebody show EXACT steps to reproduce the problem with tutorial examples? Thanks.

                      • 8. Re:  javax.naming.NameNotFoundException EJB3.0 Preview 4
                        swizard

                        * we try 4.0.2RC1. because 4.0.1sp1 doesn't work

                        * it is not reployment problem
                        i just mention that the tutorial works several month ago( i think it was preview2 and jboss401 rc1)

                        • 9. Re:  javax.naming.NameNotFoundException EJB3.0 Preview 4
                          bill.burke

                          Again, you have to expand on how "4.0.1SP1" doesn't work. You should not be using 4.0.2RC1.

                          • 10. Re:  javax.naming.NameNotFoundException EJB3.0 Preview 4
                            swizard

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

                            tutorial instruction

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


                            1. Download JBoss 4.0.1SP1.
                            2. Download EJB 3.0 Preview 5.
                            3. Unzip both of these downloads
                            4. Copy ejb3.deployer from the lib/ directory of the distribution to jboss-4.0.x/server/all/deploy
                            5. Copy ejb3-clustered-sfsbcache-service.xml from the lib/ directory of the distribution to jboss-4.0.x/server/all/deploy
                            6. Copy ejb3-entity-cache-service.xml from the lib/ directory of the distribution to jboss-4.0.x/server/all/deploy
                            7. Copy ejb3-interceptors-aop.xml from the lib/ directory of the distribution to jboss-4.0.x/server/all/deploy
                            8. Copy jboss-aop-jdk50.deployer from the lib/ directory of the distribution to jboss-4.0.x/server/all/deploy
                            9. Copy jboss-remoting.jar from the lib/ directory of the distribution to jboss-4.0.x/server/all/lib
                            10. Copy jboss-common.jar from the lib/ directory of the distribution to jboss-4.0.x/lib
                            11. Remove remoting-service.xml from jboss-4.0.1x/server/all/deploy
                            12. Remove jboss-aop.deployer/ from jboss-4.0.x/server/all/deploy
                            13. Start jboss up with the all configuration run.sh -c all



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

                            deploy dir status for number 4~ 8 ,11,12

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

                            E:\jboss\jboss-4.0.1sp1\server\all\deploy dir
                            bsh-deployer.xml cache-invalidation-service.xml
                            client-deployer-service.xml cluster-service.xml
                            deploy-hasingleton-service.xml [deploy.last]
                            ear-deployer.xml [ebxmlrr-service.sar]
                            ejb-deployer.xml ejb3-clustered-sfsbcache-service.xml
                            ejb3-entity-cache-service.xml ejb3-interceptors-aop.xml
                            [ejb3.deployer] hsqldb-ds.xml
                            [httpha-invoker.sar] iiop-service.xml
                            [jboss-aop-jdk50.deployer] [jboss-hibernate.deployer]
                            jboss-local-jdbc.rar [jboss-ws4ee.sar]
                            jboss-xa-jdbc.rar [jbossha-httpsession.sar]
                            jbossjca-service.xml [jbossweb-tomcat50.sar]
                            [jms] [jmx-console.war]
                            jmx-invoker-service.xml mail-ra.rar
                            mail-service.xml [management]
                            monitoring-service.xml properties-service.xml
                            schedule-manager-service.xml scheduler-service.xml
                            [snmp-adaptor.sar] sqlexception-service.xml
                            tc5-cluster-service.xml tutorial.ejb3
                            uuid-key-generator.sar



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

                            lib status for number 9~10

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

                            E:\jboss\jboss-4.0.1sp1\server\all\lib>dir jboss-*.jar

                            2005-02-16 03:22 348,469 jboss-cache.jar
                            2005-02-16 03:22 65,911 jboss-common-jdbc-wrapper.jar
                            2005-02-08 10:22 457,763 jboss-common.jar
                            2005-02-16 03:22 348,680 jboss-iiop.jar
                            2005-02-16 03:22 421,303 jboss-j2ee.jar
                            2005-02-16 03:22 27,926 jboss-jaxrpc.jar
                            2005-02-16 03:22 168,098 jboss-jca.jar
                            2005-02-16 03:22 14,215 jboss-jsr77.jar
                            2005-02-16 03:22 159,113 jboss-management.jar
                            2005-02-16 03:22 41,949 jboss-monitoring.jar
                            2005-02-08 10:23 144,688 jboss-remoting.jar
                            2005-02-16 03:22 17,615 jboss-saaj.jar
                            2005-02-16 03:22 43,573 jboss-transaction.jar



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

                            run jboss

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


                            E:\jboss\jboss-4.0.1sp1\bin>run.bat -C all
                            ===============================================================================
                            .
                            JBoss Bootstrap Environment
                            .
                            JBOSS_HOME: E:\jboss\jboss-4.0.1sp1\bin\\..
                            .
                            JAVA: C:\Program Files\Java\jdk1.5.0\bin\java
                            .
                            JAVA_OPTS: -Dprogram.name=run.bat -Xms128m -Xmx512m
                            .
                            CLASSPATH: C:\Program Files\Java\jdk1.5.0\lib\tools.jar;E:\jboss\jboss-4.0.1sp
                            1\bin\\run.jar
                            .
                            ===============================================================================
                            .
                            22:09:55,171 INFO [Server] Starting JBoss (MX MicroKernel)...
                            22:09:55,171 INFO [Server] Release ID: JBoss [Zion] 4.0.1sp1 (build: CVSTag=JBo
                            ss_4_0_1_SP1 date=200502160314)
                            22:09:55,171 INFO [Server] Home Dir: E:\jboss\jboss-4.0.1sp1
                            22:09:55,171 INFO [Server] Home URL: file:/E:/jboss/jboss-4.0.1sp1/
                            22:09:55,171 INFO [Server] Library URL: file:/E:/jboss/jboss-4.0.1sp1/lib/
                            22:09:55,171 INFO [Server] Patch URL: null
                            22:09:55,171 INFO [Server] Server Name: default
                            22:09:55,171 INFO [Server] Server Home Dir: E:\jboss\jboss-4.0.1sp1\server\defa
                            ult
                            22:09:55,187 INFO [Server] Server Home URL: file:/E:/jboss/jboss-4.0.1sp1/serve
                            r/default/
                            22:09:55,187 INFO [Server] Server Data Dir: E:\jboss\jboss-4.0.1sp1\server\defa
                            ult\data
                            22:09:55,187 INFO [Server] Server Temp Dir: E:\jboss\jboss-4.0.1sp1\server\defa
                            ult\tmp
                            22:09:55,187 INFO [Server] Server Config URL: file:/E:/jboss/jboss-4.0.1sp1/ser
                            ver/default/conf/
                            22:09:55,187 INFO [Server] Server Library URL: file:/E:/jboss/jboss-4.0.1sp1/se
                            rver/default/lib/
                            22:09:55,187 INFO [Server] Root Deployment Filename: jboss-service.xml
                            22:09:55,187 INFO [Server] Starting General Purpose Architecture (GPA)...
                            22:09:55,578 INFO [ServerInfo] Java version: 1.5.0-rc,Sun Microsystems Inc.
                            22:09:55,578 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.5.0-rc-b63
                            ,Sun Microsystems Inc.
                            22:09:55,578 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
                            22:09:55,984 INFO [Server] Core system initialized
                            22:09:57,609 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resour
                            ce:log4j.xml
                            22:09:57,734 INFO [WebService] Using RMI server codebase: http://onwire:8083/
                            22:09:58,000 INFO [NamingService] Started jndi bootstrap jnpPort=1099, rmiPort=
                            1098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server Socket
                            Factory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
                            22:10:02,359 INFO [Embedded] Catalina naming disabled
                            22:10:03,031 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0
                            -8080
                            22:10:03,062 INFO [Catalina] Initialization processed in 641 ms
                            22:10:03,062 INFO [StandardService] Starting service jboss.web
                            22:10:03,062 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.0.2
                            8
                            22:10:03,093 INFO [StandardHost] XML validation disabled
                            22:10:03,125 INFO [Catalina] Server startup in 63 ms
                            22:10:03,250 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=file:/E:/jb
                            oss/jboss-4.0.1sp1/server/default/deploy/http-invoker.sar/invoker.war/
                            22:10:04,062 INFO [TomcatDeployer] deploy, ctxPath=/ws4ee, warUrl=file:/E:/jbos
                            s/jboss-4.0.1sp1/server/default/tmp/deploy/tmp31541jboss-ws4ee-exp.war/
                            22:10:04,265 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=file:/E:/jboss/jbo
                            ss-4.0.1sp1/server/default/deploy/jbossweb-tomcat50.sar/ROOT.war/
                            22:10:04,500 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=file
                            :/E:/jboss/jboss-4.0.1sp1/server/default/deploy/jms/jbossmq-httpil.sar/jbossmq-h
                            ttpil.war/
                            22:10:06,750 INFO [MailService] Mail Service bound to java:/Mail
                            22:10:07,437 INFO [RARDeployment] Required license terms exist view the META-IN
                            F/ra.xml: file:/E:/jboss/jboss-4.0.1sp1/server/default/deploy/jboss-local-jdbc.r
                            ar
                            22:10:07,578 INFO [RARDeployment] Required license terms exist view the META-IN
                            F/ra.xml: file:/E:/jboss/jboss-4.0.1sp1/server/default/deploy/jboss-xa-jdbc.rar
                            22:10:07,750 INFO [RARDeployment] Required license terms exist view the META-IN
                            F/ra.xml: file:/E:/jboss/jboss-4.0.1sp1/server/default/deploy/jms/jms-ra.rar
                            22:10:07,875 INFO [RARDeployment] Required license terms exist view the META-IN
                            F/ra.xml: file:/E:/jboss/jboss-4.0.1sp1/server/default/deploy/mail-ra.rar
                            22:10:08,781 INFO [WrapperDataSourceService] Bound connection factory for resou
                            rce adapter for ConnectionManager 'jboss.jca:service=DataSourceBinding,name=Defa
                            ultDS to JNDI name 'java:DefaultDS'
                            22:10:08,812 WARN [ConfiguredIdentityLoginModule] Creating LoginModule with no
                            configured password!
                            22:10:09,109 INFO [A] Bound to JNDI name: queue/A
                            22:10:09,109 INFO [B] Bound to JNDI name: queue/B
                            22:10:09,125 INFO [C] Bound to JNDI name: queue/C
                            22:10:09,125 INFO [D] Bound to JNDI name: queue/D
                            22:10:09,125 INFO [ex] Bound to JNDI name: queue/ex
                            22:10:09,140 INFO [testTopic] Bound to JNDI name: topic/testTopic
                            22:10:09,156 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
                            22:10:09,156 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic

                            22:10:09,156 INFO [testQueue] Bound to JNDI name: queue/testQueue
                            22:10:09,218 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.
                            0.0:8093
                            22:10:09,250 INFO [DLQ] Bound to JNDI name: queue/DLQ
                            22:10:09,468 INFO [ConnectionFactoryBindingService] Bound connection factory fo
                            r resource adapter for ConnectionManager 'jboss.jca:service=ConnectionFactoryBin
                            ding,name=JmsXA to JNDI name 'java:JmsXA'
                            22:10:09,515 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=file:/E
                            :/jboss/jboss-4.0.1sp1/server/default/deploy/jmx-console.war/
                            22:10:09,765 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=file:/E
                            :/jboss/jboss-4.0.1sp1/server/default/deploy/management/web-console.war/
                            22:10:10,625 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-808
                            0
                            22:10:11,078 INFO [ChannelSocket] JK2: ajp13 listening on /0.0.0.0:8009
                            22:10:11,093 INFO [JkMain] Jk running ID=0 time=0/359 config=null
                            22:10:11,109 INFO [Server] JBoss (MX MicroKernel) [4.0.1sp1 (build: CVSTag=JBos
                            s_4_0_1_SP1 date=200502160314)] Started in 15s:391ms

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

                            run ant for stateless session bean

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


                            E:\jboss\jboss-EJB-3.0_Preview_5\docs\tutorial\stateless>ant run
                            Buildfile: build.xml

                            prepare:

                            compile:

                            ejbjar:

                            run:
                            [java] log4j:WARN No appenders could be found for logger (org.jnp.interface
                            s.NamingContext).
                            [java] log4j:WARN Please initialize the log4j system properly.
                            [java] Exception in thread "main" javax.naming.CommunicationException: Rece
                            ive timed out [Root exception is java.net.SocketTimeoutException: Receive timed
                            out]
                            [java] at org.jnp.interfaces.NamingContext.discoverServer(NamingContext
                            .java:1159)
                            [java] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:
                            1239)
                            [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:52
                            7)
                            [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:52
                            0)
                            [java] at javax.naming.InitialContext.lookup(InitialContext.java:351)
                            [java] at org.jboss.tutorial.stateless.client.Client.main(Client.java:1
                            9)
                            [java] Caused by: java.net.SocketTimeoutException: Receive timed out
                            [java] at java.net.PlainDatagramSocketImpl.receive0(Native Method)
                            [java] at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketI
                            mpl.java:136)
                            [java] at java.net.DatagramSocket.receive(DatagramSocket.java:712)
                            [java] at org.jnp.interfaces.NamingContext.discoverServer(NamingContext
                            .java:1129)
                            [java] ... 5 more


                            [java] Java Result: 1

                            BUILD SUCCESSFUL
                            Total time: 8 seconds

                            • 11. Re:  javax.naming.NameNotFoundException EJB3.0 Preview 4
                              bill.burke

                              By your stack trace, this is a JNDI problem and not an EJB 3 problem. You cannot even connect to JNDI. BTW, i'm quite positive that JNDI works in jboss 4.0.1sp1. Is this on the same machine? On two different machines? Did you set up jndi.properties correctly in the tutorial?

                              • 12. Re:  javax.naming.NameNotFoundException EJB3.0 Preview 4
                                swizard

                                same machine

                                • 13. Re:  javax.naming.NameNotFoundException EJB3.0 Preview 4
                                  swizard

                                  jndi.properties --> i didn't edit the file
                                  is it necessary

                                  • 14. Re:  javax.naming.NameNotFoundException EJB3.0 Preview 4
                                    bill.burke

                                    The default is to connect to JNDI thru localhost:1099. It looks like it cannot connect thru localhost. I don't know why. You'll have to ask your sys-admin

                                    So, try editing the jndi.properties file and place the IP address of your machine or hostname.

                                    1 2 Previous Next