Exception in thread "main" java.lang.NoClassDefFoundError
LeylaDahOct 30 2012 — edited Nov 28 2012Hello Experts,
I'm quite sure that in this forum there are analogous issues, but I haven't been able to find one who matches.
The IDE used is JDeveloper 11.1.1.5.0.
The issue: I created some custom classes and I deployed inside an archive1.jar.
I generate a new testing code, "Test.java" and, from JDeveloper, I'm able to import the above library, invoke it and I'm correctly able to use the methods present inside my custom classes.
I generate a deployment profile, I edit it and inside the "File Groups" I add:
"WEB-INF/lib" as target directory and group file name.
I make sure that inside the voice "filters" is present the previous jar that I imported inside this project and I deploy.
Running from console I get the following error:
C:\>java -jar mainClass.jar
Exception in thread "main" java.lang.NoClassDefFoundError: com/MyList
at com.test.main(test.java:7)
Caused by: java.lang.ClassNotFoundException: com.MyList
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)
... 1 more
I opened the mainClass.jar file and I checked that inside the folder WEB-INF/lib is correctly present the mylist.jar file, although it says that it's not able to find it inside the jar file.
How could I fix this problem?
Thank you