1 2 Previous Next 24 Replies Latest reply on Oct 1, 2009 10:55 PM by Patrick Baltz

    jbpm 4.1 installation problems on jboss 4.2.3

    Sridhar Alapati Newbie

      Did anyone successfully install jbpm 4.1 on jboss 4.2.3?
      If so, could you shed some light on the issues I'm having during the install.

      I get JbpmDS not bound errors. But I have that datasource defined in jbpm-hsqldb-ds.xml in the jboss/server/default/deploy/jbpm directory. I tried to put the ds xml file one directory above (in the deploy directory) but that didn't help either. Below is the stack trace. Any help would be appreciated.

      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:46)
      at org.jbpm.pvm.internal.jobexecutor.DispatcherThread.acquireJobs(DispatcherThread.java:126)
      at org.jbpm.pvm.internal.jobexecutor.DispatcherThread.run(DispatcherThread.java:67)
      Caused by: org.hibernate.HibernateException: Could not find datasource
      at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56)
      at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
      at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
      at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:414)
      at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
      at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
      at org.jbpm.pvm.internal.wire.descriptor.HibernateSessionFactoryDescriptor.construct(HibernateSessionFactoryDescriptor.java:64)
      at org.jbpm.pvm.internal.wire.WireContext.construct(WireContext.java:473)
      at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:452)
      at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:441)
      at org.jbpm.pvm.internal.wire.WireContext.get(WireContext.java:421)
      ... 32 more
      Caused by: javax.naming.NameNotFoundException: JbpmDS not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)

        • 1. Re: jbpm 4.1 installation problems on jboss 4.2.3
          Ronald van Kuijk Master

          is the ds deployed at all? Can you check via the AS console?

          • 2. Re: jbpm 4.1 installation problems on jboss 4.2.3
            Sridhar Alapati Newbie

            Yes. I'm able to see JbpmDs from the jmx-console.

            • 3. Re: jbpm 4.1 installation problems on jboss 4.2.3
              Ronald van Kuijk Master

              with or without the java: prefix? And what about the name in the config file? Does that contain the prefix or not?

              • 4. Re: jbpm 4.1 installation problems on jboss 4.2.3
                Cavaco Silva Newbie

                I have the same problem, the JbpmDS is deployed and started as I can see in jmx-console. I also am installing jbpm4.1 on jboss 4.2.3, any ideas?

                Thanks,
                Sergio

                • 5. Re: jbpm 4.1 installation problems on jboss 4.2.3
                  Sridhar Alapati Newbie

                  It's java:JbpmDS both in the console and the ds config file.

                  • 6. Re: jbpm 4.1 installation problems on jboss 4.2.3
                    Cavaco Silva Newbie

                     

                    "sridhar18" wrote:
                    It's java:JbpmDS both in the console and the ds config file.


                    By ds config you mean the jbpm-*-ds.xml? One should set <jndi-name> to java:JbpmDS? It guives the error :

                    Could not create deployment: file:/C:/jboss/jboss-4.2.3.GA/server/default/deploy/jbpm/jbpm-hsqldb-ds.xml
                    org.jboss.deployment.DeploymentException: Invalid character ':' in value part of property

                    When I deploy it with the <jndi-name> as JbpmDS, in the jmx-console the bindname appears like java:JbpmDS, but the hibernate does not find the datasource java:JbpmDS specified in the hibernate.connection.datasource property.
                    Can you clarify what you wrote please?

                    BRegards,
                    Sergio

                    • 7. Re: jbpm 4.1 installation problems on jboss 4.2.3
                      Sridhar Alapati Newbie

                      Yes. In the jbpm-*-ds.xml I have it as JbpmDS so jboss prefixes it with java: when it tries to load it.

                      • 8. Re: jbpm 4.1 installation problems on jboss 4.2.3
                        Cavaco Silva Newbie

                        And you have the hibernate.connection.datasource = java:JbpmDS ?

                        • 10. Re: jbpm 4.1 installation problems on jboss 4.2.3
                          Cavaco Silva Newbie

                          The error was coming from a workaround that I was using, related to jbpm-service.beans, after removing this the datasource was correctly binded. Nevertheless now I have an authentication error:

                          Failed to load users/passwords/role files
                          java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found
                           at org.jboss.security.auth.spi.Util.loadProperties(Util.java:315)


                          I have changed the jbpm policy in login-config.xml to the correct query:

                          SELECT g.NAME_ ,'Roles'
                          FROM JBPM4_ID_USER u,JBPM4_ID_MEMBERSHIP m, JBPM4_ID_GROUP g
                          WHERE g.TYPE_='security-role' AND m.GROUP_ = g.DBID_ AND m.USER_ = u.DBID_ AND u.ID_=?
                          


                          Anyone knows what is missing? Do I have to create a users.properties?

                          Thanks,
                          Sergio


                          • 11. Re: jbpm 4.1 installation problems on jboss 4.2.3
                            Cavaco Silva Newbie

                            Found the error, the policy name was changed apparently, so login-conf.xml should be according to:

                            <application-policy name = "jbpm-console">
                             <authentication>
                             <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
                             flag="required">
                             <module-option name="dsJndiName">java:/JbpmDS</module-option>
                             <module-option name="principalsQuery">
                             SELECT PASSWORD_ FROM JBPM4_ID_USER WHERE ID_=?
                             </module-option>
                             <module-option name="rolesQuery">
                             SELECT g.NAME_ ,'Roles'
                             FROM JBPM4_ID_USER u,
                             JBPM4_ID_MEMBERSHIP m,
                             JBPM4_ID_GROUP g
                             WHERE g.TYPE_='security-role'
                             AND m.GROUP_ = g.DBID_
                             AND m.USER_ = u.DBID_
                             AND u.ID_=?
                             </module-option>
                             </login-module>
                             </authentication>
                             </application-policy>


                            • 12. Re: jbpm 4.1 installation problems on jboss 4.2.3
                              Cavaco Silva Newbie

                              Well, the login-conf.xml may stay untouched because there is a dynamic login bean in the jboss-service.xml in the jbpm-service.sar, my problem is that it was missing from there so you may discard the login-conf change. The dynamic bean is like this:

                              <mbean code="org.jboss.security.auth.login.DynamicLoginConfig" name="org.jbpm:service=LoginConfig">
                              <attribute name="PolicyConfig" serialDataType="jbxb">
                               <jaas:policy xsi:schemaLocation="urn:jboss:security-config:4.1 resource:security-config_4_1.xsd" xmlns:jaas="urn:jboss:security-config:4.1"
                               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                               <jaas:application-policy name="jbpm-console">
                              ...


                              Regds,
                              Sergio

                              • 13. Re: jbpm 4.1 installation problems on jboss 4.2.3
                                Patrick Baltz Newbie

                                A little more background on this. I managed to get it working on 4.2.3.

                                I looked into the jBPM source code where the exception related to looking up JbpmDS was coming from, and it looks like jBPM only tries to lookup the datasource in JNDI once. On subsequent calls, it checks if an exception was thrown previously, and if one was thrown earlier, it won't even try to lookup the datasource.

                                The problem is caused by jBPM running as a service in the microcontainer which apparently gets started very early on in the JBoss boot process. The exception occurs, and jBPM is dead in the water way before JbpmDS gets bound by JBoss.

                                I did find a work-around though. You can modify the jBPM hibernate configuration to use JDBC directly to avoid this. Just change your jbpm.hibernate.cfg.xml to something like the following (which uses HSQL):

                                <?xml version="1.0" encoding="utf-8"?>
                                
                                <!DOCTYPE hibernate-configuration PUBLIC
                                 "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                                 "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
                                
                                <hibernate-configuration>
                                 <session-factory>
                                
                                 <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
                                 <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
                                 <property name="hibernate.connection.url">jdbc:hsqldb:hsql://opus.workpc.tds.net:1701</property>
                                 <property name="hibernate.connection.username">sa</property>
                                 <property name="hibernate.connection.password"></property>
                                 <property name="hibernate.format_sql">true</property>
                                
                                 <mapping resource="jbpm.repository.hbm.xml" />
                                 <mapping resource="jbpm.execution.hbm.xml" />
                                 <mapping resource="jbpm.history.hbm.xml" />
                                 <mapping resource="jbpm.task.hbm.xml" />
                                 <mapping resource="jbpm.identity.hbm.xml" />
                                
                                 </session-factory>
                                </hibernate-configuration>
                                


                                I think this should be okay for most people, since jBPM should be the only thing talking to that database directly. The other option I saw that looked like a possibility was bootstrapping the datasource into JNDI as a microcontainer bean which can be seen in other forum posts, but I haven't tried it myself.

                                • 14. Re: jbpm 4.1 installation problems on jboss 4.2.3
                                  Ronald van Kuijk Master

                                  I'm no jboss service /.sar specialist, but afaik, it should wait until the datasource is deployed.

                                  At least is does this for JBoss AS 5 in distro/src/main/files/install/src/jboss/config.jboss5/deploy/jbpm/jbpm-service.sar/jbpm-service-jboss-beans.xml

                                  for 4 in distro/src/main/files/install/src/jboss/config.jboss4/deploy/jbpm/jbpm-service.sar/jboss-beans.xml this seams missing. Can you try adding something similar in this file and see if it works then.

                                  1 2 Previous Next