Menu

undefined symbol: JNI_CreateJavaVM

Help
2007-01-16
2013-04-16
  • Luciano Mittmann

    Hi jposh

    I'm trying to configure the PostgresForest, but I can't resolv this error :

    postgres@ecelepar09836:/opt/forest40$ java -classpath /opt/forest40/share/postgresql-8.1-407.jdbc3.jar:/usr/lib/postgresql/8.1/lib/pljava/deploy.jar org.postgresql.pljava.deploy.Deployer -install -port 5432 -database forest_template -user postgres

    org.postgresql.util.PSQLException: ERRO: cannot load library "/usr/lib/postgresql/8.1/lib/pljava.so": /usr/lib/postgresql/8.1/lib/pljava.so: undefined symbol: JNI_CreateJavaVM
            at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1525)
            at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1309)
            at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
            at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
            at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:340)
            at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:332)
            at org.postgresql.pljava.deploy.Deployer.initJavaHandlers(Deployer.java:474)
            at org.postgresql.pljava.deploy.Deployer.main(Deployer.java:269)

    any idea ?

    Thanks

    Luciano Mittmann

     
    • Douphi

      Douphi - 2007-01-26

      you can look here
      http://article.gmane.org/gmane.comp.db.postgresql.pljava/1062

      Personnaly I use jre/sdk debian/testing package i386 ( no gcj )

      The libjvm.so is in
      /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/jre/lib/i386/client/libjvm.so
      /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/jre/lib/i386/server/libjvm.so

      but the makefile try to find it on i486 directory..
      Just add a symbolic link
      ln -s /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/jre/lib/i486 /usr/lib/jvm/java-1.5.0-sun-1.5.0.10/jre/lib/i386

      be sure too have JAVA_HOME declared to compile pljava
      #echo $JAVA_HOME
      /usr/lib/jvm/java-1.5.0-sun

      and LD_LIBRARY_PATH like this
      # echo $LD_LIBRARY_PATH
      /usr/lib/jvm/java-1.5.0-sun/jre/lib/i386:/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/client:/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/native_threads:

      # cat /etc/ld.so.conf
      /usr/X11R6/lib
      include /etc/ld.so.conf.d/*.conf

      # cat /etc/ld.so.conf.d/i486-linux-gnu.conf
      # Multiarch support
      /lib/i486-linux-gnu
      /usr/lib/i486-linux-gnu
      /usr/lib/jvm/java-1.5.0-sun/jre/lib/i386
      /usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/client
      /usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/native_threads
      /tmp/pgforest/PostgresForest-4.0/build/pl/org.postgresql.pljava/build/objs/

      then when you build pljava look JRE_LIB variable:

      at the end you must see this

      cc -g -Wall -O2 -fPIC -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -g -fpic  -shared -Wl,-soname,pljava.so  type/Date.o type/Byte.o type/Coerce.o type/TupleDesc.o type/Any.o type/Portal.o type/Oid.o type/UDT.o type/Array.o type/Long.o type/ErrorData.o type/Time.o type/Type.o type/Void.o type/byte_array.o type/Boolean.o type/HeapTupleHeader.o type/Integer.o type/String.o type/Short.o type/Relation.o type/Timestamp.o type/LargeObject.o type/Float.o type/JavaWrapper.o type/TriggerData.o type/Double.o type/Composite.o type/BigDecimal.o type/AclId.o type/Tuple.o type/TupleTable.o Iterator.o HashMap.o SubXactListener.o SPI.o ExecutionPlan.o SQLOutputToChunk.o SQLInputFromChunk.o Function.o backports.o Backend.o Invocation.o PgSavepoint.o Exception.o XactListener.o JNICalls.o SQLOutputToTuple.o PgObject.o SQLInputFromTuple.o Session.o  -L/usr/lib  -L. -L"/usr/lib/jvm/java-1.5.0-sun/jre/lib/i486/client" -ljvm -o pljava.so
      -----------------------------------------^

      ldd show you if pljava is well linked :

      ldd ./build/objs/pljava.so
              linux-gate.so.1 =>  (0xfbffd000)
              libjvm.so => /usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/client/libjvm.so (0xb7789000)
              libc.so.6 => /lib/tls/libc.so.6 (0xb7651000)
              libm.so.6 => /lib/tls/libm.so.6 (0xb762c000)
              libdl.so.2 => /lib/tls/libdl.so.2 (0xb7628000)
              libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7616000)
              /lib/ld-linux.so.2 (0x80000000)

      Good luke

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.