AnsweredAssumed Answered

Sourcefire VJDBC driver as Datasource

Question asked by Gerardo Sevilla on May 24, 2019

I am trying to use a VJDBC (com.sourcefire.vjdbc.VirtualDriver) supplied by vendor CISCO to access an equipment's database. The driver set up is explained in https://www.cisco.com/c/en/us/td/docs/security/firepower/620/api/db-access/Database_Access/Setup.html.

 

Pentaho Data Integration is being used to try to pull data from the database and to publish it in an external database.

- The TEST option on the NEW DATABASE connection is successful but the EXPLORE option throws a StreamCorruptedException.

- No data can be extracted. PDI cannot obtain any metadata from the database.

- Sample java program is supplied and works. It uses the the following code:

 

import java.sql.*;
import java.io.*;
import java.net.InetAddress;
import java.security.*;
import java.util.*;

 

public class RunQuery
{

   private static Connection c;
   private static Statement st;
   private static String xmlFile;
   private static String host;
   private static String user;
   private static String password;

   public static void main(String args[]) throws Exception
   {
      String sql = null;
      Boolean FromCLI = false;

      if (args.length < 3)
      {
            System.out.println("Usage: java RunQuery <host> <user> <password> [sql]");
            return;
      }
      host = args[0];
      user = args[1];
      password = args[2];

      if (args.length >= 4)
      {
            sql = args[3];
            FromCLI = true;
      }

      try
      {
            Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
            Class.forName("com.sourcefire.vjdbc.VirtualDriver").newInstance();
       }
       catch(Exception e)
      {
            e.printStackTrace();
            return;
      }

      String jurl = "jdbc:vjdbc:rmi://" + host + ":2000/VJdbc,eqe";

      try
      {
            c = DriverManager.getConnection(jurl, user, password);
      }
      catch(SQLException e)
      {
         if (e.getMessage().indexOf("login failed") != -1)
         {
               System.out.println("RunQuery: login failed");
               System.exit(0);
         }
         else
         {
               throw e;
      }
   }

   st = c.createStatement();

   DatabaseMetaData meta = c.getMetaData();

 

As shown in the portion of sample code, c.getMetaData() succeeds, while Pentaho PDI fails like this:

 

Unable to get database metadata from this database connection
RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.io.StreamCorruptedException: invalid type code: 00


at org.pentaho.di.core.database.DatabaseMetaInformation.getData(DatabaseMetaInformation.java:413)
at org.pentaho.di.ui.core.database.dialog.GetDatabaseInfoProgressDialog$1.run(GetDatabaseInfoProgressDialog.java:65)

 

¿Anyone has had this issued and resolved it? Thanks it advance.

Outcomes