[JBoss Messaging] - defining/creating messaging Queue through @ActivationConfigP
by yashendrac
I wonder if it is mandatory to define Queues and Topics in xml in JBoss Messaging. Is there any way to make it work the way it used to in Jboss MQ, i.e. just use the @ActivationConfigProperty annotation in message consumer/MDB without defining in any xml?
In jboss MQ I don't have to define Queues and Topics in any configuration xml if I have @ActivationConfigProperty annotation in my MDB like this:
@MessageDriven(activationConfig = {
| @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
| @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
| @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),
| @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/event"),
| @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "Alarm = FALSE")})
|
But after moving same code to Jboss Messaging my MDB is not able to find the specified Queue in that MDB
@ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/event")
I am able to resolve this problem by defining all my Queues and Topics in destination-service.xml located under deploy/messaging/destination-service.xml.
But I don't want to configure these in any xml outside of my application and would prefer using annotation in class itself.
Any suggestion would be highly appreciated.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244325#4244325
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244325
17 years
[JBoss jBPM] - Re: Caused by: javax.resource.ResourceException: Transaction
by Randysv
My process definition is below.
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="ACLUpdate">
|
|
| <swimlane name="RequesterClerk"></swimlane>
|
|
| <start-state name="ACLRequestStart">
| <transition to="ACL Approval" name="ToAclApproval"></transition>
| <event type="node-leave">
| <action name="CheckForProcessVariables" class="us.secureall.workflow.handler.action.CheckForProcessVariablesAction"></action>
| </event>
| </start-state>
|
|
| <task-node name="ACL Approval" create-tasks="true" async="true">
| <task blocking="true" name="ApproveACL">
| <assignment class="us.secureall.workflow.handler.assignment.ACLUpdateAssignmentHandler"></assignment>
| <timer duedate="5 seconds" transition='TimedOut'>
| <action class="us.secureall.workflow.handler.action.ApproveACLTimeOutActionHandler">
| </action>
| </timer>
| </task>
| <transition to="ApprovalNotification" name="aclapproved"></transition>
| <transition to="TimeOutNotification" name="TimedOut"></transition>
| </task-node>
|
| <state name="ApprovalNotification">
| <transition to="ACLRequestEnd" name="ApprovalToEnd"></transition>
| </state>
|
| <state name="TimeOutNotification">
| <transition to="ACLRequestEnd" name="TimeOutToEnd"></transition>
| </state>
|
|
| <end-state name="ACLRequestEnd"></end-state>
|
|
| </process-definition>
|
The timer ejb fires successfully and my ApproveACLTimeOutActionHandler is called. But then I get the exception and the transition out of the Task Node does not happen.
Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57fd96:cdc8:4a5a8010:b3d status: ActionStatus.ABORT_ONLY >
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:370)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
... 70 more
Why is the transaction not active anymore? I don't see any exception in my code. I hardy do anything in my ApproveACLTimeOutActionHandler other than do a System.out. This seems to be a pretty common problem and it is probably JBoss' issue. A whole lot of people seem to have this issue, but there is no explanation anywhere.
This is the piece of jboss' code where it is checking if the transaction is active and throwing an exception if it is node
Transaction tx = tm.getTransaction();
| if (tx != null && TxUtils.isActive(tx) == false)
| throw new ResourceException("Transaction is not active: tx=" + tx);
| if (!interleaving)
| trackByTransaction = tx;
|
Please help if anybody has a fix for this issue.
TIA,
Randy
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244304#4244304
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244304
17 years