1 2 Previous Next 19 Replies Latest reply on Aug 27, 2002 9:54 AM by Manan

    javax.naming.NameNotFoundException: ShipmentSLSBean not boun

    Manan Newbie

      Hi.

      So far, I am not able to deploy myEar.ear successfully. There seem to be some sort of binding problem.

      on the console of the server, error shown:

      javax.naming.NameNotFoundException: ShipmentSLSBean
      not bound

      Earlier, application worked successfully on weblogic. It seems to be some kind of error associated with JNDI naming service.

      Thanks.

      I am not able to deploy it successfully on JBoss-Tomcat version.
      Any pointers?

        • 1. Re: javax.naming.NameNotFoundException: ShipmentSLSBean not
          Adrian Brock Master

          Can you need to post the dds (ejb-jar.xml and jboss.xml)

          Regards,
          Adrian

          • 2. Re: javax.naming.NameNotFoundException: ShipmentSLSBean not
            Manan Newbie

            Here is the ejb-jar.xml:

            <?xml version="1.0" encoding="UTF-8"?>

            <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>

            <ejb-jar id="pramati_1.0">
            No Description
            <display-name>myEar</display-name>
            <small-icon />
            <large-icon />
            <enterprise-beans>




            No Description
            <display-name>ShipmentBean</display-name>
            <ejb-name>com.shipment.ejb.ShipmentBean</ejb-name>
            com.shipment.ejb.ShipmentHome
            com.shipment.ejb.Shipment
            <ejb-class>com.shipment.ejb.ShipmentBean</ejb-class>
            <persistence-type>Bean</persistence-type>
            <prim-key-class>java.lang.Long</prim-key-class>
            False
            <resource-ref>
            No Description
            <res-ref-name>jdbc/DB</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
            </resource-ref>


            No Description
            <ejb-name>com.shipment.ejb.ShipmentBean</ejb-name>
            <method-intf>Home</method-intf>
            <method-name>remove</method-name>
            <method-params>
            <method-param>java.lang.Object</method-param>
            </method-params>


            No Description
            <ejb-name>com.shipment.ejb.ShipmentBean</ejb-name>
            <method-intf>Home</method-intf>
            <method-name>remove</method-name>
            <method-params>
            <method-param>javax.ejb.Handle</method-param>
            </method-params>


            No Description
            <ejb-name>com.shipment.ejb.ShipmentBean</ejb-name>
            <method-intf>Home</method-intf>
            <method-name>findByPrimaryKey</method-name>
            <method-params>
            <method-param>java.lang.Long</method-param>
            </method-params>


            No Description
            <ejb-name>com.shipment.ejb.ShipmentBean</ejb-name>
            <method-intf>Remote</method-intf>
            <method-name>setShipmentModel</method-name>
            <method-params>
            <method-param>com.shipment.model.ShipmentModel</method-param>
            </method-params>


            No Description
            <ejb-name>com.shipment.ejb.ShipmentBean</ejb-name>
            <method-intf>Remote</method-intf>
            <method-name>getShipmentModel</method-name>
            <method-params />


            No Description
            <ejb-name>com.shipment.ejb.ShipmentBean</ejb-name>
            <method-intf>Remote</method-intf>
            <method-name>remove</method-name>
            <method-params />


            No Description
            <ejb-name>com.shipment.ejb.ShipmentBean</ejb-name>
            <method-intf>Home</method-intf>
            <method-name>create</method-name>
            <method-params>
            <method-param>com.shipment.model.ShipmentModel</method-param>
            </method-params>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>
            </assembly-descriptor>
            </ejb-jar>


            For the jboss.xml, we could not find JBoss.xml in our application (jboss-3.0.0_tomcat-4.0.3 directory). Can you send us a sample jobss.xml file and guide us regarding where to put the JBoss.xml file in jboss-3.0.0_tomcat-4.0.3 directory. IN general, what are parameters being defined in JBoss.xml as part of application.

            Thanks.

            • 3. Re: javax.naming.NameNotFoundException: ShipmentSLSBean not
              Adrian Brock Master

              The jboss.xml lets you override the default
              behaviour of jboss.
              e.g. By default jboss uses <ejb-name> as the
              <jndi-name> so your bean is bound at com.shipment.ejb.ShipmentBean

              The links in the "Documentation" will explain
              jboss.xml and changing the jndi-name.

              Regards,
              Adrian

              • 4. Re: javax.naming.NameNotFoundException: ShipmentSLSBean not
                Manan Newbie

                Thanxs for the valuable pointers.

                I have added jboss.xml along with ejb-jar.xml in META-INF directory and recreated MyEar.ear. I am still getting the same error: javax.naming.NameNotFoundException: ShipmentBean not bound.



                <enterprise-beans>

                <ejb-name>com.shipment.ejb.ShipmentBean</ejb-name>
                <jndi-name>ShipmentBean</jndi-name>

                </enterprise-beans>


                on port 8082, I do see service=EJB,jndiName=ShipmentBean under jboss.j2ee

                I am still not clear where am I wrong? Can you give me some more pointers.

                Thanxs,

                • 5. Re: javax.naming.NameNotFoundException: ShipmentSLSBean not
                  Manan Newbie

                  Now, thanxs for the guidance.

                  error: Now javax.naming.NameNotFoundException: ShipmentBean not bound" is resolved.

                  Now I am getting a new kind of error:
                  "javax.naming.NameNotFoundException: jdbc not bound"

                  I have specified oracle database name in "oracle-service.xml" existing in default/deploy folder.

                  OracleDS



                  <!--
                  <config-property name="ConnectionURL" type="java.lang.String">jdbc:oracle:thin:@youroraclehost:1521:yoursid</config-property>
                  <config-property name="DriverClass" type="java.lang.String">oracle.jdbc.driver.OracleDriver</config-property>
                  <config-property name="UserName" type="java.lang.String"></config-property>
                  <config-property name="Password" type="java.lang.String"></config-property>
                  -->
                  <config-property name="ConnectionURL" type="java.lang.String">jdbc:oracle:thin:@192.168.1.107:1521:slb</config-property>
                  <config-property name="DriverClass" type="java.lang.String">oracle.jdbc.driver.OracleDriver</config-property>

                  <!--set these only if you want only default logins, not through JAAS -->
                  <config-property name="UserName" type="java.lang.String">system</config-property>
                  <config-property name="Password" type="java.lang.String">manager</config-property>



                  In my ejb-jar.xml, resource manager has been defined as:
                  <resource-ref>
                  No Description
                  <res-ref-name>jdbc/DB</res-ref-name>
                  <res-type>javax.sql.DataSource</res-type>
                  <res-auth>Container</res-auth>
                  </resource-ref>

                  Database connection is not happening successfully.
                  Error which appear is :
                  javax.naming.NameNotFoundException: jdb
                  c not bound

                  Any pointers?

                  Thanxs

                  • 6. Re: javax.naming.NameNotFoundException: ShipmentSLSBean not
                    Adrian Brock Master

                    Again,

                    You need jboss.xml to map this to the real jndi-name

                    Regards,
                    Adrian

                    • 7. Re: javax.naming.NameNotFoundException: ShipmentSLSBean not
                      Manan Newbie

                      Thanxs again. I no longer see binding error and am able to see see jdbc/JNDI name.

                      Now I am facing this problem:
                      Error displayed is -"No resource manager found for jdbc/DB"

                      in JBoss.xml,
                      code related to database look up is there:

                      <resource-managers>
                      <resource-manager>
                      <res-name>DB</res-name>
                      <res-jndi-name>java:/DB</res-jndi-name>
                      </resource-manager>
                      </resource-managers>

                      in ejb-jar.xml,
                      code related to database look up is there
                      <resource-ref>
                      No Description
                      <res-ref-name>jdbc/DB</res-ref-name>
                      <res-type>javax.sql.DataSource</res-type>
                      <res-auth>Container</res-auth>
                      </resource-ref>

                      Error displayed is -"No resource manager found for jdbc/DB"

                      Do I need to define CONTEXT for jdbc/DB. If yes, where and in which file?

                      Any pointers?

                      • 8. Re: javax.naming.NameNotFoundException: ShipmentSLSBean not
                        Manan Newbie

                        sorry, I still get folloing errors:
                        1. "javax.naming.NameNotFoundException: jdbc not bound"
                        2. "No resource manager found for jdbc/DB"

                        Any pointers?

                        Thanxs.

                        • 9. Re: javax.naming.NameNotFoundException: ShipmentSLSBean not
                          Adrian Brock Master

                          The resource references are bound into your bean's
                          environment. This has the context java:comp/env

                          So your database is bound at
                          java:comp/env/jdbc/DB

                          You can see where things are bound using the
                          following steps:
                          Access http://localhost:8082
                          find jboss:server=JNDIView and click on it
                          then find operation "list" and click on the
                          button (not the name).

                          Note: For jboss3.0.1+ use the url
                          http://localhost:8080/jmx-console

                          Regards,
                          Adrian

                          • 10. Re: javax.naming.NameNotFoundException: ShipmentSLSBean not
                            Manan Newbie


                            I do see jdbc/DB under java: namespace.

                            jdbc (class: org.jnp.interfaces.NamingContext)
                            | +- DB (class: org.jboss.resource.adapter.jdbc.local.LocalDataSource)

                            This have not been created under Global JNDI namespace like ShipmentBean

                            code in beans for making database connection is as follows:

                            InitialContext ictx = new InitialContext();
                            ds = (DataSource)ictx.lookup("java:comp/env/jdbc/DB");
                            con = ds.getConnection();

                            That seems to be okie.

                            Still the errors persists:
                            Error which occurs is of tro type:
                            1. No resource manager found for jdbc/DB
                            2. jdbc/DB not bound

                            So far, I have modified the following files with apporpriate changes for jdbc/DB :

                            1. jboss.xml
                            2. ejb-jar.xml
                            3. oracle-service.xml
                            4. standardjbosscmp-jdbc.xml
                            5. standardjaws.xml
                            6. login-config.xml

                            Do I need to make changes in any other file?

                            Any pointers...

                            Thanxs...

                            • 11. Re: javax.naming.NameNotFoundException: ShipmentSLSBean not
                              Adrian Brock Master

                              Sorry I didn't read your previous post too closely.

                              <resource-managers> is a jboss specific feature
                              that allows you bind resources into
                              java:/ rather than java:comp/env

                              This could be useful to you?

                              The java: naming context is available to any
                              bean within the same VM.

                              Normally, you would want separate definitions at the
                              bean level java:comp/env

                              With your current config it is bound at java:jdbc/DB

                              Regards,
                              Adrian

                              • 12. Re: javax.naming.NameNotFoundException: ShipmentSLSBean not
                                Manan Newbie

                                Thanxs again.

                                Errors are no longer appearing.

                                1.

                                This is what I have observed on 8082 under jboss.jca :
                                two instances are being created of LocalTxCM, LocalTxDS and LocalTxDS

                                i.e.

                                service=LocalTxCM,name=hsqldbDS
                                service=LocalTxCM,name=jdbc/DB
                                service=LocalTxDS,name=hsqldbDS
                                service=LocalTxDS,name=jdbc/DB
                                service=LocalTxPool,name=hsqldbDS
                                service=LocalTxPool,name=jdbc/DB

                                Is it okie to have tow instance? If not, what need to be done so that only one instance appear.

                                2.
                                In JNDI view,

                                folling is the observation,

                                java:comp namespace of the com.shipment.ejb.ShipmentBean bean:
                                +- env (class: org.jnp.interfaces.NamingContext)
                                | +- jdbc (class: org.jnp.interfaces.NamingContext)
                                | | +- DB[link -> java:/DefaultDS] (class: javax.naming.LinkRef)

                                For some reason, value of DB is java:/DefaultDS instead of java:/jdbc/DB

                                How can I make sure that EJB get linked to java:/jdbc/DB, not java:DefaultDS?
                                I have done changes to jboss.xml to reflect that but without any success.

                                Any pointers.

                                Thanxs.


                                • 13. Re: javax.naming.NameNotFoundException: ShipmentSLSBean not
                                  Adrian Brock Master

                                  I think I'm as confused by with all this xml
                                  flying around :-)

                                  Let's start again,

                                  you have in your ejb-jar.xml
                                  resource-ref>
                                  No Description
                                  <res-ref-name>jdbc/DB</res-ref-name>
                                  <res-type>javax.sql.DataSource</res-type>
                                  <res-auth>Container</res-auth>
                                  </resource-ref>

                                  Which will bind at java:comp/env/jdbc/DB

                                  You want to link this to java:jdbc/DB

                                  In jboss.xml put
                                  <resource-ref>
                                  <res-ref-name>jdbc/DB</res-ref-name>
                                  <jndi-name>java:jdbc/DB</jndi-name>
                                  </resource-ref>

                                  Regards,
                                  Adrian

                                  • 14. Re: javax.naming.NameNotFoundException: ShipmentSLSBean not
                                    Manan Newbie

                                    Thanks a ton, Dude!

                                    It works... There are other problems into which I have run into which is not related to installation and confguration. :)

                                    Thanks again.




                                    1 2 Previous Next