Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.lang.NoClassDefFoundError: javax/ejb/SessionBean

panktiFeb 2 2016 — edited Feb 5 2016

Jdeveloper version - 12.2.1.0.0

The current project of mine is migrated from Jdeveloper 11.1.2.2.0 to Jdeveloper 12.2.1.0.0

I have an application with multiple EJB projects, each of which are deployed to a JAR. I have created a manifest file in a separate custom project to get the count of java and non-java files. In my Manifest Project Property à Dependencies block, I have added the EJB project and have selected the DesignerMig_testEJB_ejb option.

2.jpg

Now when I rebuild and run the manifest file to generate the manifest information I get the below error

Exception in thread "main" java.lang.NoClassDefFoundError: javax/ejb/SessionBean

            at java.lang.ClassLoader.defineClass1(Native Method)

            at java.lang.ClassLoader.defineClass(ClassLoader.java:760)

            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

            at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)

            at java.net.URLClassLoader.access$100(URLClassLoader.java:73)

            at java.net.URLClassLoader$1.run(URLClassLoader.java:368)

            at java.net.URLClassLoader$1.run(URLClassLoader.java:362)

            at java.security.AccessController.doPrivileged(Native Method)

            at java.net.URLClassLoader.findClass(URLClassLoader.java:361)

            at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

            at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

            at java.lang.Class.forName0(Native Method)

            at java.lang.Class.forName(Class.java:264)

            ……**\<Line details of my file>……**…

Caused by: java.lang.ClassNotFoundException: javax.ejb.SessionBean

            at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

            at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

            at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

              ... 20 more  

The line in the file what it is point to is

  1. Class.forName(<filepath>);

Note: I have a sample application for the same if required

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 4 2016
Added on Feb 2 2016
4 comments
1,646 views