[jboss-user] [JBoss jBPM] - Deploying jbpm-enterprise.ear from jbpm-jpdl-suite-3.2.Beta1

crussell42 do-not-reply at jboss.com
Thu Jan 18 13:35:07 EST 2007


Rather than using the "out of the box" jboss as delivered with jbpm 3.2.Beta1, I would like to deploy the ear delivered in the deploy directory to my jboss as with ejb3 and messaging enabled.
Has anyone had any experience with this?
I have had limited success and ultimately the jbpm-console seems to work but never actually logs me in just tells me the login failed.
Documentation on this subject seems very limited and fragmented.

The only hint I get when deploying the ear is that there may be some compatibility issue with JSF packaged with the jbpm-console and the default jboss as's.
Log Hint
13:00:14,334 ERROR [STDERR] Jan 17, 2007 1:00:14 PM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Sun's JavaServer Faces implementation (1.2_03-b09-FCS) for context 'null'
13:00:14,650 ERROR [STDERR] Jan 17, 2007 1:00:14 PM com.sun.faces.spi.InjectionProviderFactory createInstance
WARNING: JSF1033: Resource injection is DISABLED.

Otherwise everything seems to load fine.
Below are my notes on how to do this so far but am at an impasse and could really use some help. If I get all the steps put together correctly I would gladly contribute them "unless it turns out that I have been a total boob".

DEPLOYING JBPM TO AN EXISTING JBOSS SERVER
==========================================
Philosophy. I know that the starter kit includes a preconfigured jboss but that is not good enough.
We have to be able to deploy jbpm, drools, and jboss messaging for production servers (hell for development too).
The download site for jbpm has a "suite" 3.2.beta1 that it seems to be touting as the next great thing so 
I have used a combination of the starter kit and the suite to come to all the following conclusions.

Downloaded jbpm-jpdl-suite-3.2.Beta1.zip
unzip it. (call this unzipped dir $suite)
Under there there is a deploy directory that contains the jbpm ear we want to deploy.
$suite/deploy/jbpm-enterprise.ear
In there there is a jbpm-enterprise.ear which contains (in theory) a complete deployable ear
that includes jbpm, jbpm-identity, jbpm-console.

On deploying this beast however I ran into many issues.
There does not seem to be any good documentation on how to actually deploy this but here is what I learned from
watching the jboss logs.
I think I am close to getting this to work but the console app just wont let me log in.

JBPM REQUIRED MESSAGE QUEUE (JBOSS CONFIG CHANGE)
=================================================
1. When deployed logs showed need for a message queue. So I just added one identical to the one added for
the appentity.

/usr/local/jboss/server/messaging/deploy/jboss-messaging.sar/destinations-service.xml
<!--I ADDED THIS-->
   <mbean code="org.jboss.jms.server.destination.Queue"
      name="jboss.messaging.destination:service=Queue,name=JbpmCommandQueue"
      xmbean-dd="xmdesc/Queue-xmbean.xml">
      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
      
         
            
            
            
         
      
   
This cleared up that error.
Note that I had to create a queue named JbpmCommandQueue first.
Then I was able to go to http://localhost:8080/jbpm-console/
and the web service seemed to start ok. took me to a login screen.

I'm sure that within the ear we could put a jbpm-service.xml file with this queue definition 
but I knew it would work editing the default jboss one so I did that.


JBPM SECURITY DOMAIN (JBOSS CONFIG CHANGE)
==========================================
Now when I deploy I start seeing in the jboss log.
ERROR [UsersRolesLoginModule] Failed to load users/passwords/role files

After a lot of googleing I found a few hints here:
Describes the error with users.properties
http://www.magnolia.info/wiki/Wiki.jsp?page=MagnoliaJBossAndJAAS

ERROR [UsersRolesLoginModule] Failed to load users/passwords/role files

WHAT THIS TOLD ME was that the security domain that jbpm-console and jbpm-identity module uses
was not correct.

If you look at expand/jbpm-console-war/WEB-INF/jboss-web.xml it looks like this:
---------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>



<jboss-web>

  <security-domain>java:/jaas/other</security-domain>

</jboss-web>

---------------------------------------------
So the jbpm-console is using the security domain other.
Therefore we need for the security domain other config to look like that sent in the 
preconfigured jbpm starter kit server so I copied the following from the
starter kit/server/jbpm/conf/login-config.xml

Forced me to edit /usr/local/jboss/server/messaging/conf/login-config.xml
Changed the definition of the application-policy "other" to match that found
int the jbpm configured server.

    <application-policy name = "other">
       <!-- A simple server login module, which can be used when the number 
       of users is relatively small. It uses two properties files:
       users.properties, which holds users (key) and their password (value).
       roles.properties, which holds users (key) and a comma-separated list of
       their roles (value).
       The unauthenticatedIdentity property defines the name of the principal
       that will be used when a null username and password are presented as is
       the case for an unuathenticated web client or MDB. If you want to
       allow such users to be authenticated add the property, e.g.,
       unauthenticatedIdentity="nobody"
       -->

