4 Replies Latest reply on Aug 6, 2004 11:32 AM by starksm64

    jndi datasource config

    analogueboy

      Our team of developers likes to swap between jboss+tomcat and standalone tomcat whilst developing the different modules in our applications (not all applications need jboss during development). The problem that we have is that JBoss use a private JNDI space for datasouces (java:/MyDataSource) whilst Tomcat tries to prepend "java:comp/env for it's initial context.

      How can I set up datasources in jboss and tomcat that will use the same name so that the applications don't need to be modified? Perhaps Jetty would (as usual) be better for servlet development than Tomcat?

        • 1. Re: jndi datasource config
          analogueboy

          can anyone at least provide a url or document to read because i havent been able to find anything after 2 hours on google

          • 2. Re: jndi datasource config
            thomas.diesler

            JBoss can be striped down to JNDI + Tomcat. What is the advantage of standalone Tomcat?

            • 3. Re: jndi datasource config
              analogueboy

              The only advantage is that it starts quicker, though we've never tried a reduce version of jboss (i'll try that now). But there is potentially a bigger problem that we are having with JNDI, why does JBoss not expose the datasource below comp/env? Is that not a more standard location?

              Or perhaps we shouldn't be using local-xa-datasource?

              Very confused now :(

              • 4. Re: jndi datasource config
                starksm64

                You have to tell it to use java:comp for the component and link this to the datasource location using a resource-ref element in the web.xml descriptor. A datasource cannot be bound into java:comp because this is a component private namespace. The datasource is created independent of any j2ee container.