6 Ответы Последний ответ: 20.01.2019 0:05, автор: Subba Rao Bhamidipati

    NoClassDefFoundError while executing Custom Java Concurrent Program

    Subba Rao Bhamidipati

      Hi,

       

      Our EBS version is 12.2.7 and We have developed a custom Java Concurrent Program. This Custom Java Program also refers external Jars.

      We compiled the Java class and placed under $JAVA_TOP with package structure oracle/apps/fnd/cp/request. Also copied all required jars under $JAVA_TOP.

       

      Registered the Java Executable and defined a java concurrent program in EBS. Also specified below value for OPTIONS filed while defining Java Concurrent Program:

       

      -classpath /u003/app/applmgr/MSIAAD3/fs2/EBSapps/comn/java/classes/:/u003/app/applmgr/MSIAAD3/fs2/EBSapps/comn/java/classes/Esig_custom_jars/*

       

      Now, when we submit the concurrent request in EBS, it is failed with below error. Concurrent log file displays below trace.

      It appears, it is not able to locate some seeded jar file. What are we missing?

       

       

      java.lang.NoClassDefFoundError: oracle/adf/mds/metamodel/MMFactory

      at oracle.apps.fnd.cp.request.Run.main(Run.java:126)

      Caused by: java.lang.ClassNotFoundException: oracle.adf.mds.metamodel.MMFactory

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

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

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

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

      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)

      ... 1 more

        • 1. Re: NoClassDefFoundError while executing Custom Java Concurrent Program
          Kanda-Oracle

          Hi ,


          Refer below sections in (Doc ID 1577661.1)

            Section 1.5.2: Deploying Customizations on a Production Environment

            Section 1.5.5: Deploying Java Files at Non-Standard Location(s) for Custom Products

           

          Developing and Deploying Customizations in Oracle E-Business Suite Release 12.2 (Doc ID 1577661.1)

           

          Thanks

           

          N Kandasamy    

          • 2. Re: NoClassDefFoundError while executing Custom Java Concurrent Program
            Kanda-Oracle

            Please share did you run "Generate product JAR files" from adadmin

            • 3. Re: NoClassDefFoundError while executing Custom Java Concurrent Program
              handat

              You most likely compiled against a different version of that class in your IDE than what is on the EBS server.

              • 4. Re: NoClassDefFoundError while executing Custom Java Concurrent Program
                Subba Rao Bhamidipati

                Hi,

                 

                No I havent done this step. And I am new to this.

                Can you please give the steps torun this?

                 

                Thanks,

                Subba

                • 5. Re: NoClassDefFoundError while executing Custom Java Concurrent Program
                  Subba Rao Bhamidipati

                  Looks like our DBA's ran "Generate product JAR files" using adadmin on the instance.

                  But it is still failing with same error. Any Help? Thank You1

                  • 6. Re: NoClassDefFoundError while executing Custom Java Concurrent Program
                    Subba Rao Bhamidipati

                    HI Kanda,

                     

                    DBA's confirmed they did "Generate product JAR files" and restarted the servers.

                    My observation is, if I dont specify any value in "OPTIONS" while defining the Java Concurrent Program, and If i dont refer any 3rd part JAR's, the custom CP runs fine with desired output.

                     

                    But, if we refer classes from 3rd party JAR's like "Unirest" / "JSON" etc.. in our program and specify below value in "OPTIONS" field it is failing with error.

                     

                    -classpath /u003/app/applmgr/MSIAAD3/fs2/EBSapps/comn/java/classes:/u003/app/applmgr/MSIAAD3/fs2/EBSapps/comn/java/lib/*:/u003/app/applmgr/MSIAAD3/fs2/EBSapps/comn/java/lib/Esig_custom_jars/*

                     

                    In above, please note that:

                    I have copied my custom CP class to /u003/app/applmgr/MSIAAD3/fs2/EBSapps/comn/java/classes

                    I have copied 3rd party JAR's to /u003/app/applmgr/MSIAAD3/fs2/EBSapps/comn/java/lib/Esig_custom_jars/*

                    And the product related zip files like "mdsrt.zip" etc.. are in /u003/app/applmgr/MSIAAD3/fs2/EBSapps/comn/java/lib/*

                     

                    But why the program still fails with below error?

                     

                    java.lang.NoClassDefFoundError: oracle/adf/mds/metamodel/MMFactory

                    at oracle.apps.fnd.cp.request.Run.main(Run.java:126)

                    Caused by: java.lang.ClassNotFoundException: oracle.adf.mds.metamodel.MMFactory

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

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

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

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

                    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)

                    ... 1 more

                     

                    One observation is "mdsrt.zip" is a zip file not JAR file. If i unzip the contents and create a ".JAR" file as "mdsrt.jar" then above exception is gone. But it started giving below exception. Is it that the "-classpath" value we specify not able to read "zip" files? If so, where is the location of all seeded - product related JAR files? so that i can try specifying that directory in "-classpath" for "OPTIONS" field.

                     

                    java.lang.NoClassDefFoundError: oracle/jdbc/OracleConnection

                    at oracle.apps.fnd.security.ConnectionManager.<clinit>(ConnectionManager.java:407)

                    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

                    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

                    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

                    at oracle.apps.fnd.common.Context.makeConnectionManager(Context.java:531)

                    at oracle.apps.fnd.common.AppsContext.makeConnectionManager(AppsContext.java:898)

                    at oracle.apps.fnd.common.Context.setConnectionManager(Context.java:484)

                    at oracle.apps.fnd.common.Context.setConnectionManager(Context.java:468)

                    at oracle.apps.fnd.common.AppsContext.initializeContext(AppsContext.java:540)

                    at oracle.apps.fnd.common.AppsContext.<init>(AppsContext.java:304)

                    at oracle.apps.fnd.cp.request.CpContext.<init>(CpContext.java:146)

                    at oracle.apps.fnd.cp.request.CpContext.<init>(CpContext.java:129)

                    at oracle.apps.fnd.cp.request.Run.main(Run.java:126)

                    Caused by: java.lang.ClassNotFoundException: oracle.jdbc.OracleConnection

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

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

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

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

                    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)

                    ... 14 more

                     

                    I feel, "OPTIONS" field should have a full value with location to all seeded JAR files and 3rd party JAR files to have this program executed.

                    Please review and any inputs is really appreciated.

                     

                    Thanks,

                    Subba