atris / JDBC_FDW

FDW that wraps JDBC for PostgreSQL.It can be used to connect and fetch data from any data source that supports JDBC
Other
66 stars 38 forks source link

Error JDBCUtilsClass is NULL #9

Closed theRealZing closed 10 years ago

theRealZing commented 11 years ago

linux 64 (centOS) , postgres 9.2.1. Followed instructions in README - all went fine with no error messages up to the point of selecting data from the newly created foreign table. Server log and psql both show: "ERROR: JDBCUtilsClass is NULL". Any idea what is wrong?

theRealZing commented 11 years ago

I retried with postgres 9.2.4 - clean install. I get the same error. Looks like a possible class path issue?

atris commented 11 years ago

Did you follow https://github.com/atris/JDBC_FDW/wiki/Installation-instructions for setting up your system?

theRealZing commented 11 years ago

Yes. I've gone through it three times to make sure I didn't miss anything.

On Tue, Jun 25, 2013 at 10:31 PM, Atri Sharma notifications@github.comwrote:

Did you follow https://github.com/atris/JDBC_FDW/wiki/Installation-instructions for setting up your system?

— Reply to this email directly or view it on GitHubhttps://github.com/atris/JDBC_FDW/issues/9#issuecomment-20027920 .

theRealZing commented 11 years ago

Could you explain which class path exists for JNI when (*env)->FindClass(env,"JDBCUtils") gets called? Could this value be added to the elog error getting called to provide a hint as to why JDBCUtils.class isn't being found?

theRealZing commented 11 years ago

If I run 'locate JDBCUtils.class' then I get:

/opt/lib/postgresql/JDBCUtils.class

Which is what I'd expect for my installation.

CLASSPATH is set to /opt/lib/postgresql

atris commented 11 years ago

What is your PGK_LIBDIR set to?

On Wed, Jun 26, 2013 at 10:32 PM, theRealZing notifications@github.comwrote:

If I run 'locate JDBCUtils.class' then I get:

/opt/lib/postgresql/JDBCUtils.class

Which is what I'd expect for my installation.

CLASSPATH is set to /opt/lib/postgresql

— Reply to this email directly or view it on GitHubhttps://github.com/atris/JDBC_FDW/issues/9#issuecomment-20063473 .

Regards,

Atri l'apprenant

atris commented 11 years ago

i.e. pg_config --pkglibdir

what does it say?

On Wed, Jun 26, 2013 at 10:33 PM, Atri Sharma atri.jiit@gmail.com wrote:

What is your PGK_LIBDIR set to?

On Wed, Jun 26, 2013 at 10:32 PM, theRealZing notifications@github.comwrote:

If I run 'locate JDBCUtils.class' then I get:

/opt/lib/postgresql/JDBCUtils.class

Which is what I'd expect for my installation.

CLASSPATH is set to /opt/lib/postgresql

— Reply to this email directly or view it on GitHubhttps://github.com/atris/JDBC_FDW/issues/9#issuecomment-20063473 .

Regards,

Atri l'apprenant

Regards,

Atri l'apprenant

theRealZing commented 11 years ago

/opt/lib/postgresql

atris commented 11 years ago

then it works fine, since pkglibdir is where JDBC_FDW looks for the required classes. Check your permissions and all.

atris commented 11 years ago

Oops,accidentally closed it

theRealZing commented 11 years ago

The permissions all look OK.

theRealZing commented 11 years ago

Atri - would you consider participating in a live session via web and phone to help me debug this? Do you have a paypal account?

Regards,

Blair

On Wed, Jun 26, 2013 at 11:02 PM, Atri Sharma notifications@github.comwrote:

Oops,accidentally closed it

— Reply to this email directly or view it on GitHubhttps://github.com/atris/JDBC_FDW/issues/9#issuecomment-20098882 .

atris commented 11 years ago

I dont think I do. But we can debug this over chat.

On Tue, Jul 2, 2013 at 6:57 PM, theRealZing notifications@github.comwrote:

Atri - would you consider participating in a live session via web and phone to help me debug this? Do you have a paypal account?

Regards,

Blair

On Wed, Jun 26, 2013 at 11:02 PM, Atri Sharma notifications@github.comwrote:

Oops,accidentally closed it

— Reply to this email directly or view it on GitHub< https://github.com/atris/JDBC_FDW/issues/9#issuecomment-20098882> .

— Reply to this email directly or view it on GitHubhttps://github.com/atris/JDBC_FDW/issues/9#issuecomment-20345222 .

Regards,

Atri l'apprenant

theRealZing commented 11 years ago

I've gotten this to work on 32-bit linux using the same setup I tried on 64-bit linux. Installation the same other than platform specific things like the symbolic link to libjvm.so.

Still can't get it to work on 64-bit linux.

I'll try 64-bit windows next.

On Tue, Jul 2, 2013 at 6:49 AM, Atri Sharma notifications@github.comwrote:

I dont think I do. But we can debug this over chat.

On Tue, Jul 2, 2013 at 6:57 PM, theRealZing notifications@github.comwrote:

Atri - would you consider participating in a live session via web and phone to help me debug this? Do you have a paypal account?

Regards,

Blair

On Wed, Jun 26, 2013 at 11:02 PM, Atri Sharma notifications@github.comwrote:

Oops,accidentally closed it

— Reply to this email directly or view it on GitHub< https://github.com/atris/JDBC_FDW/issues/9#issuecomment-20098882> .

— Reply to this email directly or view it on GitHub< https://github.com/atris/JDBC_FDW/issues/9#issuecomment-20345222> .

Regards,

