0 Replies Latest reply on Aug 8, 2002 5:03 PM by Jason

    Datasource.getConnection() problem

    Jason Newbie

      I am having problems geting a connection form a registered oracle datasource. I am confident that the datasouce is configured properly since I can see it on the :8082 admin page, and no exceptions are thrown when casting the lookup to a Datasouce object, below is the code i have and the exception that is throws. please help!

      try {
      InitialContext jndiContext = new InitialContext();
      DataSource ds = (DataSource) jndiContext.lookup("java:/OracleDS");

      if(ds==null){
      System.out.println("ds is NULL");
      }else{
      System.out.println("ds NOT NULL");
      }
      System.out.println("looked up OracleDS");
      con=ds.getConnection();
      System.out.println("I got here");
      } catch (NamingException e) {
      System.err.println(e.toString());
      return 0;
      } catch (SQLException e) {
      System.err.println(e.toString());
      return 0;
      }


      EXCEPTION:
      13:58:18,576 INFO [STDOUT] ds NOT NULL
      13:58:18,577 INFO [STDOUT] looked up OracleDS
      13:58:20,188 ERROR [Engine] StandardWrapperValve[invoker]: Servlet.service() for servlet invoker threw exception
      java.lang.NullPointerException
      at oracle.gss.util.NLSLocale.getInstance(NLSLocale.java:199)
      at oracle.jdbc.dbaccess.DBAccess.setNlsParamsClient(DBAccess.java:964)
      at oracle.jdbc.ttc7.TTC7Protocol.initNls(TTC7Protocol.java:1059)
      at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:206) at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
      at java.sql.DriverManager.getConnection(DriverManager.java:512)
      at java.sql.DriverManager.getConnection(DriverManager.java:140)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:133)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnection(InternalManagedConnectionPool.java:236)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:101)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:312)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:467)
      at org.jboss.resource.connectionmanager.LocalTxConnectionManager.getManagedConnection(LocalTxConnectionManager.java:221)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:532)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
      at org.jboss.resource.adapter.jdbc.local.LocalDataSource.getConnection(LocalDataSource.java:102)
      at com.ihsenergy.toolkit.soap.server.Soap.getCount(Unknown Source)
      at com.ihsenergy.toolkit.soap.server.Soap.service(Unknown Source)
      at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:446)
      at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
      at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
      at java.lang.Thread.run(Thread.java:536)
      13:58:20,848 ERROR [STDERR] java.lang.IllegalArgumentException: Null charset name
      13:58:20,850 ERROR [STDERR] at java.nio.charset.Charset.lookup(Charset.java:376)
      13:58:20,852 ERROR [STDERR] at java.nio.charset.Charset.isSupported(Charset.java:405)
      13:58:20,853 ERROR [STDERR] at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:67)
      13:58:20,855 ERROR [STDERR] at java.io.OutputStreamWriter.(OutputStreamWriter.java:93)
      13:58:20,856 ERROR [STDERR] at java.io.PrintWriter.(PrintWriter.java:103)
      13:58:20,862 ERROR [STDERR] at java.io.PrintWriter.(PrintWriter.java:87)
      13:58:20,863 ERROR [STDERR] at org.apache.catalina.connector.ResponseBase.getReporter(ResponseBase.java:534)
      13:58:20,865 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.report(ErrorReportValve.java:349)
      13:58:20,867 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:202)
      13:58:20,868 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      13:58:20,870 ERROR [STDERR] at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
      13:58:20,872 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      13:58:20,873 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      13:58:20,875 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      13:58:20,876 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      13:58:20,879 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      13:58:20,881 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      13:58:20,882 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
      13:58:20,884 ERROR [STDERR] at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
      13:58:20,885 ERROR [STDERR] at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
      13:58:20,887 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536)