11 Replies Latest reply on Nov 12, 2008 9:16 AM by kukeltje

    jBPM 3.2.1 jbpm-console with a different database

    msandoz

      i started off trying to customize JBoss AS to use jbpm but after a lot of unsuccessful fiddling, i decided to minimize the variables in the installation and use the installation included in the jbpm-jpdl-3.2.1 bundle. the only change i wanted to make was to change the database.

      I've read the many wiki entries on switching databases with jbpm. i populated the database using the dbCreate class and that seemed to work fine using the sesamestreet.xml.

      i'm running

      run.bat -c jbpm
      from the server/bin directory in the installation.

      before i make my changes, users can log in using the included hypersonic database with the manager role etc. afterwards, all i get i security errors trying to even log in.

      here's my change set:

      1. deployed the postgres jdbc driver: postgresql-8.2-504.jdbc3.jar
      2. jbpm-ds: i modified as below:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <datasources>
       <local-tx-datasource>
       <jndi-name>JbpmDS</jndi-name>
       <connection-url>jdbc:postgresql://localhost:5432/jbpm</connection-url>
       <driver-class>org.postgresql.Driver</driver-class>
       <user-name>jbpm</user-name>
       <password>jbpm</password>
       <metadata>
       <type-mapping>PostgreSQL 8.1</type-mapping>
       </metadata>
       </local-tx-datasource>
      </datasources>
      



      3. the jbpm-console.war in the deploy directory i exploded, modified the hibernate.cfg.xml as follows:

      <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
      


      the hibernate file was already pointing to the right datasource - java:/JbpmDS so i didnt change it

      i then re-zipped it and redeployed it into the deploy directory.

      what i get when i try to log in is:

      Access to the specified resource (Access to the requested resource has been denied) has been forbidden. - a 403 error. and there are no exceptions in the server log.

        • 1. Re: jBPM 3.2.1 jbpm-console with a different database

          It looks like you're having a problem at the OS level. Most probably a file permission issue. What OS are you using?
          In case you're using Linux make sure you set the proper permission for your files

          • 2. Re: jBPM 3.2.1 jbpm-console with a different database
            msandoz

            ive had similar issues now on redhat, windows XP and Vista. i havent had any issues with permissions that ive been able to detect as yet.

            • 3. Re: jBPM 3.2.1 jbpm-console with a different database
              msandoz

              ive added extra logging to the web server configuration and am seeing this:

              19:13:44,272 INFO [[localhost]] ---------------------------------------------------------------
              19:13:44,273 INFO [[localhost]] authType=FORM
              19:13:44,274 INFO [[localhost]] contentLength=-1
              19:13:44,275 INFO [[localhost]] contentType=text/html;charset=utf-8
              19:13:44,276 INFO [[localhost]] header=Pragma=No-cache
              19:13:44,276 INFO [[localhost]] header=Cache-Control=no-cache
              19:13:44,277 INFO [[localhost]] header=Expires=Wed, 31 Dec 1969 19:00:00 EST
              19:13:44,278 INFO [[localhost]] message=Access to the requested resource has been denied
              19:13:44,279 INFO [[localhost]] remoteUser=ernie
              19:13:44,279 INFO [[localhost]] status=403
              19:13:44,280 INFO [[localhost]] ===============================================================




              • 4. Re: jBPM 3.2.1 jbpm-console with a different database
                kukeltje

                Is ernie in the correct group?

                • 5. Re: jBPM 3.2.1 jbpm-console with a different database
                  msandoz

                  you know - i'm not sure. i created ernie with the sesamestreet.xml so i hope thats correct - is that no longer valid?

                  • 6. Re: jBPM 3.2.1 jbpm-console with a different database
                    msandoz

                    ronald you're a genius. thanks.

                    is this a change thats ready to be put into a wiki entry? or is it already in one? i've looked but i do miss things...obviously :)

                    heres the right set of data as lifted from the data directory:

                    INSERT INTO JBPM_ID_GROUP VALUES(1,'G','sales','organisation',NULL);
                    INSERT INTO JBPM_ID_GROUP VALUES(2,'G','admin','security-role',NULL);
                    INSERT INTO JBPM_ID_GROUP VALUES(3,'G','user','security-role',NULL);
                    INSERT INTO JBPM_ID_GROUP VALUES(4,'G','hr','organisation',NULL);
                    INSERT INTO JBPM_ID_GROUP VALUES(5,'G','manager','security-role',NULL);
                    INSERT INTO JBPM_ID_USER VALUES(1,'U','user','user@sample.domain','user');
                    INSERT INTO JBPM_ID_USER VALUES(2,'U','manager','manager@sample.domain','manager');
                    INSERT INTO JBPM_ID_USER VALUES(3,'U','admin','admin@sample.domain','admin');
                    INSERT INTO JBPM_ID_USER VALUES(4,'U','shipper','shipper@sample.domain','shipper');
                    INSERT INTO JBPM_ID_MEMBERSHIP VALUES(1,'M',NULL,NULL,2,4);
                    INSERT INTO JBPM_ID_MEMBERSHIP VALUES(2,'M',NULL,NULL,3,4);
                    INSERT INTO JBPM_ID_MEMBERSHIP VALUES(3,'M',NULL,NULL,4,4);
                    INSERT INTO JBPM_ID_MEMBERSHIP VALUES(4,'M',NULL,NULL,4,3);
                    INSERT INTO JBPM_ID_MEMBERSHIP VALUES(5,'M',NULL,NULL,1,3);
                    INSERT INTO JBPM_ID_MEMBERSHIP VALUES(6,'M',NULL,NULL,2,3);
                    INSERT INTO JBPM_ID_MEMBERSHIP VALUES(7,'M',NULL,NULL,3,3);
                    INSERT INTO JBPM_ID_MEMBERSHIP VALUES(8,'M',NULL,NULL,3,2);
                    INSERT INTO JBPM_ID_MEMBERSHIP VALUES(9,'M',NULL,NULL,2,2);
                    INSERT INTO JBPM_ID_MEMBERSHIP VALUES(10,'M',NULL,NULL,2,5);
                    INSERT INTO JBPM_ID_MEMBERSHIP VALUES(11,'M',NULL,'boss',2,1);
                    INSERT INTO JBPM_ID_MEMBERSHIP VALUES(12,'M',NULL,NULL,1,1);
                    


                    • 7. Re: jBPM 3.2.1 jbpm-console with a different database
                      kukeltje

                      it is somewhere (afaik) but that part (how to run on appserver x with db y etc) should be restructured.

                      Appserver x should be separate
                      DB y should be separate

                      the combination should include very limited additional info (maybe it should even be in the Appserver x part)

                      This 'identitity stuff' should also be put somewhere generic

                      • 8. Re: jBPM 3.2.1 jbpm-console with a different database
                        msandoz

                        i know when i was doing a quick demo earlier that it was very helpful to have the tomcat how-to available but i think that area could use some structure. perhaps this is another topic though.

                        a general customization wiki area could be structured something like -

                        \jbpmVersion
                        -\appServer
                        --\version
                        -\database
                        --\version
                        



                        • 9. Re: jBPM 3.2.1 jbpm-console with a different database
                          kukeltje

                          Yep, something like that, although I'd keep it to the 3.x releases, the 3.2 and 3.2.1 and 3.2.2 should not get a separate version page

                          • 10. Re: jBPM 3.2.1 jbpm-console with a different database
                            dubikid

                            I'm having similar issues. Infact, I migrated jBPM to Tomcat and I'm also using a postgreSQL db

                            • 11. Re: jBPM 3.2.1 jbpm-console with a different database
                              kukeltje

                              similar or identical? In the latter case, the solution is to populate the database correctly. In the former, it is a new issue and requires a new topic.