4 Replies Latest reply: Jul 7, 2014 12:36 PM by Selvackp RSS

    could not find or load main class oracle.spatial.util.SampleShapefileToJGeomFeature?

    Selvackp

      Hi,

       

      Am getting below error while performing ESRI shapefile into oracle database table.,

       

      C:\>java -cp G:\app\product\11.2.0\dbhome_1\jdbc\lib\ojdbc14.jar;G:\app\product\

      11.2.0\dbhome_1\md\jlib\sdoutl-1.0.jar;\G:\app\product\11.2.0\dbhome_1\md\jlib\s

      doapi-1.0.jar oracle.spatial.util.SampleShapefileToJGeomFeature -h localhost -p

      1521 -sn orcl -u MDSYS -d selva -t shapes -f F:\saptial\Africa.shp -r 8307 -g ge

      ometry

       

      Error: Could not find or load main class oracle.spatial.util.SampleShapefileToJGeomFeature

       

      Am using java version as ,

       

      C:\>java -version

      java version "1.7.0_51"

      Java(TM) SE Runtime Environment (build 1.7.0_51-b13)

      Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)

       

      And also tried in MapBuilder its working fine.,but i need to import using java utility can any help me too this.,

        • 1. Re: could not find or load main class oracle.spatial.util.SampleShapefileToJGeomFeature?
          Selvackp

          Hi,

           

          I have tried as below ,

           

          set oracle_home="G:\app\product\11.2.0\dbhome_1\"

           

          set class_path="%oracle_home%\jdbc\lib\ojdbc14.jar;%oracle_home%\md\jlib\sdoutl-1.0.jar;%oracle_home%\md\jlib\s

          doapi-1.0.jar"

           

          C:\>java -class_path oracle.spatial.util.SampleShapefileToJGeomFeature -h localhost -p

          1521 -sn orcl -u MDSYS -d selva -t shapes -f F:\saptial\Africa.shp -r 8307 -g geometry

           

          Any input parameter is still necessary to given for the above utility?

           

          Its 70% percent working but getting,below error in java utility

           

          one of your key value pairs failed please try again error

           

          Thank you,

          • 2. Re: could not find or load main class oracle.spatial.util.SampleShapefileToJGeomFeature?
            Emad Al-Mousa

            Hi,

             

            please double check wither the Oracle Shapefile converter is inserting zero's on a number column when the value is NULL in the ESRI Shapefile.

             

            Regards,

            • 4. Re: could not find or load main class oracle.spatial.util.SampleShapefileToJGeomFeature?
              Selvackp

              i had tried below this way and problem got solved .,

               

              Before i have downloaded

               

              sdoutl-11.2.0.jar and sdoapi-11.2.0.jar used it for import shp file ..

               

              C:\>set ORACLE_HOME=G:\app\product\11.2.0\dbhome_1

               

              C:\Users\SELVA>cd downloads

               

              C:\Users\SELVA\Downloads>cd statplanet_zambia

               

              C:\Users\SELVA\Downloads\StatPlanet_Zambia>cd map

               

              located into particular path and set my oracle home

               

              C:\Users\SELVA\Downloads\StatPlanet_Zambia\map>set ORACLE_HOME=G:\app\product\11.2.0\dbhome_1

               

              C:\Users\SELVA\Downloads\StatPlanet_Zambia\map>java -classpath %ORACLE_HOME%\jdb

              c\lib\ojdbc5.jar;%ORACLE_HOME%\md\jlib\sdoutl-11.2.0.jar;%ORACLE_HOME%\md\jlib\sdoapi-11.2.0.jar oracle.spatial.util.SampleShapefileToJGeomFeature -h localhost -p 1521 -s orcl -u MDSYS -d selva -t zambia -f map -r 8307 -g geometry

              host: localhost

              port: 1521

              sid: orcl

              db_username: MDSYS

              db_password: selva

              db_tablename: zambia

              shapefile_name: map

              SRID: 8307

              db_geometry_column: geometry

              Connecting to Oracle10g using...

              localhost, 1521, orcl, MDSYS, selva, zambia, map, null, 8307

              Dropping old table...

              java.sql.SQLException: ORA-00942: table or view does not exist

               

              Creating new table...

              9 record(s) converted.

              Done.

               

              Thanks

              Selva