Thread: Java UnsatisfiedLinkError exception when connecting to Postgresqldatabase
Hello; I've written a Java program which uses Postgresql via JDBC. The program works fine on all RedHat systems I've tested exceptone, where it yields an UnsatisifiedLinkError. Here is the stack trace: sun.misc.VM.latestUserDefinedLoader0(Native Method) sun.misc.VM.latestUserDefinedLoader(VM.java:411) java.io.ObjectInputStream.latestUserDefinedLoader(ObjectInputStream.java:2351) java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:686) java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1866) java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1749) java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2040) java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571) java.io.ObjectInputStream.readObject(ObjectInputStream.java:431) org.postgresql.ds.common.BaseDataSource.readBaseObject(BaseDataSource.java:1210) org.postgresql.ds.common.BaseDataSource.initializeFrom(BaseDataSource.java:1220) org.postgresql.ds.PGPoolingDataSource.initialize(PGPoolingDataSource.java:267) org.postgresql.ds.PGPoolingDataSource.getConnection(PGPoolingDataSource.java:324) Any ideas? Thanks in advance.
Re: Java UnsatisfiedLinkError exception when connecting to Postgresqldatabase
From
Adrian Klaver
Date:
On 11/14/18 10:24 AM, dclark@cinci.rr.com wrote: Please reply to list also. Ccing list. > > ---- Adrian Klaver <adrian.klaver@aklaver.com> wrote: >> On 11/14/18 9:25 AM, dclark@cinci.rr.com wrote: >>> Hello; >>> >>> I've written a Java program which uses Postgresql via JDBC. The program works fine on all RedHat systems I've testedexcept one, where it yields an UnsatisifiedLinkError. Here is the stack trace: >>> >>> sun.misc.VM.latestUserDefinedLoader0(Native >>> Method) >>> sun.misc.VM.latestUserDefinedLoader(VM.java:411) >>> java.io.ObjectInputStream.latestUserDefinedLoader(ObjectInputStream.java:2351) >>> java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:686) >>> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1866) >>> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1749) >>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2040) >>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571) >>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:431) >>> org.postgresql.ds.common.BaseDataSource.readBaseObject(BaseDataSource.java:1210) >>> org.postgresql.ds.common.BaseDataSource.initializeFrom(BaseDataSource.java:1220) >>> org.postgresql.ds.PGPoolingDataSource.initialize(PGPoolingDataSource.java:267) >>> org.postgresql.ds.PGPoolingDataSource.getConnection(PGPoolingDataSource.java:324) >>> >>> Any ideas? >> >> What is different about the system that throws the error? >> >> For example: >> >> OS version >> JDBC version >> Postgres version >> Java version > > Thank you for your reply. > > OS on working system: Linux 3.10.0-693.11.6.el7.x86_64 x86_64 > OS on problem system: Linux 3.10.0-693.21.1.el7.x86_64 x86_64 > > JDBC version on both systems: 9.4.1209 > > Postgres version on both systems: 9.6.5 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11),64-bit > > Java version on both systems: > > openjdk version "1.8.0_171" > OpenJDK Runtime Environment (build 1.8.0_171-b10) > OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode) > Hmm. So what was the UnsatisifiedLinkError message, before the traceback above? -- Adrian Klaver adrian.klaver@aklaver.com
---- Adrian Klaver <adrian.klaver@aklaver.com> wrote: > On 11/14/18 10:24 AM, dclark@cinci.rr.com wrote: > Please reply to list also. > Ccing list. > > > > ---- Adrian Klaver <adrian.klaver@aklaver.com> wrote: > >> On 11/14/18 9:25 AM, dclark@cinci.rr.com wrote: > >>> Hello; > >>> > >>> I've written a Java program which uses Postgresql via JDBC. The program works fine on all RedHat systems I've testedexcept one, where it yields an UnsatisifiedLinkError. Here is the stack trace: > >>> > >>> sun.misc.VM.latestUserDefinedLoader0(Native > >>> Method) > >>> sun.misc.VM.latestUserDefinedLoader(VM.java:411) > >>> java.io.ObjectInputStream.latestUserDefinedLoader(ObjectInputStream.java:2351) > >>> java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:686) > >>> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1866) > >>> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1749) > >>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2040) > >>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571) > >>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:431) > >>> org.postgresql.ds.common.BaseDataSource.readBaseObject(BaseDataSource.java:1210) > >>> org.postgresql.ds.common.BaseDataSource.initializeFrom(BaseDataSource.java:1220) > >>> org.postgresql.ds.PGPoolingDataSource.initialize(PGPoolingDataSource.java:267) > >>> org.postgresql.ds.PGPoolingDataSource.getConnection(PGPoolingDataSource.java:324) > >>> > >>> Any ideas? > >> > >> What is different about the system that throws the error? > >> > >> For example: > >> > >> OS version > >> JDBC version > >> Postgres version > >> Java version > > > > Thank you for your reply. > > > > OS on working system: Linux 3.10.0-693.11.6.el7.x86_64 x86_64 > > OS on problem system: Linux 3.10.0-693.21.1.el7.x86_64 x86_64 > > > > JDBC version on both systems: 9.4.1209 > > > > Postgres version on both systems: 9.6.5 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11),64-bit > > > > Java version on both systems: > > > > openjdk version "1.8.0_171" > > OpenJDK Runtime Environment (build 1.8.0_171-b10) > > OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode) > > > > Hmm. > So what was the UnsatisifiedLinkError message, before the traceback above? java.lang.UnsatisfiedLinkError: sun.misc.VM.latestUserDefinedLoader0()Ljava/lang/ClassLoader; Thank you.
Re: Java UnsatisfiedLinkError exception when connecting to Postgresqldatabase
From
Rob Sargent
Date:
On 11/14/18 5:03 PM, dclark@cinci.rr.com wrote: > ---- Adrian Klaver <adrian.klaver@aklaver.com> wrote: >> On 11/14/18 10:24 AM, dclark@cinci.rr.com wrote: >> Please reply to list also. >> Ccing list. >>> ---- Adrian Klaver <adrian.klaver@aklaver.com> wrote: >>>> On 11/14/18 9:25 AM, dclark@cinci.rr.com wrote: >>>>> Hello; >>>>> >>>>> I've written a Java program which uses Postgresql via JDBC. The program works fine on all RedHat systems I've testedexcept one, where it yields an UnsatisifiedLinkError. Here is the stack trace: >>>>> >>>>> sun.misc.VM.latestUserDefinedLoader0(Native >>>>> Method) >>>>> sun.misc.VM.latestUserDefinedLoader(VM.java:411) >>>>> java.io.ObjectInputStream.latestUserDefinedLoader(ObjectInputStream.java:2351) >>>>> java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:686) >>>>> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1866) >>>>> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1749) >>>>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2040) >>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571) >>>>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:431) >>>>> org.postgresql.ds.common.BaseDataSource.readBaseObject(BaseDataSource.java:1210) >>>>> org.postgresql.ds.common.BaseDataSource.initializeFrom(BaseDataSource.java:1220) >>>>> org.postgresql.ds.PGPoolingDataSource.initialize(PGPoolingDataSource.java:267) >>>>> org.postgresql.ds.PGPoolingDataSource.getConnection(PGPoolingDataSource.java:324) >>>>> >>>>> Any ideas? >>>> What is different about the system that throws the error? >>>> >>>> For example: >>>> >>>> OS version >>>> JDBC version >>>> Postgres version >>>> Java version >>> Thank you for your reply. >>> >>> OS on working system: Linux 3.10.0-693.11.6.el7.x86_64 x86_64 >>> OS on problem system: Linux 3.10.0-693.21.1.el7.x86_64 x86_64 >>> >>> JDBC version on both systems: 9.4.1209 >>> >>> Postgres version on both systems: 9.6.5 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11),64-bit >>> >>> Java version on both systems: >>> >>> openjdk version "1.8.0_171" >>> OpenJDK Runtime Environment (build 1.8.0_171-b10) >>> OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode) >>> >> Hmm. >> So what was the UnsatisifiedLinkError message, before the traceback above? > java.lang.UnsatisfiedLinkError: sun.misc.VM.latestUserDefinedLoader0()Ljava/lang/ClassLoader; > > Thank you. > > Should OpenJDK be looking for a sun class?
---- Rob Sargent <robjsargent@gmail.com> wrote: > > On 11/14/18 5:03 PM, dclark@cinci.rr.com wrote: > > ---- Adrian Klaver <adrian.klaver@aklaver.com> wrote: > >> On 11/14/18 10:24 AM, dclark@cinci.rr.com wrote: > >> Please reply to list also. > >> Ccing list. > >>> ---- Adrian Klaver <adrian.klaver@aklaver.com> wrote: > >>>> On 11/14/18 9:25 AM, dclark@cinci.rr.com wrote: > >>>>> Hello; > >>>>> > >>>>> I've written a Java program which uses Postgresql via JDBC. The program works fine on all RedHat systems I've testedexcept one, where it yields an UnsatisifiedLinkError. Here is the stack trace: > >>>>> > >>>>> sun.misc.VM.latestUserDefinedLoader0(Native > >>>>> Method) > >>>>> sun.misc.VM.latestUserDefinedLoader(VM.java:411) > >>>>> java.io.ObjectInputStream.latestUserDefinedLoader(ObjectInputStream.java:2351) > >>>>> java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:686) > >>>>> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1866) > >>>>> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1749) > >>>>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2040) > >>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571) > >>>>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:431) > >>>>> org.postgresql.ds.common.BaseDataSource.readBaseObject(BaseDataSource.java:1210) > >>>>> org.postgresql.ds.common.BaseDataSource.initializeFrom(BaseDataSource.java:1220) > >>>>> org.postgresql.ds.PGPoolingDataSource.initialize(PGPoolingDataSource.java:267) > >>>>> org.postgresql.ds.PGPoolingDataSource.getConnection(PGPoolingDataSource.java:324) > >>>>> > >>>>> Any ideas? > >>>> What is different about the system that throws the error? > >>>> > >>>> For example: > >>>> > >>>> OS version > >>>> JDBC version > >>>> Postgres version > >>>> Java version > >>> Thank you for your reply. > >>> > >>> OS on working system: Linux 3.10.0-693.11.6.el7.x86_64 x86_64 > >>> OS on problem system: Linux 3.10.0-693.21.1.el7.x86_64 x86_64 > >>> > >>> JDBC version on both systems: 9.4.1209 > >>> > >>> Postgres version on both systems: 9.6.5 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11),64-bit > >>> > >>> Java version on both systems: > >>> > >>> openjdk version "1.8.0_171" > >>> OpenJDK Runtime Environment (build 1.8.0_171-b10) > >>> OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode) > >>> > >> Hmm. > >> So what was the UnsatisifiedLinkError message, before the traceback above? > > java.lang.UnsatisfiedLinkError: sun.misc.VM.latestUserDefinedLoader0()Ljava/lang/ClassLoader; > > > > Thank you. > > > > > Should OpenJDK be looking for a sun class? Ah ha, that's it. Part of the deployment on the problem system was outdated. Thanks to all.