jms - JBoss MDB - JMSBytesMessage class cast exception -
i'm working on ejb3 mdb listen mq queue in distant server. working fine (mdb triggered when message put listenned queue) except treatment done mdb. information, use wmq resource adapter map queue.
into method 'onmessage' of mdb, try cast given message class 'com.ibm.jms.jmsbytesmessage', strange error message.
the code following 1 (simple example):
public void onmessage(message themessage) { ((jmsbytesmessage) themessage).readbytes(mybytes); }
and exception message:
exception while reading input request: com.ibm.jms.jmsbytesmessage incompatible com.ibm.jms.jmsbytesmessage
ok, the message received should (and is) type 'com.ibm.jms.jmsbytesmessage', why application doesn't work ? should possible jboss server use version of library 'com.ibm.mqjms.jar' (including jmsbytesmessage class) , cause kind of error ?
ps: i've deployed application on jboss server version 4.2.3 under linux system. i've make application work on local machine same version of jboss server under window system (same configuration, same libraries, etc.)
does have idea reason of such error ?
thanks in advance help.
regards,
edit: solution: cast javax.jms.bytesmessage instead of com.ibm.jms.jmsbytesmessage
might reproduce comment answer:
don't cast mq-specific com.ibm.jms.jmsbytesmessage
, cast jms-standard javax.jms.bytesmessage
. coupling code implementation-specific types counter jms tries achieve.
Comments
Post a Comment