|
BTW: As far as I can tell Jaybird itself does not depend on libstdc++6 (according to the ldd output), so it might be a dependency of Java.
After some further investigating, it seems that the problem is with libjaybird. ldd -r shows that this symbol (and some others) are undefined:
mark@ubuntu-x64:~/development/jaybird/client-java/native$ ldd -r libjaybird22_x64.so linux-vdso.so.1 => (0x00007fffa9a00000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb4f6548000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb4f6330000) /lib64/ld-linux-x86-64.so.2 (0x00007fb4f6b20000) undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE (./libjaybird22_x64.so) undefined symbol: __gxx_personality_v0 (./libjaybird22_x64.so) undefined symbol: _ZTISt9bad_alloc (./libjaybird22_x64.so) undefined symbol: dlopen (./libjaybird22_x64.so) undefined symbol: _ZdlPv (./libjaybird22_x64.so) undefined symbol: _Znam (./libjaybird22_x64.so) undefined symbol: __cxa_end_catch (./libjaybird22_x64.so) undefined symbol: __cxa_allocate_exception (./libjaybird22_x64.so) undefined symbol: dlclose (./libjaybird22_x64.so) undefined symbol: _ZdaPv (./libjaybird22_x64.so) undefined symbol: __cxa_begin_catch (./libjaybird22_x64.so) undefined symbol: __cxa_throw (./libjaybird22_x64.so) undefined symbol: dlsym (./libjaybird22_x64.so) undefined symbol: _Znwm (./libjaybird22_x64.so) undefined symbol: __cxa_free_exception (./libjaybird22_x64.so) Could you check if the attached version of the library solves the problem for you?
Attached libjaybird22_x64.so was compiled by including <syslibset libs="stdc++,dl"/> into the gcc linker definition in build_native.xml (apparently the already included <linkerarg value="-ldl"/> and <linkerarg value="-lstdc++"/> are ignored).
The ldd output is now good: mark@ubuntu-x64:~/development/jaybird/client-java$ ldd -r ./output/native/libjaybird22_x64.so linux-vdso.so.1 => (0x00007fff92b90000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcba09e8000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fcba06e0000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fcba04d8000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fcba02c0000) /lib64/ld-linux-x86-64.so.2 (0x00007fcba0fc0000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fcba0038000) I tried the attached library and the UnsatisfiedLinkError is gone, nevertheless there is another error popping up which also ends in the native library, I have both libfbembed.so + libfbclient.so (both ver. 2.5.1) in my library path.
Exception: org.firebirdsql.gds.impl.jni.InternalError: FirebirdApiBinding::Initialize - Could not find or load the firebird client library. at org.firebirdsql.gds.impl.jni.JniGDSImpl.nativeInitilize(Native Method) at org.firebirdsql.gds.impl.jni.JniGDSImpl.attemptToLoadAClientLibraryFromList(JniGDSImpl.java:92) at org.firebirdsql.gds.impl.jni.EmbeddedGDSImpl.<init>(EmbeddedGDSImpl.java:31) at org.firebirdsql.gds.impl.jni.EmbeddedGDSImpl.<init>(EmbeddedGDSImpl.java:21) at org.firebirdsql.gds.impl.jni.EmbeddedGDSFactoryPlugin.getGDS(EmbeddedGDSFactoryPlugin.java:40) at org.firebirdsql.gds.impl.GDSFactory.getGDSForType(GDSFactory.java:220) at org.firebirdsql.jca.FBManagedConnectionFactory.getGDS(FBManagedConnectionFactory.java:114) at org.firebirdsql.jdbc.AbstractDriver.connect(AbstractDriver.java:124) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:185) at FBConnect.main(FBConnect.java:23) org.firebirdsql.gds.impl.jni.InternalError: FirebirdApiBinding::Initialize - Could not find or load the firebird client library. at org.firebirdsql.gds.impl.jni.JniGDSImpl.nativeInitilize(Native Method) at org.firebirdsql.gds.impl.jni.JniGDSImpl.attemptToLoadAClientLibraryFromList(JniGDSImpl.java:92) at org.firebirdsql.gds.impl.jni.EmbeddedGDSImpl.<init>(EmbeddedGDSImpl.java:31) at org.firebirdsql.gds.impl.jni.EmbeddedGDSImpl.<init>(EmbeddedGDSImpl.java:21) at org.firebirdsql.gds.impl.jni.EmbeddedGDSFactoryPlugin.getGDS(EmbeddedGDSFactoryPlugin.java:40) at org.firebirdsql.gds.impl.GDSFactory.getGDSForType(GDSFactory.java:220) at org.firebirdsql.jca.FBManagedConnectionFactory.getGDS(FBManagedConnectionFactory.java:114) at org.firebirdsql.jdbc.AbstractDriver.connect(AbstractDriver.java:124) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:185) at FBConnect.main(FBConnect.java:23) java.lang.RuntimeException: Failed to initialize Jaybird native library. This is most likely due to a failure to load the firebird client library. at org.firebirdsql.gds.impl.jni.JniGDSImpl.attemptToLoadAClientLibraryFromList(JniGDSImpl.java:105) at org.firebirdsql.gds.impl.jni.EmbeddedGDSImpl.<init>(EmbeddedGDSImpl.java:31) at org.firebirdsql.gds.impl.jni.EmbeddedGDSImpl.<init>(EmbeddedGDSImpl.java:21) at org.firebirdsql.gds.impl.jni.EmbeddedGDSFactoryPlugin.getGDS(EmbeddedGDSFactoryPlugin.java:40) at org.firebirdsql.gds.impl.GDSFactory.getGDSForType(GDSFactory.java:220) at org.firebirdsql.jca.FBManagedConnectionFactory.getGDS(FBManagedConnectionFactory.java:114) at org.firebirdsql.jdbc.AbstractDriver.connect(AbstractDriver.java:124) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:185) at FBConnect.main(FBConnect.java:23) Typical debugging problem :( Solve one problem and another pops up. I will investigate further.
I tried this under Ubuntu 12.04 As far as I can see under Ubuntu 12.04, the libfbembed2.5 package does not create a /usr/lib/libfbembed.so or /usr/lib/x86_64-linux-gnu/libfbembed.so symlink to /usr/lib/x86_64-linux-gnu/libfbembed.so.2.5.1. After adding this symlink manually the library is found.
BTW: I didn't get the original undefined symbol error with the original libjaybird22_x64.so under Ubuntu 12.04. Which Java version do you have installed? I installed openjdk-6-jdk; maybe the errors depend on the exact java version. I have following java version installed:
Java VM Version: java version "1.6.0_30" Java(TM) SE Runtime Environment (build 1.6.0_30-b12) Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode) Just to add some more information, I used following libraries: http://sourceforge.net/projects/firebird/files/firebird-linux-amd64/2.5.1-Release/FirebirdCS-2.5.1.26351-0.amd64.tar.gz/download edit: corrected libary link That download is for the Windows 64 Firebird Embedded, which is not going to work under Ubuntu ;)
Could you please check which libfbembed.so files are available on your computer. Most likely you are missing the libfbembed.so symlink itself (that was the problem on my ubuntu 12.04 VM). I would also like to know which Ubuntu package you installed for Java, as your version info differs from the openjdk-6-jdk I installed using apt-get and that package reports: java version "1.6.0_24" OpenJDK Runtime Environment (IcedTea6 1.11.3) (6b24-1.11.3-1ubuntu0.12.04.1) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode) sorry pasted the wrong link, of course the windows version will not work under ubuntu ;)
here is the correct link: http://sourceforge.net/projects/firebird/files/firebird-linux-amd64/2.5.1-Release/FirebirdCS-2.5.1.26351-0.amd64.tar.gz/download as for the java installation, I downloaded it from oracle: http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u30-oth-JPR I expected that you would have used the packages from the Ubuntu 12.04 repository itself. I am not sure if I have time to dive deeper into it this week, and I am on holiday from next Saturday. For the embedded library loading be sure to check that the library (or its symlink) is called libfbembed.so, and that it is in the actual library path (either specified in java.library.path, or ld.so.conf or in LD_LIBRARY_PATH).
With the Firebird embedded library from the Ubuntu repository I had the same(?) problem as it did not have a libfbembed.so library (just a so.2.5 and so.2.5.1). I've the same problem in 32 bit system: libjaybird22.so: undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE
ldd -r shows that this symbol (and some others) are undefined. Is there a build that fixes this problem also for 32 bit system? uts@uts-desktop:/usr/lib/i686$ ldd -r /home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) undefined symbol: __gxx_personality_v0 (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) undefined symbol: _ZTISt9bad_alloc (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) undefined symbol: dlopen (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) undefined symbol: _ZdlPv (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) undefined symbol: __cxa_end_catch (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) undefined symbol: __cxa_allocate_exception (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) undefined symbol: dlclose (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) undefined symbol: _Znwj (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) undefined symbol: _ZdaPv (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) undefined symbol: _Znaj (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) undefined symbol: __cxa_begin_catch (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) undefined symbol: __cxa_throw (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) undefined symbol: dlsym (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) undefined symbol: __cxa_free_exception (/home/uts/NetBeansProjects/ladon/lib/win/32/libjaybird22.so) linux-gate.so.1 => (0xb8047000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7ebb000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7eac000) /lib/ld-linux.so.2 (0xb8048000) My system is: Ubuntu 8.10 kernel 2.6.27-11-generic java version "1.6.0_24" Java(TM) SE Runtime Environment (build 1.6.0_24-b07) Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing) Currently the only solution would be that you compile the natives on your own, including the fix to the build_native.xml which Mark mentioned earlier ...
I will upload a new version of the 32 bit library later today.
Attached correctly linked 32 bit libjaybird22.so
This issue needs to be linked to Version Jaybird 2.2.1 when it is created
Committed fixed build file to trunk and Branch_2_2
I've set library path to FirebirdCS-2.5.1.26351-0.amd64/buildroot/opt/firebird/lib/libfbclient.so or /opt/firebird/lib (after installing it) or /usr/lib64 but I always have "Could not find or load the firebird client library"
If I statically load library through System.loadlibrary() I've no error. System.loadLibrary("icudata"); System.loadLibrary("icuuc"); System.loadLibrary("icui18n"); System.loadLibrary("ib_util"); System.loadLibrary("fbembed"); System.loadLibrary("fbclient"); What could be wrong? My system properties: Jaybird 2.2 Java 1.7.0_06 64 bit OS: Ubuntu 12.04 64 bit Runtime error: org.firebirdsql.gds.impl.jni.InternalError: FirebirdApiBinding::Initialize - Could not find or load the firebird client library. at org.firebirdsql.gds.impl.jni.JniGDSImpl.nativeInitilize(Native Method) at org.firebirdsql.gds.impl.jni.JniGDSImpl.attemptToLoadAClientLibraryFromList(JniGDSImpl.java:92) at org.firebirdsql.gds.impl.jni.EmbeddedGDSImpl.<init>(EmbeddedGDSImpl.java:31) at org.firebirdsql.gds.impl.jni.EmbeddedGDSImpl.<init>(EmbeddedGDSImpl.java:21) at org.firebirdsql.gds.impl.jni.EmbeddedGDSFactoryPlugin.getGDS(EmbeddedGDSFactoryPlugin.java:40) at org.firebirdsql.gds.impl.GDSFactory.getGDSForType(GDSFactory.java:220) at org.firebirdsql.jdbc.FBConnectionProperties.getGds(FBConnectionProperties.java:502) at org.firebirdsql.jdbc.FBConnectionProperties.getDatabaseParameterBuffer(FBConnectionProperties.java:393) at org.firebirdsql.jca.FBManagedConnectionFactory.getDatabaseParameterBuffer(FBManagedConnectionFactory.java:205) at org.firebirdsql.jca.FBManagedConnectionFactory.getDefaultConnectionRequestInfo(FBManagedConnectionFactory.java:407) at org.firebirdsql.pool.AbstractFBConnectionPoolDataSource.allocateConnection(AbstractFBConnectionPoolDataSource.java:265) at org.firebirdsql.pool.PooledConnectionQueue.addConnection(PooledConnectionQueue.java:491) at org.firebirdsql.pool.PooledConnectionQueue.start(PooledConnectionQueue.java:155) at org.firebirdsql.pool.AbstractConnectionPool.getQueue(AbstractConnectionPool.java:205) at org.firebirdsql.pool.AbstractFBConnectionPoolDataSource.getPooledConnection(AbstractFBConnectionPoolDataSource.java:372) at org.firebirdsql.pool.FBWrappingDataSource.getConnection(FBWrappingDataSource.java:219) at com.tecnosens.ladon.dbInterface.DbConnection.connectEmbeddedDS(DbConnection.java:213) |
|||||||||||||||||||||||||||||||||||||||||||||||||||
Check if you have libstdc++.so.6 on your machine using
find /usr/ -name libstdc++.so.6
If not, then you should be able to install it using:
apt-get install libstdc++6