-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: z/OS and WAS6: Failure in loading T2 native library db2jcct2
PostPosted: Thu Jan 18, 2007 12:15 pm 
Newbie

Joined: Fri Jan 12, 2007 1:00 pm
Posts: 2
Hi everybody.

We have an Application running on a WebSphere Application Server 6.0.2.15. We use Hibernate Version 3.1.3 with IBM DB2 v7.1. Everything is running under z/OS Version 7.

Since the database is running on the same machine, we want to use the IBM DB2 JDBC Universal Driver using JDBC Level 2. For Level 2, the JDBC Driver requires native libraries, which are installed in the correct path in the file system (see below). In the WebSphere administrative console, I have configured the following:

WebSphere Variables:

DB2390_JDBC_DRIVER_PATH: /usr/lpp/db2/db2710
DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH: ${DB2390_JDBC_DRIVER_PATH}/jcc/lib/
DB2UNIVERSAL_JDBC_DRIVER_PATH: ${DB2390_JDBC_DRIVER_PATH}/jcc/classes/

JDBC providers > DB2 Universal JDBC Driver Provider - Settings

Class path:
${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar
${UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cu.jar
${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cisuz.jar

Native library path:
${DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH}

However, the application does not seem to find the native libraries. When connecting to the database, we get the following exception:


Caused by: com.ibm.db2.jcc.b.SqlException: Failure in loading T2 native library db2jcct2
at com.ibm.db2.jcc.t2.a.a(a.java:31)
at com.ibm.db2.jcc.t2.T2Configuration.<clinit>(T2Configuration.java:74)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:178)
at java.sql.DriverManager.getConnection(DriverManager.java:559)
at java.sql.DriverManager.getConnection(DriverManager.java:158)
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)


We cannot use a WebSphere Datasource to connect to the database, because it does not work with DB2 v7 on z/OS. So we connect "manually":

Code:
<hibernate-configuration>
   <session-factory>
      <property name="dialect">org.hibernate.dialect.DB2390Dialect</property>
      <property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
      <property name="hibernate.connection.url">jdbc:db2:DATABASENAME</property>
      <property name="hibernate.connection.username">USERID</property>
      <property name="hibernate.connection.password">PASSWORD</property>
      <property name="hibernate.default_schema">QUALIFIER</property>
      ...


It seems Hibernate does not know about the native library path specified in the JDBC Driver Provider. Does Hibernate even know about the JDBC provider? How can I tell Hibernate where to find the native libraries?

Any help is appreciated! Sorry for the long post ;-)

Greets,
René


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 18, 2007 12:57 pm 
Beginner
Beginner

Joined: Tue May 23, 2006 4:10 pm
Posts: 38
Location: Charleston, SC
It's not a hibernate issue. I would suggest reviewing the following chapter on JNI:

http://java.sun.com/docs/books/jni/html ... .html#6814

You could also try adding the property below to the java command line that starts your server:

-Djava.library.path=...

Grant


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 19, 2007 5:55 am 
Newbie

Joined: Fri Jan 12, 2007 1:00 pm
Posts: 2
Thanx alot ukchucktown, that helped!

I got it to work by setting a custom JVM property in the Servant Region of the WAS:

Name: java.library.path
Value: /usr/lpp/db2/db2710/jcc/lib


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.