Author |
Message
|
gaara |
Posted: Mon Sep 10, 2007 1:29 am Post subject: 1 MDB/Queue - delivery problem |
|
|
Newbie
Joined: 10 Sep 2007 Posts: 2
|
Hi guys,
I have the following problem:
1. I deployed the new JCA adapter (6.0.2.1) on glassfish AppServer - > OK
2. I deployed a configured Web Application which used this JCA adapter and tried to test how to lookup/connect/get/post messages etc. -> OK
3. I deployed an MD Bean to the appserver to try to test that too, and when I put 1 msg to the queue the processing was fine, but when i put multiple msgs to the queue i allways see an interesting message in the server log:
WMQ Resource Adapter warning: MQJCA4004: message delivery to an MDB failed. See the linked exception for details.
(I cant see any detailed exception in the log...)
In the MDB cofiguration i set the following parameters:
@ActivationConfigProperty(propertyName = "destination", propertyValue = "OFIK.TOMI.TESZT"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "maxMessages", propertyValue = "1"),
@ActivationConfigProperty(propertyName = "maxPoolSize", propertyValue = "1"),
@ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "false")
(I want to process the messages in the queue one by one)
The QueueCF config is:
<activation-config-property>
<activation-config-property-name>CCSID</activation-config-property-name>
<activation-config-property-value>1208</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>hostName</activation-config-property-name>
<activation-config-property-value>193.6.241.84</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>port</activation-config-property-name>
<activation-config-property-value>1454</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>username</activation-config-property-name>
<activation-config-property-value>mqm</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>password</activation-config-property-name>
<activation-config-property-value>xxx20</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>queueManager</activation-config-property-name>
<activation-config-property-value>FIRBRK.T</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>channel</activation-config-property-name>
<activation-config-property-value>SYSTEM.DEF.SVRCONN</activation-config-property-value>
</activation-config-property>
What i saw in the server log is: The server tries to deliver all of the messages but there is only one processing MDB so 1 msg is processed and all the other sent back to Queue. Than after a while the server tries to redeliver the msg-s again. It process one again and send back all other msgs. So after a while all msgs were gone from the queue, but I had the upper WARNING message allways in the log.
This is really annoying for me, so can somebody help me what can be the problem? If u need any kind of log/config file just ask and i link those into the topic.
Thx,
// Gaara |
|
Back to top |
|
 |
Vitor |
Posted: Mon Sep 10, 2007 1:38 am Post subject: Re: 1 MDB/Queue - delivery problem |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
gaara wrote: |
WMQ Resource Adapter warning: MQJCA4004: message delivery to an MDB failed. See the linked exception for details.
(I cant see any detailed exception in the log...)
|
You need to extract the linked exception to obtain the MQ reason code. It's a thing you do in the catch block. There are example code snippits which a search will turn up I'm sure.
(I'm not a Java person) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
gaara |
Posted: Mon Sep 10, 2007 1:54 am Post subject: |
|
|
Newbie
Joined: 10 Sep 2007 Posts: 2
|
I dont want to put back anything to the queue after the MDB started the processing so my code looks like this:
public void onMessage(Message message) {
log.info("New data here...");
try {
...
// business logic
...
} catch (JMSException jmse) {
log.warn("JMS exception ... bla bla: ", jmse);
} catch (JAXBException jaxbe) {
log.warn("JAXB exception ... bla bla : ", jaxbe);
} catch (Exception e) {
log.error("Any other exception: ", e);
} finally {
log.warn("Container processing is finished.");
}
}
I think this catch every exception in the processing block... and i can see if the processing is started... but it works fine... it process only one message in any moment, and i see that it starts processing the msg, and finish it succesfully. How can i get that exception? Where does it happens? I think this is a configuration problem somewhere in my MDB or maybe a bug?
Do u have any idea what cause my problem?
BR,
// Gaara |
|
Back to top |
|
 |
Vitor |
Posted: Mon Sep 10, 2007 2:05 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
gaara wrote: |
Do u have any idea what cause my problem? |
There are a number of possibilities including a code error with the commit point, but until you obtain the linked exception with the MQ reason code it's very hard to be definitive. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Sep 10, 2007 2:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
gaara wrote: |
I dont want to put back anything to the queue after the MDB started the processing so my code looks like this:
public void onMessage(Message message) {
log.info("New data here...");
try {
...
// business logic
...
} catch (JMSException jmse) {
log.warn("JMS exception ... bla bla: ", jmse);
LinkedException le =jmse.getLinkedException();
if (le != null)log.error(le.getMessage());
} catch (JAXBException jaxbe) {
log.warn("JAXB exception ... bla bla : ", jaxbe);
} catch (Exception e) {
log.error("Any other exception: ", e);
} finally {
log.warn("Container processing is finished.");
}
}
I think this catch every exception in the processing block... and i can see if the processing is started... but it works fine... it process only one message in any moment, and i see that it starts processing the msg, and finish it succesfully. How can i get that exception? Where does it happens? I think this is a configuration problem somewhere in my MDB or maybe a bug?
Do u have any idea what cause my problem?
BR,
// Gaara |
_________________ MQ & Broker admin |
|
Back to top |
|
 |
dboeckli |
Posted: Fri Apr 11, 2008 12:35 am Post subject: |
|
|
Newbie
Joined: 03 Jun 2004 Posts: 9
|
i have exactly the same problem. To get more information I enabled the trace in the ra.xml file:
<config-property>
<config-property-name>traceEnabled</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>true</config-property-value>
</config-property>
Now I get little bit more information but I am still lost:
Code: |
2008-04-11 10:31:13,763 489790 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) [11/04/08 10:31:13:763 CEST.0] WorkManager(2)-446 MQJCA4004:Message delivery to an MDB failed. See the linked exception for details.
2008-04-11 10:31:13,763 489790 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) javax.ejb.EJBException: Failed to acquire the pool semaphore, strictTimeout=10000
2008-04-11 10:31:13,763 489790 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at org.jboss.ejb3.StrictMaxPool.get(StrictMaxPool.java:122)
2008-04-11 10:31:13,764 489791 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
2008-04-11 10:31:13,764 489791 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
2008-04-11 10:31:13,764 489791 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:245)
2008-04-11 10:31:13,764 489791 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:268)
2008-04-11 10:31:13,764 489791 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:138)
2008-04-11 10:31:13,764 489791 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at $Proxy187.toString(Unknown Source)
2008-04-11 10:31:13,765 489792 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at java.lang.String.valueOf(String.java:2615)
2008-04-11 10:31:13,765 489792 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at java.lang.StringBuffer.append(StringBuffer.java:220)
2008-04-11 10:31:13,765 489792 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at com.ibm.mq.connector.inbound.MessageEndpointWrapper.setEndpoint(MessageEndpointWrapper.java:87)
2008-04-11 10:31:13,765 489792 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at com.ibm.mq.connector.inbound.WorkImpl.run(WorkImpl.java:131)
2008-04-11 10:31:13,765 489792 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
2008-04-11 10:31:13,765 489792 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
2008-04-11 10:31:13,766 489793 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
2008-04-11 10:31:13,766 489793 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) at java.lang.Thread.run(Thread.java:595)
|
|
|
Back to top |
|
 |
