ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Classcast exception when receive pubsub message via MDB

Post new topic  Reply to topic
 Classcast exception when receive pubsub message via MDB « View previous topic :: View next topic » 
Author Message
DirkMaes
PostPosted: Fri Jun 08, 2007 2:39 am    Post subject: Classcast exception when receive pubsub message via MDB Reply with quote

Newbie

Joined: 08 Jun 2007
Posts: 5

Hi,

We have a set up of Event Broker 5 in combination with WAS ND 6. We use Event Broker to perform pub/sub of multicast and unicast messages.

For the record: I have no knowledge of Event Broker
We are currently able to perform pub/sub operations via pure standalone java classes but we receive classcast exceptions when trying to listen for the same messages via a message driven bean.

The configuration

I created a message driven bean which implements the onMessage method like this:
public void onMessage(javax.jms.Message msg) {
System.out.println(msg.getClass().getName());
}

Quite simple as you can see.

As deployment descriptor we have


<message-driven id="CacheListener">
<ejb-name>CacheListener</ejb-name>
<ejb-class>com.fortis.be.s06.dnfo.common.cache.framework.ejb.CacheListenerBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Topic</destination-type>
<subscription-durability>NonDurable</subscription-durability>
</message-driven-destination>
</message-driven>

Plus we have defined the transation settings as follow

<container-transaction>
<method>
<ejb-name>CacheListener</ejb-name>
<method-name>onMessage</method-name>
<method-params>
<method-param>javax.jms.Message</method-param>
</method-params>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>


I configured a message listener port with the default settings and added the custom property NON.ASF.RECEIVE.TIMEOUT=10

I configured a WebSphere MQ topic connection factory where a set the parameters
host, port
transport type to DIRECT
enable multicast transport to DISABLED

The settings for the WebSphere MQ topic destination are
Non persistent, target client = JMS and Enable multicast transport = DISABLED

The behaviour
First of all our application no longer start correctly when we start the application server. The following error is received (during the last steps of the startup):

MDBListenerIm I WMSG0043I: MDB Listener CacheListenerPort stopped for JMSDestination dnfo/unicast/topic/cache
MDBListenerIm I WMSG0058I: Listener Port CacheListenerPort will attempt to restart in 60 seconds
ApplicationMg E WSVR0101W: An error occurred starting, BE_FORTIS_DNFO-ServerEar
ApplicationMg A WSVR0217I: Stopping application: BE_FORTIS_DNFO-ServerEar

When we restart the application manually (while the server is already running). The application starts without a problem.

When we publish a message via a standalone java client we always receive a classcast exception

[08/06/07 11:27:52:083 CEST] 00000031 LocalTranCoor E WLTC0017E: Resources rolled back due to setRollbackOnly() being called.
[08/06/07 11:27:52:442 CEST] 00000030 SystemOut O INSIDE EJBCREATE of CACHELISTENERBEAN
[08/06/07 11:27:52:442 CEST] 00000030 ServerSession W WMSG0031E: Exception processing JMS Message for MDB CacheListener, JMSDestination dnfo/unicast/topic/cache : java.lang.ClassCastException: com.fortis.be.s06.dnfo.common.cache.framework.ejb.CacheListenerBean
at com.ibm.ejs.jms.listener.ServerSession.contact admin(ServerSession.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java(Inlined Compiled Code))
at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java(Compiled Code))
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java(Compiled Code))
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1471)

[08/06/07 11:27:53:458 CEST] 00000030 ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "onMessage" on bean "BeanId(BE_FORTIS_DNFO-ServerEar#BE_FORTIS_DNFO-EjbCommon.jar#CacheListener, null)". Exception data: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java(Compiled Code))
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java(Compiled Code))
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1471)
Caused by: java.lang.ClassCastException: com.fortis.be.s06.dnfo.common.cache.framework.ejb.CacheListenerBean
at com.ibm.ejs.jms.listener.ServerSession.contact admin(ServerSession.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java(Inlined Compiled Code))
... 8 more


I have the impression that we are not yet inside the onMessage method of our bean but that the failure happens before the actual call to our method.

Is there something that we have forgotten to configure? Do I have to configure something specifically on Event Broker for this to work?

I wasn¡¦t able to find a good document that explained the configuration for using MDB in combination with Event Broker multicast/unicast.

Version of WAS is:

Name IBM WebSphere Application Server
Version 6.0.2.17
ID BASE
Build Level cf170648.10
Build Date 11/29/06


Thanks a lot for you input. I certainly need it ļ


Dirk
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Jun 08, 2007 2:41 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

There will be other errors, earlier in the startup, that tell you why the MDB Listener port failed.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
DirkMaes
PostPosted: Fri Jun 08, 2007 5:18 am    Post subject: Reply with quote

Newbie

Joined: 08 Jun 2007
Posts: 5

I checked the logfiles and I could not find another error before the lines

MDBListenerIm I WMSG0043I: MDB Listener CacheListenerPort stopped for JMSDestination dnfo/unicast/topic/cache
MDBListenerIm I WMSG0058I: Listener Port CacheListenerPort will attempt to restart in 60 seconds
ApplicationMg E WSVR0101W: An error occurred starting, BE_FORTIS_DNFO-ServerEar


Just two informational messages that might mean something

SibMessage I [:] CWSIU0000I: Release: WAS602.SIB Level: o0641.02
SibMessage I [:] CWSID0006I: The SIB service was not enabled and will not be started.

But are unclear to me

Dirk
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Jun 08, 2007 5:34 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Are you using SIBus? Or WebSphere MQ? Or some other provider?

Is this a new server config? Or an existing one? Is it a new application? Or an update to an existing (and previously working) application?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
DirkMaes
PostPosted: Fri Jun 08, 2007 8:00 am    Post subject: Reply with quote

Newbie

Joined: 08 Jun 2007
Posts: 5

I most tell you that I have no idea what the SIBus is. I investigate

We are not using WebSphere MQ only WebSphere Event Broker via direct tcp/IP transport

I did no configurations inside WAS for messaging except the listener port, connection facory and topic destination.

The server is actually installed via RAD 6. But I did run the latest fix pacs on the base 6 ND server. The application works fine when I remove the MDB from the deployment descriptor. It is just when I add the MDB that the server fails to start. The listener port is running fine as well.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Classcast exception when receive pubsub message via MDB
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.