0 Replies Latest reply on Aug 23, 2008 7:33 AM by 843793

    how to use tomcat JNDI  resource in eclipse


      hi all, In my project i am using JSF,Tomcat,eclipse... i am planing to implement annotaions as part of my application
      I want to use Jndi resource as part of my project by using java annotaions

      for this i configured my server.xml in tomcat as
      <Context docBase="ALWREPORTSNEW" path="/ALWREPORTSNEW"
      source="org.eclipse.jst.jee.server:ALWREPORTSNEW" >
      <Resource auth="Container"
      driverClassName="com.mysql.jdbc.Driver" maxActive="10000"
      maxIdle="3000" maxWait="10000" name="jdbc/enrollmentschema"
      password="adminadmin" removeAbandoned="true"
      removeAbandonedTimeout="300" type="javax.sql.DataSource"
      username="root" />
      And i configured web.xml as
      <description>Enrollment Schema Connection pooling</description>
      And some where in my project i am using annotaion as follows. i am getting NULL when trying access that annotaion .

      @Resource(name = "jdbc/mobileEnrollProd") DataSource mobileds;
      @Resource(name = "jdbc/enrollmentschema")
      private DataSource enrollds;
      public String UploadBankWise() {
      System.out.println("--------- ds "+enrollds);// *i am getting NULL*
      but same code working with Glassfish and net benas..

      can any body hint me where i did mistake

      thanks in advance