4 Replies Latest reply on Jun 19, 2006 5:22 AM by Frank Heerlein

    Problems with JBoss POrtal and DB2

    Frank Heerlein Newbie

      Hey ...

      I am working with JBoss Portal 2.2.1 and DB2 8.1 ... now I followed the install instructions, copied the connection XML to default/deploy and changed important informations ...

      here is my portal-db2-ds.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <!-- ===================================================================== -->
      <!-- -->
      <!-- JBoss Server Configuration -->
      <!-- -->
      <!-- ===================================================================== -->
      
      <!-- $Id: db2-ds.xml,v 1.3 2004/09/15 14:37:40 loubyansky Exp $ -->
      
      
      <datasources>
       <local-tx-datasource>
       <jndi-name>DB2DS</jndi-name>
       <connection-url>jdbc:db2:PORTALDB</connection-url>
       <driver-class>COM.ibm.db2.jdbc.app.DB2Driver</driver-class>
       <user-name>db2admin</user-name>
       <password>db2admin</password>
       <min-pool-size>0</min-pool-size>
       <!-- sql to call when connection is created
       <new-connection-sql>some arbitrary sql</new-connection-sql>
       -->
      
       <!-- sql to call on an existing pooled connection when it is obtained from pool
       <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
       -->
      
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
       <metadata>
       <type-mapping>DB2</type-mapping>
       </metadata>
       </local-tx-datasource>
      
      </datasources>


      I know it would be better not to use db2admin, but for testing its okey ...
      But the cnnection doesn't work ... why ? I dont know what the error message is, but staring JBoss AS doesn't dreate any tables ...
      Is there any step-by-step tutorial for DB2 as database ?

      Thanks a lot ... Frank ...

        • 1. Re: Problems with JBoss POrtal and DB2
          Joachim Schmidt Newbie

          hallo,

          your <connection-url> has been set up incorrectly! It should be:

          "<connection-url>jdbc:db2://ip-addr:port/PORTALDB</connection-url> "

          Port should be 50000 (you can check with netstat).

          Additionally you will have you to code DB Dialect settings for the portal core - see User's Guide chapter 3.3. (DB-Dialect is "DB2Dialect"). I'm
          using userid "db2inst1" which has DBADM. But you could use any other user which has DBADM on your database. ("grant dbadm on database to youruserid").

          I'm currently using DB2 with Portal 2.2.1 - so far I've not seen any Problems.

          • 2. Re: Problems with JBoss POrtal and DB2
            Frank Heerlein Newbie

            Hey ...

            So first thanks for ya help, but it still doesn't work ...

            I am getting the following error:


            ObjectName: portal:service=CMS
             State: FAILED
             Reason: org.apache.jackrabbit.core.config.ConfigurationException: File system
            initialization failure.: failed to initialize file system: Could not find dataso
            urce: failed to initialize file system: Could not find datasource
             I Depend On:
             jboss.jca:service=DataSourceBinding,name=DB2DS
             portal:service=JAASLoginModule
             Depends On Me:
             portal:mapper=CMSObject


            I found a HOWTO at http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0504vohra/index.html but that also does not work ...

            So here is what I did:

            (1) I deployed JBoss AS and JBoss Portal in a bundle, found this on JBoss.org
            (2) I copied db2-ds.xml to server/deploy and changed the stuff I told before and the stuff u told me ...
            (3) I creaeted the table referenced in db2-ds.xml
            (4) I tried connecting to the database --> worked properly...

            So do you have any additional tips for me ? what did I do wrong ?

            Thanks once again ... Frank ...

            • 3. Re: Problems with JBoss POrtal and DB2
              Joachim Schmidt Newbie

              hey,

              you should have a datasource "portal-db-ds.xml" which defines a datasource "PortalDS" (or you could change your db2-ds.xml accordingly):

              <?xml version="1.0" encoding="UTF-8"?>
              
              <!-- ===================================================================== -->
              <!-- -->
              <!-- JBoss Server Configuration -->
              <!-- -->
              <!-- ===================================================================== -->
              <!-- $Id: portal-db2-ds.xml,v 1.0 2006/06/15 14:37:40 jschmi@t-online.de $ -->
              <datasources>
              
               <local-tx-datasource>
               <jndi-name>PortalDS</jndi-name>
               <connection-url>jdbc:db2://localhost:50000/portalDB</connection-url>
               <driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>
               <user-name>db2inst1</user-name>
               <password>geheimpw</password>
               <min-pool-size>5</min-pool-size>
               <metadata>
               <type-mapping>DB2</type-mapping>
               </metadata>
               </local-tx-datasource>
              </datasources>




              • 4. Re: Problems with JBoss POrtal and DB2
                Frank Heerlein Newbie

                Hey jschmi ...

                Thanks a lot to you, my database connection is working properly now ...
                Actually that is what i am thinkin ... when I start Jboss AS tables are created ... But still, my changes are not saved ... can you help me with this problem, too ???

                explainations:

                When I start JBoss Portal, there are some sample portlets, that I don't wanne keep in my portal ... So I manage portals by the management portlet ... but when I stop/start the server afterwards all deleted pages ("test" page) are shown again !!! when I delete simple portlets from a page, these are deleted after restart, too ... but deleted pages are not deleted after restart ...

                what might be my fault ? I thought, changes are saved in the database ???

                Thanks for ya help ... Frank ...