[jBPM] - Some conceptual jBPM5 questions
by Ouadi BEL
Ouadi BEL [https://community.jboss.org/people/ouadi_dev] created the discussion
"Some conceptual jBPM5 questions"
To view the discussion, visit: https://community.jboss.org/message/800780#800780
--------------------------------------------------------------
Hi all jBPM users,
I'm new in jBPM5 and workflow world, I already read the first 7 chapters in "jbpm5-developer-guide" book, but I have some concepts confused in my mind, can anyone explain me please these below questions ?
1. What's the main purpose of those classes
EntityManagerFactory, TaskService, TaskServiceSession ;
2. Which Data Base used to store our specific users and groups informations ?
3. Why we need to store our specific users and groups to this DB, since it's already defined in our process.bpmn file definition ?
4. When we build our Human Task UI in order to provide an Human Task Interaction, it is necessary to run the jbpm-gwt-console-server- 5.4.0.Final-EE6.war component in Jboss server ? Or just the jars library provided by jBPM5 suffice in order to managing our workflow life cycle without running and using jbpm-gwt-console-server-5.4.0.Final-EE6.war component ?
5. When we build a binary representation of our process.bpmn file definition using KnowledgeBuilder and KnowledgeBase classes, our application can self-managing the all workflow life cycle without running and using jbpm-gwt- console-server-5.4.0.Final-EE6.war component in Jboss server ?
Cheers,
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/800780#800780]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 1 month
[Javassist] - Javaassist and Java Web Start. Its posible?
by Telcontar Thorongil
Telcontar Thorongil [https://community.jboss.org/people/telcontarvi] created the discussion
"Javaassist and Java Web Start. Its posible?"
To view the discussion, visit: https://community.jboss.org/message/799924#799924
--------------------------------------------------------------
Hi, i'm triying to deploy a desktop application with one class modified at runtime by javaassist. In my computer it's working fine, but when i deploy and start it by Java Web Start i'm facing several problems, last of them i can't resolve:
- First: ClassPool didnt found the class to modify, it was fixed by cp.insertClassPath(new ClassClassPath(XXXXX.class));
- Second: All .jar of an Java Web Start application must be signed by one and only one certificate, but when javaassist modify the class at runtime i supose the sign it's gone or it's invalid, so that this exception is launched:
java.lang.SecurityException: class "com.sch.coberturas.db.CobDao"'s signer information does not match signer information of other classes in the same package
Solved by isolating com.sch.coberturas.db.CobDao in a package with only this class in it
- Third: I suposse that Java Web Start detects that the modified class is not signed, or it's sign it's not valid and revokes permissions to the application so it can't do things like connecting to the database or to write files, making the app useless.
How can i solve this third problem?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/799924#799924]
Start a new discussion in Javassist at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 1 month
[JBoss Tools] - New Hibernate Tools features in JBDS 6
by Jiri Peterka
Jiri Peterka [https://community.jboss.org/people/jpeterka] modified the document:
"New Hibernate Tools features in JBDS 6"
To view the document, visit: https://community.jboss.org/docs/DOC-48444
--------------------------------------------------------------
h1. New Hibernate tool features in JBDS 6
This article will show you some of new features and enhancements in Hibernate Tools 3.6.0 which is part of JBoss Tools 4.0.0 and also JBoss Developer Studio 6.0.0 (further referred as JBDS).
We shall partially meet this areas of Hibernate tools in this tutorial:
* JBoss Hibernate tools libraries for code generation with ANT tasks support
* New database profile connection features for Hibernate
* Some new Hibernate features in JPA projects
h2. Prerequisites
JBoss Developer Studio
It’s expected you have JDK 1.6 or higher and JBDS 6.0.0.GA that you can download from https://devstudio.jboss.com/earlyaccess/6.0.0.GA.html https://devstudio.jboss.com/earlyaccess/6.0.0.GA.html
and to install is simply using following command:
java -jar jbdevstudio-product-universal-6.0.0.GA-v20121206-1855-B186.jar
Go through installer wizard and after it’s finish start JBoss Developer Studio, select new workspace location and you should see a screen below .
https://lh6.googleusercontent.com/9y16idOz_-IPfChs59bIzoA8SrOy_yh55SwBWua... https://lh6.googleusercontent.com/9y16idOz_-IPfChs59bIzoA8SrOy_yh55SwBWua...
Click on “Get started with JBoss Central” and your IDE is ready for you.
h3. Database
Outside IDE download and start database needed for this tutorial. We will use sakila database running on h2 database. Follow these steps:
mkdir ~/db
cd db
git://github.com/maxandersen/sakila-h2.git
./sakila-h2/runh2.sh
You should see a database started
https://lh6.googleusercontent.com/Hw3EV7J7nHaciFPdfn7b5oudUpACIyARBAWbKG-... https://lh6.googleusercontent.com/Hw3EV7J7nHaciFPdfn7b5oudUpACIyARBAWbKG-...
Go back to IDE and check the database. Switch to “Database Development” perspective. And define database connection. In “Data Source Explorer” view define new connection by context menu. Select Generic JDBC Driver (because there is not specific profile for h2)
https://lh6.googleusercontent.com/y0iWJEdGmdLO1aH2mNer-Ck9v7lJhlun2F5ppLo... https://lh6.googleusercontent.com/y0iWJEdGmdLO1aH2mNer-Ck9v7lJhlun2F5ppLo...
Switch to “JAR List” tab and add h2-<version>.jar from h2 where you have installed it. Then go to properties and add jdbc connection as written by started sakila db server. Update drive class (you can use auto lookup feature if you want).
https://lh3.googleusercontent.com/p_jkbXQmCQpEu0sAHAhulV8IhTb91yxwx4syl0C... https://lh3.googleusercontent.com/p_jkbXQmCQpEu0sAHAhulV8IhTb91yxwx4syl0C...
Now you can test connection by clicking “Test Connection button”
https://lh5.googleusercontent.com/j9pr-eVRTqrhDCfbgSuYK0PX99iPGtbiI6QJABu... https://lh5.googleusercontent.com/j9pr-eVRTqrhDCfbgSuYK0PX99iPGtbiI6QJABu...
h2. You should see “Ping succeeded!” message box. After it’s closing, just just click Finish.
Now you can browse database structure and can see database content if you want.
https://lh4.googleusercontent.com/nt4e84GBv2OO4XuSUgOEsvHz3NWuFxX-JwxMe0n... https://lh4.googleusercontent.com/nt4e84GBv2OO4XuSUgOEsvHz3NWuFxX-JwxMe0n...
Well, prerequisites are over so let’s take a look what hibernate tools provides.
h2. NEW FEATURE: Hibernate tools libraries update
One thing that was updated in JBDS 6 is Hibernate Tools for Ant. It was updated to these versions.
* 3.4.0.CR2 for Hibernate 3.5
* 3.6.0.CR1 for Hibernate 3.6
* 4.0.0.CR1 for Hibernate 4
So let’s refresh our memory and try small tutorial how to use this feature in JBDS. We will create simple plug-in project and let UI to generate java db entities and also build.xml using hibernate-tools.jar ant tasks that can be modified and used further. Then we shall import ant file into our project, slightly update it and and execute it.
Now create a testing project. In menu navigate: New -> Other … -> Plug-in project
https://lh3.googleusercontent.com/snmZAUub5K6UFo5sKKBldEbTNCZOvqUtNeVH6po... https://lh3.googleusercontent.com/snmZAUub5K6UFo5sKKBldEbTNCZOvqUtNeVH6po...
In wizard navigate: Next
https://lh4.googleusercontent.com/m5EPpl2Bydw7QPb7XO6qJbGzREDt8ZSquDTu4zy... https://lh4.googleusercontent.com/m5EPpl2Bydw7QPb7XO6qJbGzREDt8ZSquDTu4zy...
In wizard navigate: Next, Finish.
Nice, your project is created. You can also create Java Project or any other type either mavenized or Eclipse type project.
Additional steps would be only slightly different. We created eclipse plug-in project so we can easily add dependencies via manifest file.
Now open MANIFEST.MF in Package Explorer to add hibernate-tools into our project.
https://lh5.googleusercontent.com/DedhkVJeb-F7sScMpctDwVx_i-Re3bSnWyX2Sw-... https://lh5.googleusercontent.com/DedhkVJeb-F7sScMpctDwVx_i-Re3bSnWyX2Sw-...
Switch to “Dependencies” tab click “Add...” button and start type “org.jboss.tools.hibernate” and select “org.jboss.tools.hibernate4_0” which adds hibernate libraries to our project (and mainly desired hibernate-tools.jar for Hibernate 4.0.
https://lh6.googleusercontent.com/s6HcHQIgo5NxeO2dBNPk-qyARc1jBpCB28m83Zw... https://lh6.googleusercontent.com/s6HcHQIgo5NxeO2dBNPk-qyARc1jBpCB28m83Zw...
When hibernate plugin is added into your MANIFEST.MF, you can save and close the editor.
Let’s create hibernate configuration.
In menu navigate to: New -> Other … -> Hibernate Configuration File (cfg.xml). Click Next, select src folder and click Next
https://lh4.googleusercontent.com/WxC_TtmF3jLxsPAt2MxzF5JL6vxTCdohCS_GgSW... https://lh4.googleusercontent.com/WxC_TtmF3jLxsPAt2MxzF5JL6vxTCdohCS_GgSW...
NEW FEATURE: Connection profile can be used for hibernate configuration settings
One of new features is “Get values from connection”. Since we’ve already created database connection profile we can use it.
https://lh6.googleusercontent.com/RNn0jiRNmWcDgDug1aJmNbMfR03MROV0Gzqe4tM... https://lh6.googleusercontent.com/RNn0jiRNmWcDgDug1aJmNbMfR03MROV0Gzqe4tM...
https://lh3.googleusercontent.com/ksHlLJumN5CF5oDxoRiwrjndxkG-vRqMwktc-do... https://lh3.googleusercontent.com/ksHlLJumN5CF5oDxoRiwrjndxkG-vRqMwktc-do...
You can see the values were filled. We just need to add some additional properties like database dialect, etc. Check “Create a console configuration” and “Next”. Here just switch “Hibernate Version” to “4.0”. Click Finish.
NEW FEATURE: Connection profile can be used for datasource connection settings
It’s not part of this tutorial but similarly we can use this feature also while creating datasource file for application server like JBoss AS os EAP. To use it navigate to New -> Other... -> JBoss Datasource (-ds.xml).
https://lh5.googleusercontent.com/o-3fjbCN1Ah-aArR9uS8tJ60p3Cvj-SvNgHNWbo... https://lh5.googleusercontent.com/o-3fjbCN1Ah-aArR9uS8tJ60p3Cvj-SvNgHNWbo...
Ok, let’s continue with our example. Let’s try to generate some code from our database. Switch to “Hibernate” perspective if you already didn’t do that. Now navigate to Run -> Hibernate Code Generation -> Hibernate Code Generation Configurations...
You should see dialog similar to one below. Your configuration is already there so we can configure it a little bit and generate some code. Select your “Console configuration”, check “Reverse engineer from JDBC Connection” and add some package for exported entities. Select also your project src as “Output directory:”.
https://lh3.googleusercontent.com/GCJcd_4n74WmPl4Z4dPEGtn5MlpQpKspmM4tjwE... https://lh3.googleusercontent.com/GCJcd_4n74WmPl4Z4dPEGtn5MlpQpKspmM4tjwE...
On “Exporters” tab you can select Domain code or any other artefacts you want to generate (note that some of them requires additional configuration).
https://lh4.googleusercontent.com/jMT2x8GNex6g5wrF_y2SWAdLN-hY2lBBxNLvN71... https://lh4.googleusercontent.com/jMT2x8GNex6g5wrF_y2SWAdLN-hY2lBBxNLvN71...
When you click “Run” your code will be generated. There are many other possibilities how to tweak your exports (like reveng files, etc.) but it’s beyond this tutorial. Anyway you have exported entities.
https://lh6.googleusercontent.com/Y95LxhoU9diaA9XE-sKBU1bKbk90hEW6YvNcxYo... https://lh6.googleusercontent.com/Y95LxhoU9diaA9XE-sKBU1bKbk90hEW6YvNcxYo...
During code generation there was some “magic” done. Let’s see what happened. This export we’ve just made is done by hibernate-tools.jar ant task which is used in generated build.xml. Let’s see if we can take a look at this ant file.
So now try get the ant file. Click On project, invoke context menu and select “Export” -> “Hibernate” -> “Ant Code Generation”
https://lh5.googleusercontent.com/qQqPmOZuV3621uS-d7MwlRZ8LIeg3wbr0dJswlW... https://lh5.googleusercontent.com/qQqPmOZuV3621uS-d7MwlRZ8LIeg3wbr0dJswlW...
Select Hibernate configuration, select project, fill in the “File name:” to export and click Finish.
https://lh6.googleusercontent.com/9fL3xfB_ty3SYcjXvEce6A_fMT98k1QM1vqO6EN... https://lh6.googleusercontent.com/9fL3xfB_ty3SYcjXvEce6A_fMT98k1QM1vqO6EN...
We we successful, build.xml is available in our plug-in project. We can see HibernateToolTask target which is executes <hbm2java> task.
https://lh6.googleusercontent.com/V7uIDxTPmX2zDNRmMZttwn3rU9IvglZOXh1R1cz... https://lh6.googleusercontent.com/V7uIDxTPmX2zDNRmMZttwn3rU9IvglZOXh1R1cz...
You can now use and customize ant xml file to achieve your specific goals by adding and modifying ant tasks and of course you can use code completion. Not that you can use it for generating different types of hibernate configuration, for various export types and definition and more. And of course this script works also outside an IDE. For more details see a https://access.redhat.com/knowledge/docs/en-US/JBoss_Developer_Studio/6.0... documentation.
Not let’s take a shortly look on some other features that are available.
NEW FEATURE: Persistence.xml is update with connection profile information automatically
As the title refers you don’t have to add connection informations into persistence.xml manually. You can see it for yourself. Just Create “New JPA Project” (again New -> Others... -> JPA Project)
https://lh5.googleusercontent.com/gKgJ8AmiGcaAv3yX-ZQ_Zyufr8DvhabPdbRNzck... https://lh5.googleusercontent.com/gKgJ8AmiGcaAv3yX-ZQ_Zyufr8DvhabPdbRNzck...
Fill in basic properties like “Project name”.
https://lh5.googleusercontent.com/xK5tluIA9T-VPOpEpyHGnkZDA82C6i1mArLOddD... https://lh5.googleusercontent.com/xK5tluIA9T-VPOpEpyHGnkZDA82C6i1mArLOddD...
Select “Hibernate (JPA 2.x)” platform and set connection to a connection you’ve created before.
https://lh4.googleusercontent.com/9eCBDt0Fw-2AFLS3Bbs_Beg12QA9iSpKzGWsGOq... https://lh4.googleusercontent.com/9eCBDt0Fw-2AFLS3Bbs_Beg12QA9iSpKzGWsGOq...
And click Finish. When you open persistence.xml, you can see your connection is properly configured.
https://lh3.googleusercontent.com/ta--ERrdFssKUolw7aCOOVw7AbIi9Pe6MoBKK6C... https://lh3.googleusercontent.com/ta--ERrdFssKUolw7aCOOVw7AbIi9Pe6MoBKK6C...
Let’s see another features. We will use a project created before.
NEW FEATURE: Persistence.xml is update with connection profile information automatically
Before continuing add Hibernate libraries to JPA Project (you can use libraries available in JBDS in from plugins/org.jboss.tools.hibernate4_.... /lib/required). Without this feature will not work.
Select JPA project and from context menu use “JPA Tools -> Generate Entities from tables”. Set basic parameters like what package should be used for entities generation and correct hibernate configuration. Click Finish.
https://lh5.googleusercontent.com/WHmxN1LGfxnpO92hUrvW91jINMemiCEG-nGTFUn... https://lh5.googleusercontent.com/WHmxN1LGfxnpO92hUrvW91jINMemiCEG-nGTFUn...
When you check persistence.xml, JBDS updated your persistence.xml accordingly with new entities. If your persistence.xml is opened during code generation you can see it live.
https://lh3.googleusercontent.com/7wBWkVsEXVEeaWabGjIe7bLCNu88X2XDTm2aveh... https://lh3.googleusercontent.com/7wBWkVsEXVEeaWabGjIe7bLCNu88X2XDTm2aveh...
There are many others Hibernate features available in latest stable Hibernate Tools that is available within JBoss Tools or JBoss Developer Studio. You can see all Hibernate tools features for JBDS 6.0.0 https://issues.jboss.org/issues/?filter=12318813 here.
That’s all, enjoy latest Hibernate Tools! If you have any comment please share it below.
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-48444]
Create a new document in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
13 years, 1 month
[JBoss Messaging] - JBOSS EAP6.0.1 with IBM MQ problem
by Zainab Madawala
Zainab Madawala [https://community.jboss.org/people/zainab.madawala] created the discussion
"JBOSS EAP6.0.1 with IBM MQ problem"
To view the discussion, visit: https://community.jboss.org/message/800756#800756
--------------------------------------------------------------
Hello,
We are trying to integrate JBOSS EAP6.0.1 with IBM MQ. We have an application working on Websphere 7 with IBM MQ for JMS.
We are in process of migration to JBOSS EAP6.0.1.
With regards to setup and information available on various JBOSS forums, we managed to perform a few setup for the Queue Connection factories and Queues.
With JBOSS EAP6.0.1, We have copied the "wmq.jmsra.rar" from the IBM MQ to JBOSS Standlalone deployment folder.
We modified the standalone-full.xml to include the resource-adapter pertaining to IBM MQ.
Snippet of configuration from standalone-full.xml:
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
<resource-adapters>
<resource-adapter>
<archive>
wmq.jmsra.rar
</archive>
<transaction-support>NoTransaction</transaction-support>
<connection-definitions>
<connection-definition class-name="com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl" jndi-name="java:jboss/jms/myQCF" pool-name="jms/myQCF">
<config-property name="hostName">
XXXXXX (Server Name)
</config-property>
<config-property name="channel">
YYYYYY (Channel Name)
</config-property>
<config-property name="transportType">
CLIENT
</config-property>
<config-property name="queueManager">
ZZZZZ (Queue Manager Name)
</config-property>
</connection-definition>
</connection-definitions>
<admin-objects>
<admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/jms/myOutPostQueue" pool-name="OUT_POST">
<config-property name="baseQueueName">
OUT_POST
</config-property>
</admin-object>
<admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/jms/myOutAckQueue" pool-name="OUTPUT_REPLY_QUEUE">
<config-property name="baseQueueName">
OUTPUT_REPLY_QUEUE
</config-property>
</admin-object>
<admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/jms/myOutRespQueue" pool-name="OUTPUT_PDF_RESP">
<config-property name="baseQueueName">
IVN_ADV_QUEUE
</config-property>
</admin-object>
</admin-objects>
</resource-adapter>
</resource-adapters>
</subsystem>
The connection-definition class-name are as per the ra.xml available under wmq.jmsra.rar\META-INF.
With the above setup We are able to see the JNDI created for the Queues and Queue Connection factory.
We have used Spring based JMS setup (JMSTemplate102) for getting the QCF and sending message.
However, at the time of calling send method on jmsTemplate102, we get below error:
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) Caused by: javax.resource.ResourceException: IJ000658: Unexpected throwable while trying to create a connection: null
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:378)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:397)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:365)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:329)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:302)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at com.ibm.mq.connector.outbound.ConnectionFactoryImpl.createManagedJMSConnection(ConnectionFactoryImpl.java:189)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) ... 135 more
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) Caused by: com.ibm.mq.connector.DetailedResourceException: MQJCA1012: Failed to create a JMS connection factory., error code: MQJCA1012 A JCA ManagedConnectionFactory object was not able to create a WebSphere MQ classes for JMS ConnectionFactory object. Check the properties of the ConnectionFactory object.
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:124)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:100)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl.createConnection(ManagedQueueConnectionFactoryImpl.java:161)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at com.ibm.mq.connector.outbound.ManagedConnectionImpl.<init>(ManagedConnectionImpl.java:131)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at com.ibm.mq.connector.outbound.ManagedQueueConnectionImpl.<init>(ManagedQueueConnectionImpl.java:66)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl.createManagedConnection(ManagedQueueConnectionFactoryImpl.java:138)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:775)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:345)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) ... 141 more
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) Caused by: javax.jms.JMSException: com.ibm.msg.client.jms.internal.JmsFactoryFactoryImpl cannot be cast to com.ibm.msg.client.jms.JmsFactoryFactory
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at com.ibm.msg.client.jms.JmsFactoryFactory.getInstance(JmsFactoryFactory.java:199)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at com.ibm.mq.connector.ConnectionFactoryBuilder.constructJmsConnectionFactory(ConnectionFactoryBuilder.java:230)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at com.ibm.mq.connector.ConnectionFactoryBuilder.createConnectionFactory(ConnectionFactoryBuilder.java:124)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.createConnectionFactory(ManagedConnectionFactoryImpl.java:431)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) at com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl.createConnection(ManagedQueueConnectionFactoryImpl.java:157)
17:15:22,852 ERROR [stderr] (http-localhost/127.0.0.1:8080-5) ... 146 more
Any help would be appreciated.
Also, if someone have configured IBM MQ with EAP6.0.1 (Without MDBs), pls guide us.
Thanks.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/800756#800756]
Start a new discussion in JBoss Messaging at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 1 month
[jBPM] - How to complete a workitem after session load in jbpm 5.0.0.
by Feki Ahmed
Feki Ahmed [https://community.jboss.org/people/bardelman] created the discussion
"How to complete a workitem after session load in jbpm 5.0.0."
To view the discussion, visit: https://community.jboss.org/message/800742#800742
--------------------------------------------------------------
Hi,
i ve worked with the version 5.4 and have resolved this problem but i have an unfinished project with the version 5.0.0 which must be completed with that version.
To complete a workitem in version 5.4 i had to write :
ksession.getWorkItemManager().completeWorkItem(client.getTask(Task.getId()).getTaskData().getWorkItemId(), null);
For the version 5.0.0 i 've written a test case like with a java class which is the following :
public class Jbpm500MainTest {
private static Log log = LogFactory.getLog(Jbpm500MainTest.class);
static StatefulKnowledgeSession ksession =null;
public static ProcessInstance processInstance=null;
public static void main( String[] args) {
///////////////part 1 : creating session ///////////////////////
try {
UserTransaction ut = (UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );
ut.begin();
ksession = JbpmAPIUtil.getSession("modele1.bpmn");
/*Create the knowledge base */
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "testlog", 1000);
CommandBasedWSHumanTaskHandler taskHandler = new CommandBasedWSHumanTaskHandler(ksession);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", taskHandler);
taskHandler.connect();
ut.commit();
logger.close();
} catch (Throwable t) {
//log.error(t.getMessage(), t.getCause());
throw new RuntimeException("error while creating session",t);
}
UserTransaction ut = null;
try {
ut = (UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );
} catch (NamingException e1) {
e1.printStackTrace();
}
try {
ut.begin();
} catch (NotSupportedException e) {
e.printStackTrace();
} catch (SystemException e) {
e.printStackTrace();
}
System.out.println("Starting process...");
processInstance = ksession.startProcess("modele1");
ksession.fireAllRules();
try {
ut.commit();
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (SecurityException e) {
e.printStackTrace();
} catch (HeuristicMixedException e) {
e.printStackTrace();
} catch (HeuristicRollbackException e) {
e.printStackTrace();
} catch (RollbackException e) {
e.printStackTrace();
} catch (SystemException e) {
e.printStackTrace();
}
////Looking for tasks 1
java.util.List<TaskSummary> tasks = null;
boolean reservedtaskfound=false;
while(!reservedtaskfound){
tasks = JbpmAPIUtil.getAssignedTasks("user1");
if(tasks != null && tasks.size()!=0){
System.out.println("-----------------------------------------");
System.out.println("Looking for tasks 1 : tasks : "+tasks);
//////Completing the gotten task
try {
if(tasks!=null && tasks.size()!=0)
for(TaskSummary ts : tasks){
if(ts!=null && ts.getStatus().toString()=="Reserved"){
System.out.println(""+ts.getId());
if(!reservedtaskfound)
JbpmAPIUtil.completeTask(ts.getId(), null, "user1");
reservedtaskfound=true;
break;
}
}
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else{
System.out.println("tasks 1 is still null ");
System.out.println("-----------------------------------------");
}
}
///////////////////////////////////disposing session : must wait until the next task is generated with the status "Reserved" ///////////////////////////////////
tasks = null;
reservedtaskfound=false;
int idsession=1;
while(!reservedtaskfound){
tasks = JbpmAPIUtil.getAssignedTasks("user1");
if(tasks != null && tasks.size()!=0){
System.out.println("-----------------------------------------");
System.out.println("Looking for tasks 2 : tasks : "+tasks);
if(tasks!=null && tasks.size()!=0)
for(TaskSummary ts : tasks){
if(ts!=null && ts.getStatus().toString()=="Reserved"){
System.out.println(""+ts.getId());
if(!reservedtaskfound){
System.out.println("Disposing Session.. ");
idsession = ksession.getId();
ksession.dispose();
}
reservedtaskfound=true;
break;
}
}
}else{
System.out.println("tasks 2 is still null ");
System.out.println("-----------------------------------------");
}
}
//Loading the session
KnowledgeBase kbase = null;
try {
kbase = JbpmAPIUtil.readKnowledgeBase("modele1.bpmn");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
EntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa" );
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
env.set( EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager() );
env.set( EnvironmentName.GLOBALS, new MapGlobalResolver() );
Properties properties = new Properties();
properties.put("drools.processInstanceManagerFactory", "org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");
properties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory");
KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
System.out.println("loading Session.. ");
StatefulKnowledgeSession loadedksession = JPAKnowledgeService.loadStatefulKnowledgeSession(idsession, kbase, null, env);
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(loadedksession, "testlog", 1000);
CommandBasedWSHumanTaskHandler taskHandler2 = new CommandBasedWSHumanTaskHandler(loadedksession);
loadedksession.getWorkItemManager().registerWorkItemHandler("Human Task", taskHandler2);
taskHandler2.connect();
tasks = null;
reservedtaskfound=false;
Long completedtaskId =0L;
while(!reservedtaskfound){
tasks = JbpmAPIUtil.getAssignedTasks("user1");
if(tasks != null && tasks.size()!=0){
System.out.println("-----------------------------------------");
System.out.println("Looking for tasks 2 : tasks : "+tasks);
//////Complleting the gotten task
try {
if(tasks!=null && tasks.size()!=0)
for(TaskSummary ts : tasks){
if(ts!=null && ts.getStatus().toString()=="Reserved"){
System.out.println(""+ts.getId());
if(!reservedtaskfound)
JbpmAPIUtil.completeTask(ts.getId(), null, "user1");
completedtaskId = ts.getId();
reservedtaskfound=true;
break;
}
}
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else{
System.out.println("tasks 2 is still null ");
System.out.println("-----------------------------------------");
}
}
//HERE the workitem must be completed in order to make the process continue its execution to the next task
???????????????????????
// looking for the next task and completing it .
tasks = null;
reservedtaskfound=false;
while(!reservedtaskfound){
tasks = JbpmAPIUtil.getAssignedTasks("user1");
if(tasks != null && tasks.size()!=0){
System.out.println("-----------------------------------------");
System.out.println("Looking for tasks 3 : tasks : "+tasks);
//////Complleting the gotten task
try {
if(tasks!=null && tasks.size()!=0)
for(TaskSummary ts : tasks){
if(ts!=null && ts.getStatus().toString()=="Reserved"){
System.out.println(""+ts.getId());
if(!reservedtaskfound)
JbpmAPIUtil.completeTask(ts.getId(), null, "user1");
reservedtaskfound=true;
break;
}
}
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else{
System.out.println("tasks 3 is still null ");
System.out.println("-----------------------------------------");
}
}
}
}
Both 5.0 and 5.4 API's are very different and i coudn't follow the same 5.4 syntaxe for the 5.0.
for example : in the method getTask(long, TaskClientHandler.GetTaskResponseHandler), i dont know what to put as second parameter, my taskHandler2 does't have a method GetTaskResponseHandler. and the getTask itself doesn't have the getTaskData()...
Thanks for help !
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/800742#800742]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 1 month
[Datasource Configuration] - My datasource don't create a transaction
by James Wong
James Wong [https://community.jboss.org/people/jwong22] created the discussion
"My datasource don't create a transaction"
To view the discussion, visit: https://community.jboss.org/message/800606#800606
--------------------------------------------------------------
Hello
I have some problem with my database connection.
When i want to persist my object to my database, the server don't throw an exception but it don't insert into my table.
And when i see my debug log, it says
14:50:21,848 DEBUG [org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl] (http-localhost-127.0.0.1-8080-1) Skipping JTA sync registration due to auto join checking
14:50:21,850 DEBUG [org.hibernate.engine.jdbc.internal.LogicalConnectionImpl] (http-localhost-127.0.0.1-8080-1) Obtaining JDBC connection
14:50:21,851 DEBUG [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (http-localhost-127.0.0.1-8080-1) EiadDs: getConnection(null, null) [1/20]
standelone.xml datasources
| | <datasource jndi-name="java:jboss/datasources/EiadDS" pool-name="EiadDs" enabled="true" use-java-context="true" use-ccm="true"> |
| | <connection-url>jdbc:mysql://localhost:3306/eiad</connection-url> |
| | <driver>mysql</driver> |
| | <security> |
| | <user-name>user</user-name> |
| | <password>user</password> |
| | </security> |
| | <statement> |
| | <prepared-statement-cache-size>100</prepared-statement-cache-size> |
| | <share-prepared-statements>true</share-prepared-statements> |
| | </statement> |
| | </datasource> |
| | <drivers> |
| | <driver name="mysql" module="com.mysql"/>
</drivers> |
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="eiad-ejbPU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/EiadDS</jta-data-source>
<class>fr.eiad.business.Temps</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.show_sql" value="true" />
<property name="jboss.entity.manager.factory.jndi.name" value="java:jboss/EntityManagerFactory" />
<property name="hibernate.jdbc.factory_class" value="net.bull.javamelody.HibernateBatcherFactory" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect" />
</properties>
</persistence-unit>
</persistence>
EntityService.java
| private EntityManager | entityManager = EntityManagerHome.getEntityManager(); |
public void persist(final Temps temps)
{
|
| log.debug("persisting Temps instance"); //$NON-NLS-1$ |
|
| entityManager.persist(temps); |
}
public final Temps findById(final Integer id)
{
|
| log.debug("getting User instance with id: " + id); |
|
| try |
|
| { |
| | final EntityManagerHome entityhome = new EntityManagerHome(); |
| | entityManager = EntityManagerHome.getEntityManager(); |
| | final Temps instance = entityManager.find(Temps.class, id); |
| | log.debug("get successful"); |
| | return instance; |
|
| } |
|
| catch (final RuntimeException re) |
|
| { |
| | log.error("get failed", re); |
| | throw re; |
|
| } |
}
public static EntityManager getEntityManager()
{
EntityManagerFactory emf;
try
{
emf = (EntityManagerFactory)InitialContext.doLookup("java:jboss/EntityManagerFactory"); //$NON-NLS-1$
if (emf != null)
{
em = emf.createEntityManager();
}
if (em != null)
{
log.debug("Em Cree"); //$NON-NLS-1$
}
else
{
log.debug("Em plante"); //$NON-NLS-1$
}
}
catch (final NamingException e)
{
throw new IllegalStateException("EntityManagerFactory cannot create entity manager"); //$NON-NLS-1$
}
return em;
}
It's an datasources error or and bad persistence.xml ?
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/800606#800606]
Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 1 month