5 Ответы Последний ответ: 20.12.2009 12:47, автор: 710565

    Spatial -- Eclipselink -- Production JDeveloper cannot find JGeometry

    mmillman
      We've developed an application using the Eclipselink spatial extensions developed by Doug Clarke's team and we're in the process of porting our applications to the Production JDeveloper release, WebLogic, and Eclipselink. We're failing when we add the first
      @StructConverter(name = "JGeometry", converter = "org.eclipse.persistence.platform.database.oracle.converters.JGeometryConverter") to a bean.
      with the following error message when we create the first EntityManager.
      ]] Root cause of ServletException.
      java.lang.NoClassDefFoundError: oracle/spatial/geometry/JGeometry
           at org.eclipse.persistence.platform.database.oracle.converters.JGeometryConverter.<clinit>(JGeometryConverter.java:33)
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Class.java:247)
           at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:86)
           at org.eclipse.persistence.internal.jpa.metadata.MetadataHelper.getClassForName(MetadataHelper.java:52)
           Truncated. see log file for complete stacktrace
      sdoapi.jar is in the applications WEB-INF/lib/ folder but I assume that this is the same problem that we had using OC4J that was cured by copying sdoapi.jar into the %JDEV_HOME%\lib\java\shared\oracle.toplink.ojdbc\11.1.1.0.0\ folder.

      What is the analogous folder in the Production JDeveloper?

      Mark
        • 1. Re: Spatial -- Eclipselink -- Production JDeveloper cannot find JGeometry
          obrienmi8
          Mark,
          Hi, there are 2 possible places depending on your version of JDeveloper 11 as part of Oracle Fusion Middleware with an embedded Oracle WebLogic Server.
          There is an email stream on the EclipseLink users forum from today that details the answers below....

          http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg02020.html

          beside your eclipselink.jar in
          <weblogic_home>\patch_wls103x\patch_jars
          or
          <weblogic_home>\modules

          Which should match the design-time jars in
          <weblogic_home>\jdeveloper\modules\oracle.toplink_11.x.x

          thank you
          /michael
          http://www.eclipselink.org

          Edited by: michael_obrien on Mar 24, 2009 5:54 PM
          • 2. Re: Spatial -- Eclipselink -- Production JDeveloper cannot find JGeometry
            mmillman
            Michael:

            Still not working. There must be something in your configuration that is finding the sdoapi.jar that is not in mine.

            The following is what I have set up now and I'm still getting the classNotFound exception

            I copied the sdoapi.jar file to these locations
            C:\oracle\Middleware>dir/s sdoapi.jar
            Directory of C:\oracle\Middleware\jdeveloper\modules
            09/07/2007  11:18 AM           108,281 sdoapi.jar
                           1 File(s)        108,281 bytes
             Directory of C:\oracle\Middleware\jdeveloper\modules\oracle.toplink_11.1.1
            09/07/2007  11:18 AM           108,281 sdoapi.jar
                           1 File(s)        108,281 bytes
             Directory of C:\oracle\Middleware\modules
            09/07/2007  11:18 AM           108,281 sdoapi.jar
                           1 File(s)        108,281 bytes
             Directory of C:\oracle\Middleware\patch_wls1030\patch_jars
            09/07/2007  11:18 AM           108,281 sdoapi.jar
                           1 File(s)        108,281 bytes
             Directory of C:\oracle\Middleware\wlserver_10.3\server\ext\jdbc\oracle\11g
            09/07/2007  11:18 AM           108,281 sdoapi.jar
                           1 File(s)        108,281 bytes
            Still didn't work so then I set SPATIAL_LIB and WEBLOGIC_HOME in my environment variables and rebooted
            C:\>set
            SPATIAL_LIB=C:\oracle\Middleware\jdeveloper\modules\oracle.toplink_11.1.1\sdoapi.jar
            WEBLOGIC_HOME=C:\oracle\Middleware\
             ... in addition to all my other environment variables
            
            C:\>cd %WEBLOGIC_HOME%
            C:\oracle\Middleware>
            
            C:\oracle\Middleware>dir %SPATIAL_LIB%
             Directory of C:\oracle\Middleware\jdeveloper\modules\oracle.toplink_11.1.1
            09/07/2007  11:18 AM           108,281 sdoapi.jar
                           1 File(s)        108,281 bytes
                           0 Dir(s)  100,777,361,408 bytes free
            and Finally I tried specifying SPATIAL_LIB and WEBLOGIC_HOME in the .product.properites files
            SPATIAL_LIB=C\:\\oracle\\Middleware\\jdeveloper\\modules\\oracle.toplink_11.1.1\\sdoapi.jar
            WEBLOGIC_HOME=C\:\\oracle\\Middleware\\
            I did this in the product.properties files found in %WEBLOGIC_HOME%\jdeveloper and %WEBLOGIC_HOME%\wlserver_10.3

            I did all of this incrementally stopping the WLS and shutting down JDeveloper between each trial.

            And I'm still getting
             Root cause of ServletException.
            java.lang.NoClassDefFoundError: oracle/spatial/geometry/JGeometry
                 at org.eclipse.persistence.platform.database.oracle.converters.JGeometryConverter.<clinit>(JGeometryConverter.java:33)
                 at java.lang.Class.forName0(Native Method)
                 at java.lang.Class.forName(Class.java:247)
                 at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:86)
                 at org.eclipse.persistence.internal.jpa.metadata.MetadataHelper.getClassForName(MetadataHelper.java:52)
                 Truncated. see log file for complete stacktrace
            java.lang.ClassNotFoundException: oracle.spatial.geometry.JGeometry
                 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:306)
                 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
                 Truncated. see log file for complete stacktrace
            My current work-around of modifying the eclipselink.jar to include the oracle.spatial.geometry package is simply not a keeper, so I'd really like to get to the bottom of this one.

            Thanks for your help. Mark

            Edited by: mmillman on Feb 4, 2009 3:18 PM
            • 3. Re: Spatial -- Eclipselink -- Production JDeveloper cannot find JGeometry
              djclarke
              Mark,

              Have you tried adding the sdopapi.jar to the system classpath?

              http://e-docs.bea.com/wls/docs103/programming/classloading.html#wp1096756

              Doug
              • 4. Re: Spatial -- Eclipselink -- Production JDeveloper cannot find JGeometry
                obrienmi8
                Mark,
                Try using the following patch jar and configuration process for Oracle WebLogic 11g and 11gR1.

                http://www.oracle.com/technology/products/ias/toplink/doc/11110/relnotes/toplink-relnotes.html#CJAGAEEJ

                thank you
                /michael
                • 5. Re: Spatial -- Eclipselink -- Production JDeveloper cannot find JGeometry
                  710565
                  Hi,

                  I solved this problem copying the following files to folder <WEBLOGIC_HOME>/server/lib :
                  <WEBLOGIC_HOME>\server\lib\org.eclipse.persistence_1.0.0.0_1-2-0.jar
                  <WEBLOGIC_HOME>\server\lib\sdoapi.jar
                  <WEBLOGIC_HOME>\server\lib\sdoutl.jar

                  And, on setDomainEnv.cmd, I put this files on POST_CLASSPATH variable, and now it´s work fine.


                  Nilo