5 Replies Latest reply on Apr 27, 2011 12:24 PM by java0bject

    Issue with the context

    java0bject Newbie

      Hello JBoss guru's,

      I am facing some issue with the context object in JNDI.

      I have an application which uses the JNDI for datasource and fetches some data from DB,

      My ****-ds.xml file and datasource bound messages in server console are all looking good without any erro's.

       

      10:20:23,676 INFO  [org.jboss.jms.server.connectionfactory.ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@105d6a0 started

      10:20:23,879 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'

      10:20:24,582 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssAllPrd' to JNDI name 'java:SybaseCssAllPrd'

      10:20:24,645 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM01Prd' to JNDI name 'java:SybaseCssM01Prd'

      10:20:24,692 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM02Prd' to JNDI name 'java:SybaseCssM02Prd'

      10:20:24,786 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM03Prd' to JNDI name 'java:SybaseCssM03Prd'

      10:20:24,832 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM04Prd' to JNDI name 'java:SybaseCssM04Prd'

      10:20:24,879 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM05Prd' to JNDI name 'java:SybaseCssM05Prd'

      10:20:24,942 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM06Prd' to JNDI name 'java:SybaseCssM06Prd'

      10:20:24,989 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM07Prd' to JNDI name 'java:SybaseCssM07Prd'

      10:20:25,051 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM08Prd' to JNDI name 'java:SybaseCssM08Prd'

      10:20:25,129 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM09Prd' to JNDI name 'java:SybaseCssM09Prd'

      10:20:25,176 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM10Prd' to JNDI name 'java:SybaseCssM10Prd'

      10:20:25,239 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM11Prd' to JNDI name 'java:SybaseCssM11Prd'

      10:20:25,286 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM12Prd' to JNDI name 'java:SybaseCssM12Prd'

      10:20:25,348 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM13Prd' to JNDI name 'java:SybaseCssM13Prd'

      10:20:25,442 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM14Prd' to JNDI name 'java:SybaseCssM14Prd'

      10:20:25,489 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM15Prd' to JNDI name 'java:SybaseCssM15Prd'

      10:20:25,551 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM16Prd' to JNDI name 'java:SybaseCssM16Prd'

      10:20:25,598 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM17Prd' to JNDI name 'java:SybaseCssM17Prd'

      10:20:25,661 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM18Prd' to JNDI name 'java:SybaseCssM18Prd'

      10:20:25,754 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM19Prd' to JNDI name 'java:SybaseCssM19Prd'

      10:20:25,817 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM20Prd' to JNDI name 'java:SybaseCssM20Prd'

      10:20:25,879 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM21Prd' to JNDI name 'java:SybaseCssM21Prd'

      10:20:25,926 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM22Prd' to JNDI name 'java:SybaseCssM22Prd'

      10:20:25,989 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM23Prd' to JNDI name 'java:SybaseCssM23Prd'

      10:20:26,036 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM24Prd' to JNDI name 'java:SybaseCssM24Prd'

      10:20:26,332 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/admin-console

      10:20:26,489 INFO  [javax.enterprise.resource.webcontainer.jsf.config] Initializing Mojarra (1.2_13-b01-FCS) for context '/admin-console'

       

       

      BUt when i try to access the data, i am getting this error:

      08:42:43,121 INFO  [STDOUT] This is dsAll :org.jboss.resource.adapter.jdbc.WrapperDataSource@ff8174

      08:42:51,668 INFO  [STDOUT] The allDbCon :org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6@1c2e46

      08:43:09,449 ERROR [STDERR] XMLServlet->getAccDataSources: SybaseCssM01Prd not bound

      08:43:27,871 ERROR [STDERR] Process started at 8:43:27 AM CDT

      08:43:53,526 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/web1/nexus2].[XMLServlet]] Servlet.service() for servlet XMLServlet threw exception

      java.lang.NullPointerException

          at billHistory.XMLDocument.<init>(XMLDocument.java:67)

          at servlets.XMLServlet.doPost(XMLServlet.java:147)

          at servlets.XMLServlet.doGet(XMLServlet.java:96)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

          at java.lang.Thread.run(Thread.java:619)

       

      Can any one suggest/Help

       

      Thank you All.

        • 1. Issue with the context
          Wolf-Dieter Fink Master

          How your code looks like?

          • 2. Issue with the context
            java0bject Newbie

            i have multiple datasources as y db is partitioned :

            mydatasourcefile-ds.xml

            <?xml version="1.0" encoding="UTF-8"?>

             

            <datasources>

             

             

              <local-tx-datasource>

                <jndi-name>SybaseCss1</jndi-name>

                <connection-url>jdbc:sybase:xxx:xxxxx:71200/dbname</connection-url>

                <driver-class>com.sybase.jdbc3.jdbc.SybDriver</driver-class>

                <user-name>xxxxxx</user-name>

                <password>xxxxxxx</password>

                <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>

                <min-pool-size>1</min-pool-size>

                <max-pool-size>10</max-pool-size>

                <new-connection-sql>SELECT COUNT(*) FROM sysobjects</new-connection-sql>

                <check-valid-connection-sql>SELECT COUNT(*) FROM sysobjects</check-valid-connection-sql>

                <metadata>

                   <type-mapping>Sybase</type-mapping>

                </metadata>

              </local-tx-datasource>

             

              <local-tx-datasource>

                <jndi-name>SybaseCss2</jndi-name>

                <connection-url>jdbc:sybase:xxx:xxxxx:71200/dbname</connection-url>

                <driver-class>com.sybase.jdbc3.jdbc.SybDriver</driver-class>

                <user-name>xxxxxx</user-name>

                <password>xxxxxxx</password>

                <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>

                <min-pool-size>1</min-pool-size>

                <max-pool-size>10</max-pool-size>

                <new-connection-sql>SELECT COUNT(*) FROM sysobjects</new-connection-sql>

                <check-valid-connection-sql>SELECT COUNT(*) FROM sysobjects</check-valid-connection-sql>

                <metadata>

                   <type-mapping>Sybase</type-mapping>

                </metadata>

              </local-tx-datasource>

            <datasources>

             

            and in code:

            Context ctx = new InitialContext();

            DataSource dsAll = (DataSource)ctx.lookup("java:jndiname");

            Connection allDbCon = dsAll.getConnection();

            • 3. Issue with the context
              Wolf-Dieter Fink Master

              I'm confused

               

              Your first post shows 'SybaseCssM##Prd'

              Your ds.xml shows 'SybaseCss#'

              What is correct? What do you see as name in the jmx-console (search the JCA section)?

              How your lookup is exactly?

              • 4. Re: Issue with the context
                java0bject Newbie

                 

                Thank you for helping me out here are the details :.

                My ds file name is sybasecss-ds.xml,  and the contents of the ds file

                <local-tx-datasource>

                    <jndi-name>SybaseCssAllPrd</jndi-name>

                    <connection-url>jdbc:sybase:xxx:xxxxxx:7000/css_all_prd</connection-url>

                    <driver-class>com.sybase.jdbc3.jdbc.SybDriver</driver-class>

                    <user-name>username</user-name>

                    <password>pwd</password>

                    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>

                    <min-pool-size>1</min-pool-size>

                    <max-pool-size>10</max-pool-size>

                    <new-connection-sql>SELECT COUNT(*) FROM sysobjects</new-connection-sql>

                    <check-valid-connection-sql>SELECT COUNT(*) FROM sysobjects</check-valid-connection-sql>

                    <metadata>

                       <type-mapping>Sybase</type-mapping>

                    </metadata>

                  </local-tx-datasource>

                 

                 

                  <local-tx-datasource>

                    <jndi-name>SybaseCssM01Prd</jndi-name>

                    <connection-url>jdbc:sybase:xxxx:xxxxx:7000/css_m01_prd</connection-url>

                    <driver-class>com.sybase.jdbc3.jdbc.SybDriver</driver-class>

                    <user-name>username</user-name>

                    <password>pwd</password>

                    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>

                    <min-pool-size>1</min-pool-size>

                    <max-pool-size>10</max-pool-size>

                    <new-connection-sql>SELECT COUNT(*) FROM sysobjects</new-connection-sql>

                    <check-valid-connection-sql>SELECT COUNT(*) FROM sysobjects</check-valid-connection-sql>

                    <metadata>

                       <type-mapping>Sybase</type-mapping>

                    </metadata>

                  </local-tx-datasource>

                 

                When i start the jboss server i see all the datasources are bound :

                 

                2011-04-06 13:41:30,898 INFO  [org.jboss.jms.server.connectionfactory.ConnectionFactory] Connector bisocket://localhost:4457 has leasing enabled, lease period 10000 milliseconds

                2011-04-06 13:41:30,898 INFO  [org.jboss.jms.server.connectionfactory.ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@e82f93 started

                2011-04-06 13:41:31,163 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'

                2011-04-06 13:41:31,773 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssAllPrd' to JNDI name 'java:SybaseCssAllPrd'

                2011-04-06 13:41:31,851 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM01Prd' to JNDI name 'java:SybaseCssM01Prd'

                2011-04-06 13:41:31,913 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM02Prd' to JNDI name 'java:SybaseCssM02Prd'

                2011-04-06 13:41:31,960 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM03Prd' to JNDI name 'java:SybaseCssM03Prd'

                2011-04-06 13:41:32,007 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM04Prd' to JNDI name 'java:SybaseCssM04Prd'

                2011-04-06 13:41:32,069 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM05Prd' to JNDI name 'java:SybaseCssM05Prd'

                2011-04-06 13:41:32,116 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM06Prd' to JNDI name 'java:SybaseCssM06Prd'

                2011-04-06 13:41:32,210 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM07Prd' to JNDI name 'java:SybaseCssM07Prd'

                2011-04-06 13:41:32,257 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM08Prd' to JNDI name 'java:SybaseCssM08Prd'

                2011-04-06 13:41:32,304 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM09Prd' to JNDI name 'java:SybaseCssM09Prd'

                2011-04-06 13:41:32,366 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM10Prd' to JNDI name 'java:SybaseCssM10Prd'

                2011-04-06 13:41:32,413 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM11Prd' to JNDI name 'java:SybaseCssM11Prd'

                2011-04-06 13:41:32,491 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM12Prd' to JNDI name 'java:SybaseCssM12Prd'

                2011-04-06 13:41:32,554 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM13Prd' to JNDI name 'java:SybaseCssM13Prd'

                2011-04-06 13:41:32,616 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM14Prd' to JNDI name 'java:SybaseCssM14Prd'

                2011-04-06 13:41:32,663 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM15Prd' to JNDI name 'java:SybaseCssM15Prd'

                2011-04-06 13:41:32,710 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM16Prd' to JNDI name 'java:SybaseCssM16Prd'

                2011-04-06 13:41:32,804 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM17Prd' to JNDI name 'java:SybaseCssM17Prd'

                2011-04-06 13:41:32,851 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM18Prd' to JNDI name 'java:SybaseCssM18Prd'

                2011-04-06 13:41:32,898 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM19Prd' to JNDI name 'java:SybaseCssM19Prd'

                2011-04-06 13:41:32,960 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM20Prd' to JNDI name 'java:SybaseCssM20Prd'

                2011-04-06 13:41:33,007 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM21Prd' to JNDI name 'java:SybaseCssM21Prd'

                2011-04-06 13:41:33,054 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM22Prd' to JNDI name 'java:SybaseCssM22Prd'

                2011-04-06 13:41:33,148 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM23Prd' to JNDI name 'java:SybaseCssM23Prd'

                2011-04-06 13:41:33,194 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=SybaseCssM24Prd' to JNDI name 'java:SybaseCssM24Prd'

                2011-04-06 13:41:33,538 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/admin-console

                 

                 

                And in admin console i see all datasources unbder the resources section local-ds......

                when i try from code i am getting exception as datasource not bound.

                 

                JAVACODE:

                            Context ctx = new InitialContext();

                            ServletContext sctx = getServletContext();

                            path = sctx.getRealPath("/");

                 

                            // Load Account Hashing Table that is used to determine the

                            // database partition for an account.

                            // dsAll = (DataSource)ctx.lookup("java:SybaseCssAllPrd");

                            dsAll = (DataSource)ctx.lookup("SybaseCssM01Prd");

                            System.out.println("This is dsAll :" + dsAll);

                            allDbCon = dsAll.getConnection();

                            System.out.println("The allDbCon :" + allDbCon);

                            acctHashTbl = new AcctHashTbl(allDbCon);

                 

                            getAccDataSources(ctx);

                 

                and the getAccDataSources(ctx) method basically looks for diff datasources as i have 24 of them.

                public void getAccDataSources(Context ctx) {

                        try {

                            dsA01 = (DataSource)ctx.lookup("SybaseCssM01Prd");

                            System.out.println("This is the ctx value erroring out :" + dsA01);

                            dsA02 = (DataSource)ctx.lookup("SybaseCssM02Prd");

                        .......................

                        ......................

                            dsA06 = (DataSource)ctx.lookup("SybaseCssM06Prd");

                            dsA24 = (DataSource)ctx.lookup("SybaseCssM24Prd");

                        } catch (NamingException nexp) {

                            System.err.println("XMLServlet->getAccDataSources: " + nexp.getMessage());

                        }

                    }

                 

                Message was edited by: Harpreet Sardar

                • 5. Issue with the context
                  java0bject Newbie

                  After a string struggle and sleepless nights i am able to make this thing work .......