2 Replies Latest reply on Oct 13, 2004 4:35 AM by kirannuthati

    Tomcat JNDI Datasource now in JBOSS

    Juan Alvarado Newbie

      I have an application which has been developed in Tomcat. I configured a datasource in Tomcat in the server.xml that comes with Tomcat.


      I also have the following entry in the web.xml of my web application:
      DB Connection

      These two steps allow my application to gain access to the datasource through the name space:

      My question is how do I configure this exact datasource in jboss so that my application can access it transparently. I have tried this:


      But this doesn't work. When I try starting jboss I get a huge stacktrace of errors. I am sure that the mysql driver is in the lib folder of the server I am working in.

      Thanks in advance

        • 1. Re: Tomcat JNDI Datasource now in JBOSS
          Elias Ross Master

          1. Use the "Quote" feature around your configuration
          2. Take a look at the example datasource conf. in the docs directory
          3. Post appropriate parts of a stack trace; just saying you get "a huge stacktrace of errors" doesn't really convey much.

          • 2. Re: Tomcat JNDI Datasource now in JBOSS
            kirannuthati Newbie


            If use like this it won't work according to jboss docs u need to use like 'java:/securanceDatasource'

            If u r not intrested to change class files of ur application, u need to modify the method 'public Name parse(String name)' of 'org.jnp.interfaces.NamingParser.class' located in 'jnpserver.jar'

            Modify the method just like this

            public Name parse(String name)
            throws NamingException
            if (name.equals("java:comp/env/jdbc/securanceDatasource")) name="java:/securanceDatasource";
            return new CompoundName(name, syntax);
            It may work for ur application, but to generalize play around it.