1 2 Previous Next 16 Replies Latest reply on May 5, 2003 6:07 AM by jonlee

    DB2 and Jboss 3.0.6

    bpeeters

      Hi,

      I put the db2java.zip de jboss/server/default/lib/ , so the driver is then normally in the classpath. When I want to deploy an ear file, I got this exception. "no db2jdbc in java.library.path" I also deployed the db2-service.xml in the deploy directory. Can anybody help me?

      Caused by: org.jboss.util.NestedSQLException: Failed to register driver for: COM.ibm.db2.jdbc.app.DB2Driver; - nested throwable: (java.sql.SQLException: java.lang.UnsatisfiedLinkError: no db2jdbc in java.library.path); - nested throwable: (org.jboss.resource.ResourceException: Failed to register driver for: COM.ibm.db2.jdbc.app.DB2Driver; - nested throwable: (java.sql.SQLException: java.lang.UnsatisfiedLinkError: no db2jdbc in java.library.path))
      at org.jboss.resource.adapter.jdbc.local.LocalDataSource.getConnection(LocalDataSource.java:106)
      at org.jboss.ejb.plugins.cmp.jdbc.SQLUtil.fixTableName(SQLUtil.java:38)

        • 1. Re: DB2 and Jboss 3.0.6
          drake_avatar

          I'm having the same problem.

          I think the driver zip has to be put in $JBOSS_HOME/lib to be loaded by jboss though, but that doesn't solve the problem either.

          • 2. Re: DB2 and Jboss 3.0.6
            drake_avatar

            I've solved the problem by including the drivers in my JAR file.

            Hope this helps

            • 3. Re: DB2 and Jboss 3.0.6
              davidjencks

              Does this driver require native libraries?

              • 4. Re: DB2 and Jboss 3.0.6
                drake_avatar

                Yes, it's a Type 2 JDBC driver.
                I didn't realise it made a difference ?

                • 5. Re: DB2 and Jboss 3.0.6
                  jboss1604

                  hi guys
                  pls calrify how to add 'Oracle driver ' to my jar file?.
                  i am using JBuilder 7.0 for creating .jar file/deploying .ear file for JBoss3.0.4

                  with regrads
                  -----JBoss1604-----

                  • 6. Re: DB2 and Jboss 3.0.6
                    davidjencks

                    The error message "no db2jdbc in java.library.path" looks to me as if the java part of the driver can't find the native code part. Personally I have had little success in hot-deploying native code: I have always ended up putting the native code in (as I recall) LD_LIBRARY_PATH. Maybe there are specific installation instructions that modify the environment so the java code can find the native code???

                    • 7. Re: DB2 and Jboss 3.0.6
                      askesis

                      You must rename the zip file to a jar file: see http://www.gogis.nl/en/public_documentation/jboss/index.html for more instructions on creating the db2 datasource.

                      Joost Kraaijeveld

                      • 8. Re: DB2 and Jboss 3.0.6
                        pstrotmann

                        Hi Folks
                        I put al classes
                        COM/ibm/db2/jdbc/***
                        in my jar-file, but still
                        no db2jdbc in java.library.path
                        how do I include native libraries and which do I include?

                        • 9. Re: DB2 and Jboss 3.0.6
                          jonlee

                          If you are using DB2 UDB (either 7.2 or 8.x), I would recommend the pure Java driver (type 4). The driver declaration is:
                          COM.ibm.db2.jdbc.net.DB2Driver

                          Also note that we've found some slight variations during testing at the IBM labs so you should use the driver pack that comes with your DB2. For example, we were using the Linux package driver to connect to an AIX installation and the application fell apart because you couldn't get anything across the connection. Using the driver that came with AIX fixed things.

                          • 10. Re: DB2 and Jboss 3.0.6
                            pstrotmann

                            Hi

                            trying class 4 driver COM.ibm.db2.jdbc.net.DB2Driver, I get the following error message:

                            Error while fixing table name; - nested throwable: (org.jboss.util.NestedSQLException: Apparently wrong driver class specified for URL: class: COM.ibm.db2.jdbc.net.DB2Driver, url: jdbc:db2:jboss://192.168.0.2:50000; - nested throwable: (javax.resource.ResourceException: Apparently wrong driver class specified for URL: class: COM.ibm.db2.jdbc.net.DB2Driver, url: jdbc:db2:jboss://192.168.0.2:50000))]

                            Is there something wrong with my URL ?, DB2 is running on a different Computer in my Lan(192.168.0.2),
                            registering the jboss database with aquastudio from 192.168.0.1 works fine.

                            with regards

                            peter strotmann
                            Dortmund, Germany

                            • 11. Re: DB2 and Jboss 3.0.6
                              jonlee

                              I assume you are using DB2 7.2 UDB or higher.

                              The standard format of the DB2 URL is:
                              jdbc:db2://172.16.1.2:6789/AMITY

                              Port 6789 is the default Java listener for DB2 but you should change this to the appropriate port for your installation. 172.16.1.2 is the IP address for the machine housing the DB2 instance and you should change this to be appropriate for your circumstances. AMITY is the name of the database instance to which you are connecting.

                              The listener process for DB2 is db2jd and you should be able to see this. You need to explicitly start this process. You start this with the db2 instance sqllib/java12/db2jstrt command. You should use the db2java.zip driver package located in the sqllib/java12 directory for your JBoss driver. Please check your DB2 documentation regarding all of this as this is more of a DB2 UDB configuration issue than a JBoss issue.

                              • 12. Re: DB2 and Jboss 3.0.6
                                jonlee

                                I assume you are using DB2 7.2 UDB or higher.

                                The standard format of the DB2 URL is:
                                jdbc:db2://172.16.1.2:6789/AMITY

                                Port 6789 is the default Java listener for DB2 but you should change this to the appropriate port for your installation. 172.16.1.2 is the IP address for the machine housing the DB2 instance and you should change this to be appropriate for your circumstances. AMITY is the name of the database instance to which you are connecting.

                                The listener process for DB2 is db2jd and you should be able to see this. You need to explicitly start this process. You start this with the db2 instance sqllib/java12/db2jstrt command. You should use the db2java.zip driver package located in the sqllib/java12 directory for your JBoss driver. Please check your DB2 documentation regarding all of this as this is more of a DB2 UDB configuration issue than a JBoss issue.

                                • 13. Re: DB2 and Jboss 3.0.6
                                  jonlee

                                  I assume you are using DB2 7.2 UDB or higher.

                                  The standard format of the DB2 URL is:
                                  jdbc:db2://172.16.1.2:6789/AMITY

                                  Port 6789 is the default Java listener for DB2 but you should change this to the appropriate port for your installation. 172.16.1.2 is the IP address for the machine housing the DB2 instance and you should change this to be appropriate for your circumstances. AMITY is the name of the database instance to which you are connecting.

                                  The listener process for DB2 is db2jd and you should be able to see this. You need to explicitly start this process. You start this with the db2 instance sqllib/java12/db2jstrt command. You should use the db2java.zip driver package located in the sqllib/java12 directory for your JBoss driver. Please check your DB2 documentation regarding all of this as this is more of a DB2 UDB configuration issue than a JBoss issue.

                                  • 14. Re: DB2 and Jboss 3.0.6
                                    jonlee

                                    My apologies for the multiple posts - something is screwy with the forum as it didn't show the posts in the page update after posting.

                                    1 2 Previous Next