cancel
Showing results for 
Search instead for 
Did you mean: 

Unit Test Fails Class Not Found

tmcclure
Champ in-the-making
Champ in-the-making
I am working through a simple example of creating a process using the Activiti designer.  I create the unit test and the all references correctly resolved.  I get a class not found exception when I try to execute the unit test and notice that no unit test class is being created in the target directory.  The project is Maven enabled - and as I said all references are resolved.  I am probably doing something stupid - below is my exception trace:

Class not found org.activiti.designer.test.ProcessTestMyProcess
java.lang.ClassNotFoundException: org.activiti.designer.test.ProcessTestMyProcess
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:693)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:429)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
4 REPLIES 4

tmcclure
Champ in-the-making
Champ in-the-making
Never mind - I figured out the issue - I generated the unit test before I converted the project to maven.  If you convert the project to maven as soon as you define and generate later everything works.

frederikherema1
Star Contributor
Star Contributor
Thanks for sharing that the issue is fixed.

martkik29
Champ in-the-making
Champ in-the-making
PLease am Having this same Issue. How do i solve this.

Class not found com.tkshop.test.web.pc.agent.AgentSuiteRunner
java.lang.ClassNotFoundException: com.tkshop.test.web.pc.agent.AgentSuiteRunner
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:693)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:429)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Please i need urgent Help as have tried Maven clean and all.

THanks

jbarrez
Star Contributor
Star Contributor
The error indicates the jar or class is not on your classpath.
Is this a class in an external jar? Did you add the dependency in the pom.xml?