Atri l'apprenant

Reply to this email directly or view it on GitHubhttps://github.com/atris/JDBC_FDW/issues/9#issuecomment-20346263 .

yuva670 commented 11 years ago

So, did we find any fix for this issue? We are running into the exact thing.

atris commented 11 years ago

You have issues with 64 bit?

On Tue, Jul 9, 2013 at 10:48 PM, yuva670 notifications@github.com wrote:

So, did we find any fix for this issue? We are running into the exact thing.

— Reply to this email directly or view it on GitHubhttps://github.com/atris/JDBC_FDW/issues/9#issuecomment-20690238 .

Regards,

Atri l'apprenant

yuva670 commented 11 years ago

Yes, we have set up a 64 bit environment.

Sent from my iPhone

On 09-Jul-2013, at 10:49 PM, Atri Sharma notifications@github.com wrote:

You have issues with 64 bit?

On Tue, Jul 9, 2013 at 10:48 PM, yuva670 notifications@github.com wrote:

So, did we find any fix for this issue? We are running into the exact thing.

— Reply to this email directly or view it on GitHubhttps://github.com/atris/JDBC_FDW/issues/9#issuecomment-20690238 .

Regards,

Atri l'apprenant — Reply to this email directly or view it on GitHub.

atris commented 11 years ago

That needs to be investigated.

On Tue, Jul 9, 2013 at 10:53 PM, yuva670 notifications@github.com wrote:

Yes, we have set up a 64 bit environment.

Sent from my iPhone

On 09-Jul-2013, at 10:49 PM, Atri Sharma notifications@github.com wrote:

You have issues with 64 bit?

On Tue, Jul 9, 2013 at 10:48 PM, yuva670 notifications@github.com wrote:

So, did we find any fix for this issue? We are running into the exact thing.

— Reply to this email directly or view it on GitHub< https://github.com/atris/JDBC_FDW/issues/9#issuecomment-20690238> .

Regards,

Atri l'apprenant — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/atris/JDBC_FDW/issues/9#issuecomment-20690578 .

Regards,

Atri l'apprenant

simon10 commented 10 years ago

Atri - I am seeing exactly the same issue on Linux 64 bit.

mydb=# select * from orajtest; ERROR: JDBCUtilsClass is NULL

atris commented 10 years ago

I think the issue is with loading libjvm.so in 64 bit systems. It may be related to this:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7152237

On Thu, Jul 18, 2013 at 7:51 AM, simon10 notifications@github.com wrote:

Atri - I am seeing exactly the same issue on Linux 64 bit.

mydb=# select * from orajtest; ERROR: JDBCUtilsClass is NULL

— Reply to this email directly or view it on GitHubhttps://github.com/atris/JDBC_FDW/issues/9#issuecomment-21158733 .

Regards,

Atri l'apprenant

simon10 commented 10 years ago

Thank you Atri, after setting my LD_LIBRARY_PATH to include "/usr/java/jdk1.7.0_03/jre/lib/amd64/server" it worked.

Before I had it pointing to "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server".

theRealZing commented 10 years ago

Thanks for this info - I'll test this after August 1 and post the results.

On Thu, Jul 18, 2013 at 4:19 PM, simon10 notifications@github.com wrote:

Thank you Atri, after setting my LD_LIBRARY_PATH to include "/usr/java/jdk1.7.0_03/jre/lib/amd64/server" it worked.

Before I had it pointing to "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server".

— Reply to this email directly or view it on GitHubhttps://github.com/atris/JDBC_FDW/issues/9#issuecomment-21222022 .

atris commented 10 years ago

Thanks for using and testing it.Also, thanks for reporting the bug.

Sent from my iPad

On 21-Jul-2013, at 21:54, theRealZing notifications@github.com wrote:

Thanks for this info - I'll test this after August 1 and post the results.

On Thu, Jul 18, 2013 at 4:19 PM, simon10 notifications@github.com wrote:

Thank you Atri, after setting my LD_LIBRARY_PATH to include "/usr/java/jdk1.7.0_03/jre/lib/amd64/server" it worked.

Before I had it pointing to "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server".

— Reply to this email directly or view it on GitHubhttps://github.com/atris/JDBC_FDW/issues/9#issuecomment-21222022 .

— Reply to this email directly or view it on GitHub.

atris commented 10 years ago

I think we have figured out the problem on 64 bit architectures? I am closing the bug, and if any new problem is detected, please feel free to reopen it or open a new bug.

ravikadam commented 10 years ago

I am still facing this issue with 32 bit architecture. But Postgres 9.3. Not sure if this is fixed for 9.3

Update : This problem got solved by linking libjvm.so from Jdk7 instead of jdk6. Thanks :)

jekor commented 7 years ago

For anyone else facing this issue: note that the extension takes the value of pkglibdir at compile time, not at runtime. This creates problems for systems like NixOS where the pkglibdir is handed to PostgreSQL via systemd because it is not known at compile time.

zhihuiFan commented 3 years ago

For anyone else facing this issue: note that the extension takes the value of pkglibdir at compile time, not at runtime. This creates problems for systems like NixOS where the pkglibdir is handed to PostgreSQL via systemd because it is not known at compile time.

I would suggest people read the above comments clearly, I think that should be the root cause for many case. If you don't know what value is used at compile time, try strings jdbc_fdw.so | grep PKG_LIB_DIR

math-g commented 1 year ago

In my case, I resolved this error simply by setting correct permissions for user postgres on PGK_LIBDIR/JDBCDriverLoader.class and PGK_LIBDIR/JDBCUtils.class. Only root had read permissions on them after make install.