1 Reply Latest reply on Sep 2, 2011 6:50 AM by wiciu

    RestEasy and JNDI datasource lookup problem, datasource come

    cliffs

      Hi All,
      I have a quick question regarding a problem I had been experiencing with RestEasy 1.1-RC2 and looking up a datasource in JNDI. I don't believe this is a RestEasy bug, it seems to be related to one of the jar files that ships with resteasy.

      I have a resteasy easy servlet that I deploy onto JBOSS 5.0.1GA. At some point in my resteasy application I go and lookup my datasource using:

      InitialContext ctx = new InitialContext();
       DataSource ds = (DataSource)ctx.lookup( "java:comp/env/jdbc/SomeDataSource" );
      


      However, the datasource is coming back as null. I did a listing of the JNDI jdbc context, and I see the DS in the context, it's just coming back at null.
      I know the datasource is there (configured in JBOSS) because I can get it, and use it via other non-resteasy servlets.

      I was able to fix this, be removing multiple .jar files that ships with RestEasy, ( by remove, I mean not deploying some jars with my webapp). I basically tried to guess which jars were already included with JBOSS 5.

      My question is: Does anyone know what jar file may have caused this? So that I don't deploy it in the future. I'm guessing this may have occured with other JBoss projects but I was unable to find the correct search words to look this up.

      Also, can anyone recommend, a minimum set of jars to include, assuming I will be running on Jboss 5.0.1?


      FYI, here are the jars that ship with RestEasy 5.0.1:
      -----------------------------------------------------------
      activation-1.1.jar
      async-http-jbossweb-1.1-RC2.jar
      async-http-servlet-3.0-1.1-RC2.jar
      async-http-tomcat6-1.1-RC2.jar
      commons-codec-1.2.jar
      commons-httpclient-3.1.jar
      commons-logging-1.0.4.jar
      FastInfoset-1.2.2.jar
      javassist-3.6.0.GA.jar
      jaxb-api-2.1.jar
      jaxb-impl-2.1.8.jar
      jaxrs-api-1.1-RC2.jar
      jboss-common-core-2.2.10.GA.jar
      jboss-logging-spi-2.0.5.GA.jar
      jbosscache-core-3.0.3.GA.jar
      jettison-1.0.1.jar
      jetty-6.1.15.jar
      jetty-util-6.1.15.jar
      jgroups-2.6.7.GA.jar
      jsr250-api-1.0.jar
      jta-1.1.jar
      jyaml-1.3.jar
      mail-1.4.jar
      resteasy-atom-provider-1.1-RC2.jar
      resteasy-cache-core-1.1-RC2.jar
      resteasy-jaxb-provider-1.1-RC2.jar
      resteasy-jaxrs-1.1-RC2.jar
      resteasy-multipart-provider-1.1-RC2.jar
      resteasy-spring-1.1-RC2.jar
      resteasy-yaml-provider-1.1-RC2.jar
      scannotation-1.0.2.jar
      servlet-api-2.5-20081211.jar
      servlet-api-2.5.jar
      sjsxp-1.0.1.jar
      slf4j-api-1.5.2.jar
      slf4j-simple-1.5.2.jar
      stax-api-1.0.jar
      webserver-1.3.3.jar


      Thanks for any help