title: Weblogic Datasource connection
body: <p>I'm trying to access a datasource connection via Java client with this code:</p>
  
  <pre><code>Connection conn;
  Statement stmt;
  ResultSet rs;
  
  try {
  Properties prop = new Properties();
  prop.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
  prop.put(javax.naming.Context.PROVIDER_URL, "t3://localhost:7001");
  Context ctx = new InitialContext(prop);
  Object obj = ctx.lookup("test/datasource");
  System.out.println("Data Source Found….");
  
  DataSource ds = (DataSource) obj;
  conn = ds.getConnection();
  System.out.println("Data Source User Name::"+conn.getMetaData().getUserName());
  stmt = conn.createStatement();
  
  String query = "select 1 from dual";
  System.out.println("Query " + query);
  rs = stmt.executeQuery(query);
  if (rs != null) {
      System.out.println("Some Data Found in Query");
  } else {
      System.out.println("No Data Found in Query");
  }
  ctx.close();
  } catch (Exception e) {
          e.printStackTrace();
  }
  </code></pre>
  
  <p>But i got the following stack trace. I can't figure out what happening. Someone knows?</p>
  
  <p>Data Source Found…</p>
  
  <p>Feb 13, 2012 4:07:28 PM GMT-03:00 Info JDBC BEA-001155 The following exception has occurred: </p>
  
  <p>java.lang.NullPointerException
      at weblogic.utils.wrapper.WrapperFactory.getCachedWrapperClass(WrapperFactory.java:55)
      at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:202)
      at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:190)
      at weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.java:175)
      at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:197)
      at weblogic.jdbc.rmi.SerialConnection.readResolve(SerialConnection.java:140)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1061)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
      at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:197)
      at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:564)
      at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:193)
      at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
      at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:240)
      at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
      at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
      at weblogic.jdbc.common.internal.RmiDataSource_1031_WLStub.getConnection(Unknown Source)</p>
  
  <p>Thanks in advance.</p>