Subject fbembed.dll loading issues
Author Jose M. Rus
Hi,

I can't package my application with the embedded server without making
absolute directory assumptions. It seems that fbembed.dll has to be in the
main application directory or its location hard coded in firebird.conf. I'm
using Firebird 1.5 and JayBird 2.1.0 in a windows machine.

What I try to do is place the application jar files and Firebird files in
separate directories from the application base dir. My desired structure is
like this:

APP_DIR\ (application base dir)
lib\ (java dependencies are here)
jaybird-full-2.1.0.jar
data\database (firebird root directory)
app.fdb (application database)
fbembed.dll
firebird.conf
firebird.msg
gds32.dll (I think this is optional, removing it has no
effect)
ib_util.dll
jaybird21.dll
msvcp60.dll
msvcrt.dll
intl\
fbintl.dll
udf\ (all udf files)

In my test scenario the application is launched from APP_DIR, the FIREBIRD
environment variable points to the "APP_DIR\data\database" (as a generated
absolute directory from %CD%\data\database), windows PATH variable points to
FIREBIRD directory (from the enviroment variable) and java.library.path also
points to the FIREBIRD directory.

This works fine when "RootDirectory" from firebird.conf points to
"APP_DIR\data\database" in absolute form, but when RootDirectory is not
defined then fbembed.dll is not found. The only workaround I've found is
placing fbembed.dll directly in APP_DIR (and I'm not sure if the firebird
directory is then considered to be in APP_DIR or in
"APP_DIR\data\database").

Any hint is very greatly appreciated.

The exception I get when fbembed.dll is not placed in the application base
dir is:

java.lang.RuntimeException: Failed to initilize Jaybird native library. This
is most likley due to a failure to load the firebird client library.
at
org.firebirdsql.gds.impl.jni.JniGDSImpl.attemptToLoadAClientLibraryFromList(
JniGDSImpl.java:97)
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
:219)
at org.firebirdsql.jca.FBManagedConnectionFactory.getGDS(
FBManagedConnectionFactory.java:110)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:125)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at
org.hibernate.connection.DriverManagerConnectionProvider.getConnection(
DriverManagerConnectionProvider.java:110)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java
:72)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java
:1881)
at org.hibernate.cfg.Configuration.buildSessionFactory(
Configuration.java:1174)
at com.psleuropa.paco.hibernate.MultipleSessionFactory.addSessionFactory
(MultipleSessionFactory.java:51)
at com.psleuropa.paco.PacoGlobals.registerSessionFactories(
PacoGlobals.java:159)
at com.psleuropa.paco.Main.initHibernate(Main.java:169)
at com.psleuropa.paco.Main.start(Main.java:72)
... 6 more

Regards


[Non-text portions of this message have been removed]