Vitor |
Posted: Fri Apr 11, 2008 12:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
dboeckli wrote: |
i have exactly the same problem. To get more information I enabled the trace in the ra.xml file: |
I stand by what I said all those months ago; without the reason code from the linked exception it could be any of a number of things. The trace you've enabled to get more information has only produced one thing of real use:
dboeckli wrote: |
2008-04-11 10:31:13,763 489790 INFO [com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) [11/04/08 10:31:13:763 CEST.0] WorkManager(2)-446 MQJCA4004:Message delivery to an MDB failed. See the linked exception for details.
|
Your next move is clear. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
dboeckli |
Posted: Fri Apr 11, 2008 12:56 am Post subject: |
|
|
Newbie
Joined: 03 Jun 2004 Posts: 9
|
This is just the problem: It is not clear how to get the linked exception (or reason code) because the exception is thrown deep inside the IBM-JCA-connector code and is not forwarded to the client code. So there is no way to catch the exception in the client code. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Apr 11, 2008 1:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
dboeckli wrote: |
It is not clear how to get the linked exception (or reason code) because the exception is thrown deep inside the IBM-JCA-connector code and is not forwarded to the client code. |
If the problem is in the IBM code (and relevent diagnostics not being available is a problem in itself) then it's PMR time.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
dboeckli |
Posted: Fri Apr 11, 2008 1:11 am Post subject: |
|
|
Newbie
Joined: 03 Jun 2004 Posts: 9
|
the error messages from the trace gave me the solution:
Code: |
[com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl.WSMQQueueConnectionFactory] (WorkManager(2)-446:) javax.ejb.EJBException: Failed to acquire the pool semaphore, strictTimeout=10000
|
I increased the maxConnections property in the ra.xml from the IBM original value from 10 to 50 and now it works. The question is now why this settings worked for ejb2.1 and makes problems with ejb3.[/code] |
|
Back to top |
|
 |
Vitor |
Posted: Fri Apr 11, 2008 1:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
dboeckli wrote: |
I increased the maxConnections property in the ra.xml from the IBM original value from 10 to 50 and now it works. |
Well done you!
dboeckli wrote: |
The question is now why this settings worked for ejb2.1 and makes problems with ejb3.[/code] |
And this question again is a valid subject for a PMR.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Apr 11, 2008 2:42 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Well a few pointers you might want to consider:
A) read the JMS Topologies redbook. It may be old but is still very relevant here
B) you never indicated anything about an ExceptionListener being added
C) The monitoring on the AppServer should have shown somewhere a resource starvation in the JMS pool.
Of course nobody thought to even check those elementary J2EE things.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
dboeckli |
Posted: Sun Apr 13, 2008 11:28 pm Post subject: |
|
|
Newbie
Joined: 03 Jun 2004 Posts: 9
|
Here the facts:
- the project I was talking, was a well running EJB2.1 project.
- i converted it to a EJB3.0 project. There is no change in the business logic.
- the EJB3.0 hat the mentioned error.
Further investigation are on the way and are going this direction:
Why is the pooling bad for the EJB3.0 and is working for the EJB2.1 project? |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Apr 14, 2008 2:41 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Different default pool size and growth rate/policy? _________________ MQ & Broker admin |
|
Back to top |
|
 |
|