<!-- RUSSELL added this to match the jbpm server config given. Changed JbpmDS to DefaultDS so we can see stuff.-->
       
         <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
                       flag="required">
           <module-option name="dsJndiName">java:/DefaultDS</module-option>
           <module-option name="principalsQuery">
             SELECT PASSWORD_ FROM JBPM_ID_USER WHERE NAME_=?
           </module-option>
           <module-option name="rolesQuery">
             SELECT g.NAME_ ,'Roles' 
             FROM JBPM_ID_USER u,
                  JBPM_ID_MEMBERSHIP m,
                  JBPM_ID_GROUP g
             WHERE g.TYPE_='security-role'
               AND m.GROUP_ = g.ID_
               AND m.USER_ = u.ID_
               AND u.NAME_=?
           </module-option>
         </login-module>
       
    </application-policy>

<!-- RUSSELL remove for now.
       
          <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
             flag = "required" />
       
    </application-policy>
-->

This would seem to make sense and wa la, when we deploy now we dont see the 
error about user.properties as before.
Which leads us to the other bofongoo. Particularly the initial creation of all the jbpm tables
including the identity tables. Please see CREATING JBPM AND IDENTITY TABLES.


MAKE JBPM USE OUR STAND ALONE HSQLDB INSTEAD OF inmemory. (JBPM EAR CONFIG CHANGE)
===================================================================================
copy the jbpm-enterprise.ear to this directory.
ant expand
edit expand/lib/jbpm-configs-jar/hibernate.cfg.xml
    <!-- RUSSELL DID THIS -->
    <!--property name="hibernate.connection.datasource">java:/JbpmDS</property-->    
    java:/DefaultDS
    <!-- DataSource properties (end) -->

    <!-- RUSSELL UNCOMMENTED THIS logging properties (begin) === -->
    true
    true
    true
    <!-- ==== logging properties (end) -->
(Ultimately I hope we are just telling jbpm to use the DefaultDS here)
ant build
sudo ant deploy.


CREATING JBPM AND INDETITY TABLES IN OUR STAND ALONE HSQLDB
===========================================================
copied $dir/db/jbpm.jpdl.hsqldb.sql to /home/hsqldb
Then as hsqldb run the java -cp lib/hsqldb.jar org.hsqldb.util.DatabaseManagerSwing
And connected to Server mode localhost:1701 (Jboss's instance).
Then load and execute the script to get the schema loaded into jboss for jbpm.
All the tables are named JBPM_*.
Note I had to remove all the ALTER commands in the begining of the script since none of the tables initially exist.
Now I dont think the identity component schema is added though.

However, this script does not seem to include the identity tables.
So I mutated a copy of $starter-kit/jbpm-db/hsqldb/upgrade.scripts/hsqldb.create.jbpm.3.1.sql which does 
create them.
However, the identity component loaded with jbpm-enterprise.ear seems to be defaulting to 
text file based stuff. 

SO IN THE END I HAVE CREATED SOME SQL SCRIPTS THAT CAN BE RUN FROM 
SQUIRRELL because it would seem that the $suite does not include creates for identity and note
also that you need to config squirrell session properties to not abort on error.

# Create or remove the core jbpm tables, indexes, and constraints
# these were extracted from the ~/jbpm-jpdl-3.2.Beta1/db/jbpm.jpdl.hsqldb.sql
create-jbpm.sql
remove-jbpm.sql

# Create or remove the identity jbpm tables, indexes, and constraints
# This sql extracted from jbpm-starters-kit/jbpm-db/hsqldb/upgrade.scripts/hsqldb.create.jbpm.3.1.sql
create-identity.sql
remove-identity.sql

# Create the sample users for the jbpm-console app (bert, ernie, etc).
identity-users.sql

Chapter 8 of the users guide on DB crap says 

Making the default webapp talk to the correct datasource is again not very difficult. The first step in doing this is simply locate the 'jboss-service.xml' file in the folder '${JBPM_SDK_HOME}/jbpm-server/server/jbpm/deploy/jbpm.sar/META-INF'. Change the contents of this file with the contents of the listing below. An attentive reader will notice that the only difference is an exchange of the token 'DefaultDS' by 'JbpmDS'.
<?xml version="1.0" encoding="UTF-8"?>

  
    java:/jbpm/JbpmConfiguration
    jboss.jca:service=DataSourceBinding,name=DefaultDS
  


But hey, in the jbpm-enterprise.ear there does not seem to be such a beast. Not sure how to force this
or if they associate a jndi name with. However since we changed the jbpm-configs jar to use DefaultDS as above, 
I assume we are ok there.

I can post the sql scripts if that helps but I'm just not seeing any access to sql as though trying to log in is failing before any queries are issued.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4003457#4003457

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4003457



More information about the jboss-user mailing list