2 Replies Latest reply: Oct 3, 2012 12:48 PM by Ravi Jegga RSS

    Re: Weblogic Data Source issue


      i am write a program on data source to access database connection here is code but i am getting an exception at create statement

      Hashtable<String, String> hashtable = new Hashtable<String, String>();
                Context context = new InitialContext(hashtable);
                Connection connection = null;
                Object o = context.lookup("jdbc/jndi/test");
                DataSource dataSource = (DataSource) o;
                connection = dataSource.getConnection();
                Statement statement = connection.createStatement();
                ResultSet resultSet = statement.executeQuery("select empno,empname from testtest");
                while (resultSet.next()) {
                catch (Exception e) {
                     System.out.println("EXCCCCCC :::"+e);
                System.out.println("something different");

      but i am getting exception as
      EXCCCCCC :::java.sql.SQLException: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception - with nested exception:
      [java.rmi.MarshalException: error marshalling return; nested exception is:
           java.io.NotSerializableException: oracle.sql.LobDBAccessImpl]

      can anyone help me how to avoid this exception
        • 1. Re: Weblogic Data Source issue
          Ravi Jegga
          1. When you created this DataSource and gave Connection Pool details from Weblogic Admin Console, what Drivers did you select. You can find this from your domain/config/jdbc/xxx.xml file where xxx kind of refers to the datasource file. This has all .xml file for each datasource. Please send me this file here.

          2. Try to use normal Oracle out of box Service Level Non-XA Drivers and see if that helps.

          3. Also make sure you have the Remote JDBC flag enabled in your setDomainEnv file. Most probably this may not be issue looking at your error. But please do set this. Re: Use DataSource of weblogic in a standalone Java file

          4. Make sure you do not have any other 3rd party ojdbc jars unless if you really require for some reasons.

          Ravi Jegga
          • 2. Re: Weblogic Data Source issue
            Ravi Jegga
            Duplicate reply