Got an error message "Error: Could not find or load main class com.ibm.rqm.adapter.commandline.JUnitLauncher -test" when running test script by Junit Selenium
I got an error message when running my script from RQM by JUnit Selenium type
"Error: Could not find or load main class com.ibm.rqm.adapter.commandline.JUnitLauncher -test"
And Adapter.log file displayed error message like this:
"09:19:58,701 [main] INFO com.ibm.rqm.adapter.commandline - "Created JUnit Selenium Adapter"
09:20:37,538 [Thread-1] ERROR com.ibm.rqm.adapter.commandline - Failed to read serialized JUnit report object: null Execution result will not contain step results for individual JUnit tests."
Does anyone have experience with this error? Pls help?
2 answers
We have seen something similar before in the past (see Error executing junit through adapter (133539)). However, we could not reproduce the symptom. I would suggest to open a Case (https://www.ibm.com/mysupport) for IBM Support to investigate this symptom in your environment.
While executing, when JVM does not find a .class file with the specified name then a run time error occurs saying “Could not found or load main class”. The reason why this happens is mostly due to:
- Wrong Class Name
- Invalid Classpath
Main class could not be found when there is typo or wrong syntax in the fully qualified java class name or it does not exist in the provided classpath. You must ensure that you add the location of your .class file to your classpath. So, if its in the current folder, add . to your classpath. Note that the Windows classpath separator is a semi-colon( ;) . If you want to execute the main() method in MainClass, you must use the full class name, including package name, in the java command.