6 Replies Latest reply on Jul 12, 2004 11:45 AM by rdebay

    Namespace jdbc not bound in JNDI

    rdebay

      The InitialContext returned to a client from the JBoss naming service contains entries for all the EJBs, services (such as topic and queue), etc. The name jdbc is not bound (I dumped the contents using list("java:/")).
      When the InitialContext is obtained from within the container, jdbc is bound (lookups against java:/jdbc succeed).
      The startup log shows it being bound here:

      16:25:41,736 INFO [jdbc/FirebirdDS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=NoTxCM,name=jdbc/FirebirdDS to JNDI name 'java:/jdbc/FirebirdDS'
      16:25:41,746 INFO [jdbc/XA-Firebird-Rxs] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=TxCM,name=jdbc/XA-Firebird-Rxs to JNDI name 'java:/jdbc/XA-Firebird-Rxs'

      Why isn't jdbc showing up outside the container, and how may I begin correcting it?

        • 1. Re: Namespace jdbc not bound in JNDI

          The java:/ context is only available to JNDI callers within the container.

          DataSources are also only valid within the container and cannot be used remotely. Hence, they are bound into the java:/ context.

          //Nicholas

          • 2. Re: Namespace jdbc not bound in JNDI
            rdebay

            I am able to access the java:/ context from outside the container. I get EJBObjects and make calls to them successfully, looking them up by the name 'java:/MyBean'. Everything is bound and usable, except for the jdbc context.
            If JBoss is exposing contexts that it shouldn't, that's OK with me as we're porting from OC4J and it allowed the same thing, handing us pooled connections outside the container.

            • 3. Re: Namespace jdbc not bound in JNDI

              Are you sure about that ?

              Take a look in the JNDIView in the JMXConsole. It will show you the java:/ and the Global context. I think you will find that the EJB home objects are bound in the Global context.

              In any case, exposing EJBs is deliberate. Exposing Datasources, at this point, is not, AFAIK.

              //Nicholas

              • 4. Re: Namespace jdbc not bound in JNDI
                rdebay

                When I get back to work Monday I will try that.

                How does calling list("java:/") to see what's bound differ from using the JMXconsole? Everything that I get back I can lookup() and use.

                • 5. Re: Namespace jdbc not bound in JNDI
                  rdebay

                  BTW, since there's no appropriate forum I'll kvetch here.

                  You'd think that JBoss would use a decent logon-filter, but after logging on while trying to post, it sent me to the home page. And after that, it failed as I had cookies turned off. URL rewriting should be the standard here, after all it's trivial in a well designed app.

                  • 6. Re: Namespace jdbc not bound in JNDI
                    rdebay

                    Crap; RTFM:
                    http://jboss.org/index.html?module=bb&op=viewtopic&t=46930#3831529

                    BTW, client access to a DataSource is not an anti-pattern. Bulk data loads are one example.