[JBoss Messaging] - JBoss 5.1 with Websphere MQ Resource Adapter: Infinite redeliveries
by John Smith
John Smith [https://community.jboss.org/people/dramaticbanana] created the discussion
"JBoss 5.1 with Websphere MQ Resource Adapter: Infinite redeliveries"
To view the discussion, visit: https://community.jboss.org/message/746175#746175
--------------------------------------------------------------
Hello,
I'm currently having a problem where messages are redelivered infinitely if an exception is thrown in my MDB (and it thus rolls back). This despite my messaging-service.xml explicitly limiting redeliveries to 3 (DefaultMaxDeliveryAttempts = 3). When no exceptions occur (which is the normal case), everything runs fine. I've looked around for answers but this one keeps boggling my mind.
My JBoss 5.1 server is connected to a Websphere MQ server using a resource adapter (similar to https://community.jboss.org/it is illegal to call setRollbackOnly from BMT: BEAN these steps). My MDB is all defined in XML (and not using annotations) as I'd like to keep the code as JBoss-independent as possible.
Any help is appreciated! I'd be happy to provide more information if needed.
Here are snippets from relevant files:
*jboss.xml*
{code:xml}
<message-driven>
<ejb-name>MQChannelListener</ejb-name>
<destination-jndi-name>queue/ReplyQueue</destination-jndi-name>
<resource-adapter-name>wmq.jmsra.rar</resource-adapter-name>
</message-driven>
{code:xml}
*ejb-jar.xml*
{code:xml}
<message-driven>
<ejb-name>MQChannelListener</ejb-name>
<ejb-class>path.to.class.MQChannelListener</ejb-class>
<messaging-type>javax.jms.MessageListener</messaging-type>
<transaction-type>Container</transaction-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>destinationType</activation-config-property-name>
<activation-config-property-value>javax.jms.Queue</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>destination</activation-config-property-name>
<activation-config-property-value>XXX</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>channel</activation-config-property-name>
<activation-config-property-value>XXX</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>hostName</activation-config-property-name>
<activation-config-property-value>XXX</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>port</activation-config-property-name>
<activation-config-property-value>XXX</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>queueManager</activation-config-property-name>
<activation-config-property-value>XXX</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>transportType</activation-config-property-name>
<activation-config-property-value>CLIENT</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>useJNDI</activation-config-property-name>
<activation-config-property-value>false</activation-config-property-value>
</activation-config-property>
</activation-config>
</message-driven>
...
<container-transaction>
<method>
<ejb-name>MQChannelListener</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>RequiresNew</trans-attribute>
</container-transaction>
{code:xml}
*MQChannelListener.java*
{code:java}
public class MQChannelListener implements MessageListener {
@PersistenceContext(unitName = "persistence-context")
private EntityManager entityManager;
@Resource
private MessageDrivenContext sessionContext;
@Override
public void onMessage(Message msg) {
String textMsg = null, messageId = null;
long timestamp = -1;
boolean redelivered = false;
try {
textMsg = ((TextMessage) msg).getText();
messageId = msg.getJMSMessageID();
timestamp = msg.getJMSTimestamp();
redelivered = msg.getJMSRedelivered();
// perform code
} catch (Throwable t) {
sessionContext.setRollbackOnly();
}
}
}
{code:java}
*wmq.jmsra-ds.xml*
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<connection-factories>
<tx-connection-factory>
<jndi-name>queue/WMSRACF</jndi-name>
<xa-transaction />
<rar-name>wmq.jmsra.rar</rar-name>
<connection-definition>javax.jms.ConnectionFactory</connection-definition>
<config-property name="channel" type="java.lang.String">XXX</config-property>
<config-property name="hostName" type="java.lang.String">XXX</config-property>
<config-property name="port" type="java.lang.String">XXX</config-property>
<config-property name="queueManager" type="java.lang.String">XXX</config-property>
<config-property name="transportType" type="java.lang.String">CLIENT</config-property>
<config-property name="xaEnabled" type="java.lang.String">true</config-property>
<max-pool-size>100</max-pool-size>
<track-connection-by-tx>true</track-connection-by-tx>
</tx-connection-factory>
<mbean code="org.jboss.resource.deployment.AdminObject" name="jca.wmq:name=RequestQueue">
<attribute name="JNDIName">queue/RequestQueue</attribute>
<depends optional-attribute-name="RARName">
jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'
</depends>
<attribute name="Type">javax.jms.Queue</attribute>
<attribute name="Properties">
baseQueueManagerName=XXX
baseQueueName=XXX
</attribute>
</mbean>
</connection-factories>
{code:xml}
*messaging-service.xlm*
{code:xml}
<server>
<mbean code="org.jboss.jms.server.ServerPeer"
name="jboss.messaging:service=ServerPeer"
xmbean-dd="xmdesc/ServerPeer-xmbean.xml">
<attribute name="ServerPeerID">0</attribute>
<attribute name="DefaultQueueJNDIContext">/queue</attribute>
<attribute name="DefaultTopicJNDIContext">/topic</attribute>
<attribute name="PostOffice">jboss.messaging:service=PostOffice</attribute>
<attribute name="DefaultDLQ">jboss.messaging.destination:service=Queue,name=DLQ</attribute>
<attribute name="DefaultMaxDeliveryAttempts">3</attribute>
<attribute name="DefaultExpiryQueue">jboss.messaging.destination:service=Queue,name=ExpiryQueue</attribute>
<attribute name="DefaultRedeliveryDelay">5000</attribute>
<attribute name="MessageCounterSamplePeriod">5000</attribute>
<attribute name="FailoverStartTimeout">60000</attribute>
<attribute name="FailoverCompleteTimeout">300000</attribute>
<attribute name="StrictTck">false</attribute>
<attribute name="DefaultMessageCounterHistoryDayLimit">-1</attribute>
<attribute name="ClusterPullConnectionFactoryName">jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory</attribute>
<attribute name="DefaultPreserveOrdering">false</attribute>
<attribute name="RecoverDeliveriesTimeout">300000</attribute>
<attribute name="EnableMessageCounters">false</attribute>
<depends optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager</depends>
<depends optional-attribute-name="JMSUserManager">jboss.messaging:service=JMSUserManager</depends>
<depends>jboss.messaging:service=Connector,transport=bisocket</depends>
<depends optional-attribute-name="SecurityStore"
proxy-type="org.jboss.jms.server.SecurityStore">jboss.messaging:service=SecurityStore</depends>
</mbean>
</server>
{code:xml}
Note: Snippets were modified slightly for compression and security.
Can anyone spot what I'm doing wrong/missing?
Thanks!
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/746175#746175]
Start a new discussion in JBoss Messaging at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - Human Task API and Data Structures Proposal
by Mauricio Salatino
Mauricio Salatino [https://community.jboss.org/people/salaboy21] modified the document:
"Human Task API and Data Structures Proposal"
To view the document, visit: https://community.jboss.org/docs/DOC-18641
--------------------------------------------------------------
h1. *
#Introduction Introduction
***
#Generic_Service_Infrastructure Generic Service Infrastructure
*
#Task_Def_Service Task Def Service
***
#Task_Def_Structure Task Def Structure
**
#Task_Presentation_Service Task Presentation Service
**
#Task_Assignments_Service Task Assignments Service
**
#Task_Delegation_Service Task Delegation Service
**
#Task_Notification_Service_ Task Notification Service
*
#Task_Instance_Service Task Instance Service
***
#Human_Task_LifeCycle_Manager Human Task LifeCycle Manager
****
#Task_LifeCycle_Events Task LifeCycle Events
***
#Transaction_Strategies Transaction Strategies
***
#Task_Instance_Structure Task Instance Structure
***
#Task_Query_Service Task Query Service
**
#Task_Admin_Service Task Admin Service
**
#Task_Attachment_and_Comment_Services_ Task Attachment and Comment Services
**
#_Task_Events_Callbacks_Listeners_Service Task Events, Callbacks, Listeners Service
h1. Introduction
Based on the previous document for reviewing the architecture and APIs exposed by the Human Task module I've came up with this first schetck of proposal for changes.
I've decided for this stage to show a more modular approach that the one provided by the current implementation.
This modular approach will let us scale if more functionality is required without the need of chainging the interfaces of the already existing services. It will also allow us to
provide different implementations for each of the modules which will give us a lot of flexibility to integrate with different technologies. For example provide an Attachments Service
which uses a Content Repository and keep the comments in a database. We will be able to mix and match based on the scenario requirement.
The main focus of this proposal is to decouple all the logical services provided by the Human Task module and enable different implementations to cohexist under the same set of APIs.
This document describe also the Data Structures and Interfaces that will be exposed to the end User. All the other internal mechanisms and classes will be hidden.
The figure shows the logical organization of the proposed services. The services are logically grouped Task Definition Services and Task Instances Services.
All the services will be created using CDI beans, which will allow us to expose them via Switchyard / Camel ( https://docs.jboss.org/author/display/SWITCHYARD/Bean+Services https://docs.jboss.org/author/display/SWITCHYARD/Bean+Services)etc. In other words, these services will be completely agnostic of the
transports that different applications under different scenarios can use to interact with them. Using CDI will enable us to define different profiles and configurations for the module
depending on the scenario that we want to use it. Meaning that if you don't need a service, you just don't use it and you don't need to suffer the footprint of that unused service.
The following repository contains some experiments towards the direction described in this wiki page:
https://github.com/Salaboy/human-task-poc-proposal https://github.com/Salaboy/human-task-poc-proposal
The following sections explain the scope of the proposed services:
https://community.jboss.org/servlet/JiveServlet/showImage/102-18641-6-189... https://community.jboss.org/servlet/JiveServlet/downloadImage/102-18641-6...
h3. Generic Service Infrastructure
Each service architecture will vary depending on the implementation.
For most of the services a simple implementation will do the work:
https://community.jboss.org/servlet/JiveServlet/showImage/18935/TaskServi... https://community.jboss.org/servlet/JiveServlet/downloadImage/18935/TaskS...
No matter the services implementation, they should be as stateless as possible. Storing all the information in a Database or Repository.
There are some cases where Services implementation can provide a stateful context, but those implementations should specify why and how
they will keep the correlation between different requests. This should be stated using qualifiers as well as a different CDI scope.
h1. Task Def Service
A Task Definition is a structure that contains a reusable structure to define a Human Interaction. By reusable I mean, a Task that can be executed multiple times and
that shares static information, such as Assignments, Delegation options, Deadlines, Notifications, etc. If all this information can be shared we can reduce the definition time
just providing the users to select on of the provided definitions, instead of defining all this information every time that a task is required.
The task service def service will deal with static Human Task Definitions. These definitions can be generated by the userTasks from a business processes or via the
provided APIs by third parties applications. We will be able to deploy new task definitions to the service, list all the available definitions based on different criterias, etc.
A set of more specific services will be provided to store and manage additional information about Task Definitions.
// DEFINE ONCE, REUSE EVERYWHERE
TaskDef taskDef = new TaskDef("myTaskDef");
PeopleAssignments peopleAssignments = new PeopleAssignments();
List<OrganizationalEntity> potentialOwners = new ArrayList<OrganizationalEntity>();
potentialOwners.add(salaboy);
peopleAssignments.setPotentialOwners(potentialOwners);
taskDef.setPeopleAssignments(peopleAssignments);
//Deploy Definition
taskDefService.deployTaskDef(taskDef);
// list
taskDefService.getAllTaskDef("*");
// getById
taskDefService.getTaskDefById("myTaskDef");
// unregister
//taskDefService.undeployTaskDef("myTaskDef");
Service Interface:
https://github.com/Salaboy/human-task-poc-proposal/blob/master/human-task... https://github.com/Salaboy/human-task-poc-proposal/blob/master/human-task...
h3. Task Def Structure
TBD
h3.
h2. Task Presentation Service
The task presentation service will allow us to provide more information about how a task will be presented to the users. This will include the I18N options for all the texts
related to a task such as Subject, Description, Goals, etc. Decoupling this logic and structures in a different service will allow us to only query this information when it's needed and
not everytime that we want to interact with a task. Because this is not a core service, we can choose to not use it and disable it if our implementation doesn't require such presentation information.
This service will allow us to define common presentation elements that can be shared among different task definitions.
TaskPresentationService taskPresentationService = container.instance().select(TaskPresentationService.class).get();
//Internally it will use taskDef.getTaskDef(id).getPresentationElements()
List<PresentationElement> presentationElements = taskPresentationService.getPresentationElements(taskId);
h2. Task Assignments Service
The task Assignment service will be in charge of hosting information about task assignments. This information will describe the potentialOwners, excludedOwners, StakeHolders, BusinessAdmins, etc.
All this information will be related with a task definition and not with a task instance. In other words this is about static definitions (doing on modeling time) of the task and not about the
assignments that will be defined at runtime when a Task Instance is created. Having this information decoupled will allow us to define different strategies for validating, querying and interacting with
an external identity service. When a Task instance is created, using this information plus the runtime context and the defined strategies the concrete assigments will be applied to the Task instance.
Instead of store and duplicate assignment information per task , we can reuse the assignments from previously defined tasks.
h2. Task Delegation Service
This service will host different delegation schemas that can be used by the task definitions. Depending on the business scenario were the human interactions will be defined, this service will host common patterns that can be reused by Task Definitions. Instead of store and duplicate delegation/escalation information per task , we can reuse the delegationescalation information from previously defined tasks.
h2. Task Notification Service
The service expose an interface that allows us to define templates for notifications that can be used on Task Deadlines, Lifecycle Events, Callbacks.
h1. Task Instance Service
Once we have a Task Definiton deployed we can start creating instances of a specific Task Definition Type. The instance will use the static information provided
by the task definition to create the new Task Instance. The information about assignments, deadlines and escalations/delegations will be defined inside the Task Definition (which support
expressions) . When a new instance is created all the expressions are resolved and the task will only contain the relevant data for execution. If at runtime more information about the Task Definition is required, the Task Instance Service can use the Task Definition Service internally to get generic information.
The Task Instance Service will expose the life cycle methods to interact with a Task Instance, such as: start, complete, forward, claim, release, etc (WS-HT defined methods).
Internally, the Task Instance Service will contain the core logic to represent the task life cycle.
Having this Service decoupled from the rest will allow us to improve that logic and have a well defined boundary of the module capabilties and responsabilities. Because we are working
to provide a pluggable life cycle mechanism, different Task Instances Services implementation can be provided. Using CDI decorators and qualifiers the API usage will be extremely improved
and it will easily allow us to run the component in any environment (From standalone to EE with major changes).
Sync and Async Services should be modeled using CDI qualifiers instead of different interfaces.
// Lifecycle methods for task instances only!!!!
TaskInstanceService taskInstanceService = taskServiceEntryPoint.getTaskInstanceService();
Map<String, Object> params = new HashMap<String, Object>();
// Instantiate
long taskId = taskInstanceService.newTask("myTaskDef", params);
// Interact
taskInstanceService.start(taskId, "salaboy");
Service Interface:
https://github.com/Salaboy/human-task-poc-proposal/blob/master/human-task... https://github.com/Salaboy/human-task-poc-proposal/blob/master/human-task...
h3.
https://community.jboss.org/servlet/JiveServlet/showImage/18933/TaskServi... https://community.jboss.org/servlet/JiveServlet/downloadImage/18933/TaskS...
As you can see the TaskInstanceService has a couple of important services that will be injected at runtime.
h3. Human Task LifeCycle Manager
The lifeCycleManager will be in charge of defining the lifecycle of each Task Instance. This Manager will be pluggable to allow us to provide different implementations for different needs.
The MVEL Lifecycle Manager reuse the logic that is now contained inside the jbpm-human-task-core module, which loads an MVEL file which contains all the possible states for a TaskInstance.
MVELLifecycleManager simple implementation:
https://github.com/Salaboy/human-task-poc-proposal/blob/master/human-task... https://github.com/Salaboy/human-task-poc-proposal/blob/master/human-task...
Different LifecycleManagers can be provided and the implementation can be decided at configuration time using one simple CDI Qualifier.
For Example:
@Inject @Mvel
private LifecycleManager lifeCycleManager;
h4. Task LifeCycle Events
No matter the LifecycleManager implementation, all of them will require to inform the outside world about the lifecycle events, allowing us to caputure those events for different usages.
We will be able to Log those events, use those events as callbacks mechanisms, make inferences about them, etc.
SEAM3 provides a CDI extension that allows us to get a PersistenceContext and define transactions in SE environments:
http://docs.jboss.org/seam/3/persistence/latest/reference/en-US/html_single/ http://docs.jboss.org/seam/3/persistence/latest/reference/en-US/html_single/
This is what we are doing today manually, they provide a declarative way of defining our transaction policies and the persistence context propagation.
h3. Transaction Strategies
Depending on the Scenario is how the transactions strategies will need to be configured.
Based on CDI qualifiers and interceptors we will be able to provide different implementations that will be selected based on the environment.
Transactions are usually handled as Aspects, which in CDI can be defined using Interceptors. We will be able to select different Interceptors
depending on the environment that we want to run our application. These interceptors will be selected based on quilifiers and they will be injected into the relevant
classes.
h3. Task Instance Structure
The task instance structure will contain only the information required by a Task to run. All the information that belongs to the task definition will not be copied to the
Task Instance structure.
h3. Task Query Service
The task query service provides a set of methods to query Task Instances. Because each task contains a lot of information, a separate service was created to provide a flexible mechanism
to retrive task instance information. Internally it can use multiple service to retrieve the information.
Service Interface:
https://github.com/Salaboy/human-task-poc-proposal/blob/master/human-task... https://github.com/Salaboy/human-task-poc-proposal/blob/master/human-task...
h2. Task Admin Service
The task admin service provides some Administration APIs to do clean ups and keep the storage as free as possible of unneeded data.
Service Interface:
Service Interface:
https://github.com/Salaboy/human-task-poc-proposal/blob/master/human-task... https://github.com/Salaboy/human-task-poc-proposal/blob/master/human-task...
h2. Task Attachment and Comment Services
Both services are decoupled to allow fine grained control on how the attachments are handled and stored. Depending on the context on the task and the architecture we the Human Interactions will happen is how we will want to handle attachments. Providing a decoupled interface for these services will allow us to gradually support different ways to store this information that is related with a specific task instance.
TaskAttachmentService taskAttachmentService = container.instance().select(TaskAttachmentService.class).get();
taskAttachmentService.addAttachment(taskId, attachment);
List<Attachment> attachs = taskAttachmentService.getAttachments(taskId);
TaskCommentService taskCommentService = container.instance().select(TaskCommentService.class).get();
taskCommentService.addComment(taskId, comment);
List<Comment> comments = taskCommentService.getComments(taskId);
taskCommentService.removeComment(commentId);
h2. Task Events, Callbacks, Listeners Service
This service will expose a set of APIs that will allow external applications to register interest and callback functions to a Task Instance or a group of Task Instances (could be also by Task Definition).
When a third party application creates a task inside the human task module, it will automatically becomes the owner of the task. If the application is interested in being notified about the Task Lifecycle or just a small set of events, the application will need to register a callback function or identifier which enables the component to contact back the application. This callbacks and listeners information should be (once again) agnostic to the transport. This information will represent a logic description about how to contact a third party application if it is needed, but several implementations can be plugged to achieve the desired behavior on runtime. We can leverage the Events features of CDI for listeners and callbacks.
Having this service as a decoupled module will allow us to:
* Provide different strategies for different environments
* Allow external components to be notified (pull) or to poll the task events notifications and execute the callbacks for us. Meaning that we expose the information
about what needs to happen but not how it will happen. Reducing the complexity of the component and leveraging already implemented features from frameworks like Switchard / Camel.
h2.
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-18641]
Create a new document in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
12 years, 5 months
[jBPM] - ConcurrentModificationException when LocalTaskService.complete()
by TC ONG
TC ONG [https://community.jboss.org/people/devilkazuya99] created the discussion
"ConcurrentModificationException when LocalTaskService.complete()"
To view the discussion, visit: https://community.jboss.org/message/745977#745977
--------------------------------------------------------------
I am using jbpm 5.1.2 + drools 5.3.0
When I run the code below, SOMETIMES I get the ConcurrentModificationException.
private org.jbpm.task.TaskService localTaskService;
...
localTaskService.complete(task1.getId(), actor, contentData);
...
Here is the exception I encounter.
java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
at java.util.AbstractList$Itr.next(AbstractList.java:343)
at org.jbpm.task.event.MessagingTaskEventListener.taskCompleted(MessagingTaskEventListener.java:72)
at org.jbpm.task.event.TaskEventSupport.fireTaskCompleted(TaskEventSupport.java:47)
at org.jbpm.task.service.TaskServiceSession.postTaskCompleteOperation(TaskServiceSession.java:497)
at org.jbpm.task.service.TaskServiceSession.taskOperation(TaskServiceSession.java:463)
at org.jbpm.task.service.local.LocalTaskService.complete(LocalTaskService.java:73)
Q1: Is it a known bug in this version?
Q2: Is it fixed?
Q3: Can bypass it?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/745977#745977]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[Datasource Configuration] - xa-datasource x creating tables in both database
by Luciano Borges
Luciano Borges [https://community.jboss.org/people/lucianoborges] created the discussion
"xa-datasource x creating tables in both database"
To view the discussion, visit: https://community.jboss.org/message/745889#745889
--------------------------------------------------------------
Hi all,
I'm trying create a two-phase commit application, but, when the JBoss starts the app creates the table on both databases.
My -ds.xml
<datasources>
<xa-datasource>
<jndi-name>PostgreSQLXA1</jndi-name>
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<xa-datasource-property name="ServerName">localhost</xa-datasource-property>
<xa-datasource-property name="PortNumber">5432</xa-datasource-property>
<xa-datasource-property name="DatabaseName">bd1</xa-datasource-property>
<xa-datasource-property name="User">postgres</xa-datasource-property>
<xa-datasource-property name="Password">postgres</xa-datasource-property>
<track-connection-by-tx></track-connection-by-tx>
</xa-datasource>
<xa-datasource>
<jndi-name>PostgreSQLXA2</jndi-name>
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<xa-datasource-property name="ServerName">localhost</xa-datasource-property>
<xa-datasource-property name="PortNumber">5432</xa-datasource-property>
<xa-datasource-property name="DatabaseName">bd2</xa-datasource-property>
<xa-datasource-property name="User">postgres</xa-datasource-property>
<xa-datasource-property name="Password">postgres</xa-datasource-property>
<track-connection-by-tx></track-connection-by-tx>
</xa-datasource>
</datasources>
My persistence.xml
<persistence-unit name="database1-ds" transaction-type="JTA">
<jta-data-source>java:/PostgreSQLXA1</jta-data-source>
<class>example.twophasecommit.domain.Book</class>
<properties>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="false" />
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
</properties>
</persistence-unit>
<persistence-unit name="database1-ds" transaction-type="JTA">
<jta-data-source>java:/PostgreSQLXA2</jta-data-source>
<class>example.twophasecommit.domain.BookSummary</class>
<properties>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="false" />
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
</properties>
</persistence-unit>
Is there something wrong?
Thanks,
Luciano
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/745889#745889]
Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - Error in deploying JBPM 5.3 in JBOSS 5.1
by Arun Selva
Arun Selva [https://community.jboss.org/people/arselv] created the discussion
"Error in deploying JBPM 5.3 in JBOSS 5.1"
To view the discussion, visit: https://community.jboss.org/message/745987#745987
--------------------------------------------------------------
Im trying hornetq human task hander with JBPM 5.3,
If i run it in local it works fine but When i deploy it in JBoss im getting this DuplicateMappingException.
Exception:
2012-07-04 12:51:12,372 WARN [org.hibernate.ejb.Ejb3Configuration] (main) Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
2012-07-04 12:51:12,403 INFO [org.hibernate.cfg.Configuration] (main) Reading mappings from resource : META-INF/jbpmOrm.xml
2012-07-04 12:51:12,418 INFO [org.hibernate.cfg.Configuration] (main) Reading mappings from resource : META-INF/ProcessInstanceInfo.hbm.xml
2012-07-04 12:51:12,559 INFO [org.hibernate.cfg.annotations.QueryBinder] (main) Binding Named query: ProcessInstancesWaitingForEvent => select processInstanceInfo.processInstanceId from ProcessInstanceInfo processInstanceInfo join processInstanceInfo.eventTypes eventTypes where eventTypes = :type
2012-07-04 12:51:12,606 INFO [org.hibernate.cfg.HbmBinder] (main) Mapping class: org.jbpm.persistence.processinstance.ProcessInstanceInfo -> ProcessInstanceInfo
2012-07-04 12:51:12,653 INFO [org.hibernate.cfg.HbmBinder] (main) Mapping collection: org.jbpm.persistence.processinstance.ProcessInstanceInfo.eventTypes -> EventTypes
2012-07-04 12:51:12,668 INFO [org.hibernate.cfg.Mappings] (main) duplicate import: org.jbpm.persistence.processinstance.ProcessInstanceInfo->org.jbpm.persistence.processinstance.ProcessInstanceInfo
2012-07-04 12:51:12,668 INFO [org.hibernate.cfg.Mappings] (main) duplicate import: org.jbpm.persistence.processinstance.ProcessInstanceInfo->ProcessInstanceInfo
2012-07-04 12:51:12,668 INFO [org.hibernate.cfg.HbmBinder] (main) Mapping class: org.jbpm.persistence.processinstance.ProcessInstanceInfo -> ProcessInstanceInfo
2012-07-04 12:51:12,668 INFO [org.hibernate.cfg.HbmBinder] (main) Mapping collection: org.jbpm.persistence.processinstance.ProcessInstanceInfo.eventTypes -> EventTypes
2012-07-04 12:51:12,668 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=persistence.unit:unitName=#org.jbpm.persist.jpa state=Create
org.hibernate.DuplicateMappingException: Duplicate collection role mapping org.jbpm.persistence.processinstance.ProcessInstanceInfo.eventTypes
at org.hibernate.cfg.Mappings.addCollection(Mappings.java:147)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2085)
My Persistent.xml
<persistence-unit name="org.jbpm.persist.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:simpleds</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>
What is that im misssing.?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/745987#745987]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - How to restart process, when process terminated on timer JBPM 5.3
by Ashish Sinha
Ashish Sinha [https://community.jboss.org/people/imtuku] created the discussion
"How to restart process, when process terminated on timer JBPM 5.3"
To view the discussion, visit: https://community.jboss.org/message/746085#746085
--------------------------------------------------------------
Hi,
I am trying to restore process from server crash.
If process hasn't reached to timer event, process is realoaded from old session and continue process calling myWorkItemHandler.completeWorkItem(workItem, manager).
1. Load Old session - stored in file on server startup
kSession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kSession.getKnowledgeBase(),kSession.getSessionConfiguration(), kSession.getEnvironment());myWorkItemHandler.completeWorkItem(workItem, manager)
2. Get the work Item from WorkItem table.
"SELECT o FROM WorkItemInfo AS o WHERE o.processInstanceId = :processId"
3. Once recived workItem, from step 2. call
myWorkItemHandler.completeWorkItem(workItem, manager)
It works fine if the process was terminated at non timer node.
But if the process reaches at timer event, there is no way to follow the same approach as info gets deleted from *WorkItemInfo table. (*It's okie*)*
KSession has singalEvent() method, which indicate I can use to complete or restore timer event, but couldn't get success.
|| *Singal Even : Timer node with ProcessInstanceInfo object* ||
| // Load failed session
kSession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kSession.getKnowledgeBase(),
kSession.getSessionConfiguration(), kSession.getEnvironment());
String type = "TimerEvent"; // or "Timer" as per xml represenation of myProcess.bpmn file
long processInstanceId = 17L;
Object event = getProcessInstanceInfo(processInstanceId);
// Signal timer event,
kSession.signalEvent(type, event, processInstanceId); |
Any idea how to signal this event and what parameter is needed.
Regards
Ash
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/746085#746085]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - jbpm 5.3.final postgres issue
by Miloud Haimoune
Miloud Haimoune [https://community.jboss.org/people/milhaim] created the discussion
"jbpm 5.3.final postgres issue"
To view the discussion, visit: https://community.jboss.org/message/740678#740678
--------------------------------------------------------------
Hi all,
I'm migrating the code of my application to use jbpm latest release (5.3.final). but I'm facing this exception when I create a new process instance :
13:01:13,688 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: 42804
13:01:13,688 ERROR [JDBCExceptionReporter] ERROR: column "processinstancebytearray" is of type oid but expression is of type bytea
Hint: You will need to rewrite or cast the expression.
Position: 149.
I found a post wich advises to use a recent version of hibernate 3.6.final. but I m using jboss 5.1 which provides hibenate 3.1 and I don't think it's very wise hibernate (used by another application).
the some code was working fine with JBPM 5.2.final
if you have any solution ??
many thanks
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/740678#740678]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months