0

I have created webdriver test for project and it works fine. Now I have added testpackage to Maven project and did some pom.xml changes then try to execute 1 test and i have following error

Class not found com.abc.xyz.con.TestExpressMode java.lang.ClassNotFoundException: com.abc.xyz.con.TestExpressMode 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:688) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:421) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Now i did so much google and not able to fix this problem. i have 1.8 jdk and developers have 1.6 i hope this is not a issue or?

Thanks

Pooja
  • 2,162
  • 5
  • 33
  • 64
  • Could be, but I think the real problem is a .class files that's missing from the project. What is that TestExpressMode thingy? Is that an Eclipse class? Try running the test lifecycle outside of Eclipse on a command line. – duffymo Oct 04 '16 at 13:03
  • its just a junit test – Pooja Oct 04 '16 at 13:03
  • which kind of class is missing? and how i can add and where? – Pooja Oct 04 '16 at 13:04
  • @Pooja, can you share your directory structure. May be an image is also fine. – RITZ XAVI Oct 04 '16 at 13:39
  • also, if i build project Run as-->Maven than getting error : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project SpringFileUpload: Fatal error compiling: tools.jar not found: C:\Program Files\Java\jre1.8.0_102\..\lib\tools.jar -> [Help 1] – Pooja Oct 04 '16 at 13:47
  • when i check tools.jar is there or not on location C:\Program Files\Java\jre1.8.0_102\ib\tools.jar -> is available but i am not able to understand followinf path .C:\ProgramFiles\Java\jre1.8.0_102\..\lib\tools.jar -> \..\before lib – Pooja Oct 04 '16 at 13:49
  • @RITZXAVI structure is very simple src\test\java:package:.java files (these are test ) – Pooja Oct 04 '16 at 13:50
  • You are trying to use the JRE to compile. You need to use the JDK and set JAVA_HOME to it. If you're trying to run this from within Eclipse, add the JDK to eclipse's Java runtimes. – tdrury Oct 04 '16 at 13:54
  • JAVA_HOME mean envirnment variable ? if yes than i have this already. also i have change from jre to jdk and execute test again some following errors appears now : .m2\repository\org\seleniumhq\selenium\jetty-repacked\7.6.1\jetty-repacked-7.6.1.jar; invalid LOC header (bad signature) – Pooja Oct 04 '16 at 14:51
  • Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project SpringFileUpload: Compilation failure: Compilation failure: [ERROR] error: error reading C:\Users\.m2\repository\org\apache\httpcomponents\httpmime\4.5.2\httpmime-4.5.2.jar; invalid LOC header (bad signature) – Pooja Oct 04 '16 at 14:52
  • error: error reading C:\Users\.m2\repository\mx4j\mx4j-tools\3.0.1\mx4j-tools-3.0.1.jar; invalid LOC header (bad signature) [ERROR] error: error reading C:\Users\.m2\repository\org\mortbay\jetty\servlet-api-2.5\6.1.9\servlet-api-2.5-6.1.9.jar; invalid LOC header (bad signature) – Pooja Oct 04 '16 at 14:53
  • error: error reading C:\Users\.m2\repository\net\java\dev\jna\jna\4.1.0\jna-4.1.0.jar; invalid LOC header (bad signature) [ERROR] -> [Help 1] – Pooja Oct 04 '16 at 14:53
  • Take a look at a post that i answered before on the same matter. http://stackoverflow.com/questions/39675845/classnotfoundexception-for-included-dependency/39687000#39687000 – Moshe Arad Oct 04 '16 at 17:51

0 Answers0