Performance Center Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

Issue in performance center (controller) - script for connecting to oracle db

Occasional Visitor

Issue in performance center (controller) - script for connecting to oracle db

Issue in performance center (controller) while using script for connecting to oracle db using client specific oracle driver (Script is successful in vugen)

 

Protocol: Java record and replay

 

JDK version used: jdk1.6.0_17

 

Attached is the oracle jar and Vugen script code,

 

Error:

-------------------------------------------------------------------------------------------------------------------

 

Start auto log messages stack.    [MsgId: MMSG-10546]
Virtual User Script started at : 2014-01-16 20:18:31    [MsgId: MMSG-15967]
Starting action vuser_init.    [MsgId: MMSG-15919]
Notify: Transaction "DB_Connection" started.    [MsgId: MMSG-16999]
System.out: ## Please check the class path for the driver file ##                                                                                                                                                      Notify:    [MsgId: MMSG-17999]
Error: System.err: java.lang.ClassNotFoundException: com.ddtek.jdbc.oracle.OracleDriver                                                                                                                                                      Error    [MsgId: MERR-17999]
End auto log messages stack.    [MsgId: MMSG-10544]

Start auto log messages stack.    [MsgId: MMSG-10546]
System.err:     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)                                                                                                                                                      Error    [MsgId: MMSG-17999]
System.err:     at java.lang.Class.forName0(Native Method)                                                                                                                                                      Error    [MsgId: MMSG-17999]
System.err:     at java.lang.Class.forName(Class.java:169)                                                                                                                                                      Error    [MsgId: MMSG-17999]
System.err:     at Actions.init(Actions.java:47)                                                                                                                                                      Error    [MsgId: MMSG-17999]
Error: System.err: java.lang.ClassNotFoundException: com.ddtek.jdbc.oracle.OracleDriver                                                                                                                                                      Error    [MsgId: MERR-17999]
End auto log messages stack.    [MsgId: MMSG-10544]

Start auto log messages stack.    [MsgId: MMSG-10546]
System.err:     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)                                                                                                                                                      Error    [MsgId: MMSG-17999]
System.err:     at java.lang.Class.forName0(Native Method)                                                                                                                                                      Error    [MsgId: MMSG-17999]
System.err:     at java.lang.Class.forName(Class.java:169)                                                                                                                                                      Error    [MsgId: MMSG-17999]
System.err:     at Actions.init(Actions.java:47)                                                                                                                                                      Error    [MsgId: MMSG-17999]
Error: java.lang.ClassNotFoundException: com.ddtek.jdbc.oracle.OracleDriver    [MsgId: MERR-17999]
Error:     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at Actions.init(Actions.java:47)
    [MsgId: MERR-17999]
End auto log messages stack.    [MsgId: MMSG-10544]

----------------------------------------------------------------------------------------------------------------------------------------

 

code below

--------------------------------------------------------------------------------------------------------------------------------------

import lrapi.lr;
import java.io.*;
import java.sql.*;
import java.util.*;
import java.lang.*;


import lrapi.lr;

public class Actions
{
        java.sql.Connection connection = null;

    public int init() throws Throwable {

        try {



// Oracle DB connection

        lr.start_transaction("DB_Connection");

            String driverName = "com.ddtek.jdbc.oracle.OracleDriver";
            String serverName = "drptdb06";
            String portNumber = "1521";
            String sid = "DRPT1_EDA";
                        String url = "jdbc:datadirect:oracle://drptdb06:1521;serviceName=DRPT1_EDA;ConnectionRetryCount=5;ConnectionRetryDelay=2;FailoverMode=select;WSCompress=compress";
            String username = "EDA_XML_IMP";
            String password = "eda_pt1imp";
            Class.forName(driverName);
            connection = DriverManager.getConnection(url, username, password);

               lr.end_transaction("DB_Connection", lr.AUTO);



        }         
            catch (ClassNotFoundException cnfe) {
            System.out.println("## Please check the class path for the driver file ##");
            // Could not find the database driver
            cnfe.printStackTrace();
            throw cnfe;
        } catch (SQLException se) {
            // Could not connect to the database
            se.printStackTrace();
            throw se;
        }

        return 0;
    }//end of init


    public int action() throws Throwable {

        
        return 0;
    }//end of action


    public int end() throws Throwable {
        connection.close();
        return 0;
    }//end of end
}

 

------------------------------------------------------------------------------------------------------------------------------------

1 REPLY
Highlighted
HPE Expert

Re: Issue in performance center (controller) - script for connecting to oracle db

Hello

check the classpath on Load Generators as per error suggestion, if the java version is the same, client installed on there is the same also and classpath is correct, the switch the agent to work as process and nos as service, make sure to check this on all load generators this test is using.

Regards