[jBPM] - Installing JBPM 5.3 on JBoss AS 5.1 and changing DB
by doboss
doboss [https://community.jboss.org/people/doboss] created the discussion
"Installing JBPM 5.3 on JBoss AS 5.1 and changing DB"
To view the discussion, visit: https://community.jboss.org/message/741521#741521
--------------------------------------------------------------
A few days ago I tried to get JBPM 5.3 installed into JBoss AS 5.1 using PostgreSQL via the jbpm-installer. I had some trouble, but after some customizations, I have been able to get it installed and running. Some of the information came right out of the documentation, some came from community posts, and some I figured out through tiral and error.
Hopefully this post will help others at least get to this point. :)
h2. My configuration:
Ubuntu 12.04
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu3)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
JBoss 5.1.0GA
PostgreSQL 9.1.4 on x86_64
h2. Preparation
h3. Get the installer:
The first thing I did was download the jbpm-installer and unzip it into ~/Downloads/jbpm-installer/ and this is the directory/path I will use for the rest of this post.
h3. Save some download time:
If you are like me, you probably already had a copy of the JBoss distribution sititng around, and rather than having the installation script download it again, I copied it into the installer's lib folder and made a soft link with the name the installer was expecting. (This step is not critical, just a way to save a bit of time.)
cd ~/Downloads/jbpm-installer/
cp ~/Downloads/jboss-5.1.0.GA.zip lib/
ln -s jboss-5.1.0.GA.zip jboss-as-5.1.0.GA.zip # This makes a link with a name of what the installer is expecting
h3. Prepare the JBoss installtion directory:
You will need to setup a JBoss installation folder for the installer to install into. For the rest of the post, I use "path-to-jboss" as this location.
cd /path-to-jboss/
unzip ~/Downloads/jbpm-installer/lib/jboss-5.1.0.GA.zip
h3. Copy DB drivers into installer:
If you are going to use a DB other than the default H2 db, you will need to place the drivers where the installer can find them.
cp ~/Downloads/postgresql-9.1-901.jdbc4.jar ~/Downloads/jbpm-installer/lib/
h2. Configuration
h3. Update build.properties:
Next you will need to edit ~/Downloads/jbpm-installer/build.properties
h4. Drools Guvnor version:
>From what I read and remember experiencing, the version of Drools Govnor which is setup to be used by the installer will not work with JBoss 5.1, and instead you should use 5.3.1.Final. So change the following properties in build.properties as follows:
# (Drools guvnor which works with JBoss AS 5.1)
drools.guvnor.version=5.3.1.Final
drools.guvnor.url=https://repository.jboss.org/nexus/content/repositories...
h4. Designer version:
Update to use the correct version of the designer for AS 5. I changed the URL to a specific server because it looked like the installer got stuck when redirecter, this may not be necessary.
designer.version=2.2.Final-jboss
#designer.url=http://sourceforge.net/projects/jbpm/files/designer/designer-2.2/
designer.url=http://iweb.dl.sourceforge.net/project/jbpm/designer/designe...
h4. JBoss Home and version:
Uncomment/update the jboss.xxxx properties:
jboss.server.version=${jboss.server.version.5}
jboss.home=<path-to-jboss>/jboss-5.1.0.GA
jboss.download.url=http://downloads.sourceforge.net/jboss/jboss-${jboss.s...
jboss.server.configuration=default
jboss.server.deploy.dir=${jboss.home}/server/${jboss.server.configuration}/deploy
jboss.server.data.dir=${jboss.home}/server/${jboss.server.configuration}/data/
jboss.clean.repository=true
h3. Update build.xml
Edit ~/Downloads/jbpm-installer/build.xml to reflect the correct DB driver:
Change <property name="db.driver.jar.name" value="mysql-connector-java.jar"/> to <property name="db.driver.jar.name" value="postgresql-9.1-901.jdbc4.jar"/>
h3. Database specific files:
There are several files which need to be updated for JBoss AS 5 as well as for your specific DB dialect and configurations.
h4. Edit db/persistence.xml:
First edit ~/Downloads/jbpm-installer/db/persistence.xml
h5. Change the dialect and set DB specific configurations:
I updated/added the follwing to the <properties> section:
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.default_schema" value="jbpm5"/>
h5. Use AS5 transaction manager:
You will need to comment out the AS7 section and comment in the AS5 section:
<!-- for AS7 -->
<!-- <property name="hibernate.transaction.manager_lookup_class" value="org.jbpm.integration.console.JBPMTransactionManager" /> -->
<!-- for AS5 -->
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
h5. Whole file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence version="1.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source>
<mapping-file>META-INF/JBPMorm.xml</mapping-file>
<mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<class>org.jbpm.process.audit.ProcessInstanceLog</class>
<class>org.jbpm.process.audit.NodeInstanceLog</class>
<class>org.jbpm.process.audit.VariableInstanceLog</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.default_schema" value="jbpm5"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<!-- hbm2ddl.auto MUST BE update! The console will otherwise overwrite the schema with each new thread -->
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="false" />
<!-- for AS7 -->
<!-- <property name="hibernate.transaction.manager_lookup_class" value="org.jbpm.integration.console.JBPMTransactionManager" /> -->
<!-- for AS5 -->
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
</properties>
</persistence-unit>
</persistence>
h4. Update db/persistence-as5.xml:
Most of my problems came from things related to the DB, and it was unclear to me which files were being used/ignored, so for simplicity, I just copied persistence.xml on top of persistence-as5.xml.
cp ~/Downloads/jbpm-installer/db/persistence.xml ~/Downloads/jbpm-installer/db/persistence-as5.xml
h4. Update task-service:
Somewhere in the documentation, I read that this file must be updated. Even though I updated it, I don't think it was used for the installation, and I had to manually copy the file into the deploy directory (covered later in the post.) But go ahead and edit it here, this way you have it somewhere outside of the JBoss install in case you need it again.
First edit ~/Downloads/jbpm-installer/task-service/resources/META-INF/persistence.xml
You will need to add the <jta-data-source> section as well as configure the <properties> section:
...
<persistence-unit name="org.jbpm.task">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
* <jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source>*
<mapping-file>META-INF/Taskorm.xml</mapping-file>
...
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.*PostgreSQLDialect*"/>
* <property name="hibernate.default_schema" value="jbpm5"/>*
* <property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>*
* <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />*
<property name="hibernate.connection.username" value="*some_username*"/>
<property name="hibernate.connection.password" value="*some_password*"/>
</properties>
...
h3. Update the datasource:
Update ~/Downloads/jbpm-installer/db/jBPM-ds.xml as needed. (Remember to change the driver)
<connection-url>jdbc:postgresql://some_host:5432/some_db_name</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>some_username</user-name>
<password>some_password</password>
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/741521#741521]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years
[JBoss Web Services] - <jaxws:client> configuration not picked up from jbossws-cxf.xml
by Steffen Krause
Steffen Krause [https://community.jboss.org/people/kimba74] created the discussion
"<jaxws:client> configuration not picked up from jbossws-cxf.xml"
To view the discussion, visit: https://community.jboss.org/message/740891#740891
--------------------------------------------------------------
Hi everyone,
I'm trying to access a 3rd-party Web Service from within my webapp. Unfortunately I have to add additional classes to the client's JAXContext for it to work. According to the CXF Users Manual and from discussions I had with Daniel Kulp from Apache it should be possible to add these additional classes by configuring the client for CXF as follows:
<jaxws:client name="{urn:name:space:of:service}PortName" createdFromAPI="true">
<jaxws:dataBinding>
<bean class="org.apache.cxf.jaxb.JAXBDataBinding">
<property name="ExtraClass">
<list>
<value>an.additional.binding.ObjectFactory</value>
<value>an.other.additional.binding.ObjectFactory</value>
</list>
</property>
</bean>
</jaxws:dataBinding>
</jaxws:client>
I've been experimenting with this now for three days and it doesn't work at all.
During my debugging work this weekend I logged out which beans get registered with the CXF Bus as the javax.xml.ws.Service gets created and the port gets retrieved. According to the smart guys from Apache CXF I should see a bean being created that has the name "{urn:name:space:of:service}PortName" but I don't. The only one that comes close is a bean called "{urn:name:space:of:service}PortName.jaxws-client.proxyFactory" which is of type "org.apache.cxf.jaxws.JaxWsProxyFactoryBean".
I'm also unable to add additional interceptors to the Web Service Client as described in the CXF Users Manual.
Is it possible that the jbossws-cxf.xml is only pulled in for Web Service Endpoint implementation but not for Web Service consumers?
Thanks,
Steffen
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/740891#740891]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years
[JBoss Web Services] - Re: Bizzare host re-write in JAX-WS client on JB7.0.2
by Alessio Soldano
Alessio Soldano [https://community.jboss.org/people/asoldano] created the discussion
"Re: Bizzare host re-write in JAX-WS client on JB7.0.2"
To view the discussion, visit: https://community.jboss.org/message/740473#740473
--------------------------------------------------------------
I believe your use case might be a bit different from the JBWS-3260 one as you basically have the jaxws client running inside a jaxws endpoint business method. You are probably ending up using the server side bus that's started at deploy time for dealing with the endpoint. Just before each invocation of your endpoint business methods, the engine saves a references to the thread bus and then restores it when your business method is over. Your client should no be using the AddressRewritingEndpointInfo; that is installed by the SoapTransportFactoryExt, which is only added to the server side bus instances. One option you have to properly isolate your client environment (bus) from your server one is wrapping your client code into a try-finally block to set a different thread default bus isntance (for client only):
Bus mybus = BusFactory.newInstance().createBus();
...
try {
Bus orig = BusFactory.getThreadDefaultBus();
BusFactory.setThreadDefaultBus(mybus);
... client usage ...
} finally {
BusFactory.setThreadDefaultBus(orig);
... evaluate shutting down mybus or storing it somewhere if you don't want to rebuild it...
}
I'll check if there's a better solution for dealing this scenario.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/740473#740473]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years
[jBPM] - jBPM 5.3 - Human Task Service and administrator user
by jena74
jena74 [https://community.jboss.org/people/jena74] created the discussion
"jBPM 5.3 - Human Task Service and administrator user"
To view the discussion, visit: https://community.jboss.org/message/741417#741417
--------------------------------------------------------------
Hello,
I am using the Human Task service in a standalone Java application.
Everything is ok when I don't use the file jbpm.usergroup.callback.properties to precise and callback for managing users and groups.
But, when I provide such a file with jbpm.usergroup.callback=org.jbpm.task.service.DefaultUserGroupCallbackImpl inside, I have the following error:
org.jbpm.task.service.CannotAddTaskException: There are no known Business Administrators, task cannot be created according to WS-HT specification
In the documentation, it is written that an Administrator user must exists in the Human Task service.
So in my code I have added
| | taskSession.addUser(new org.jbpm.task.User("Administrator")); |
but nothing changes and the error is still there.
How can I declare an Administrator user in the Human Task server?
Any idea to solve this will be appreciated.
Thanks a lot.
Jena
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/741417#741417]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years