I'm using JBoss 4.0.3SP1 and Spring Framework 1.2.7.
Proxying of mq destinations is impossible because of lack of Interface for
SpyDestination.class
Even proxying with CGLib won't work because SpyDestination.class has no public
constructor.
Following configuration:
<bean id="deadLetterQueue"
class="org.springframework.jndi.JndiObjectFactoryBean">
| <property name="jndiName" value="queue/DLQ" />
| <property name="cache" value="false" />
| <property name="proxyInterface" value="javax.jms.Queue" />
| </bean>
produces output:
org.springframework.jms.InvalidDestinationException: Destination is not an
instance of SpyDestination QUEUE.DLQ; nested exception is
javax.jms.InvalidDestinationException: Destination is not an instance of
SpyDestination QUEUE.DLQ; nested exception is
javax.jms.InvalidDestinationException: Destination is not an instance of
SpyDestination QUEUE.DLQ
javax.jms.InvalidDestinationException: Destination is not an instance of
SpyDestination QUEUE.DLQ
at org.jboss.mq.SpyMessageProducer.send(SpyMessageProducer.java:225)
at org.jboss.mq.SpyMessageProducer.send(SpyMessageProducer.java:212)
at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:519)
at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:504)
at org.springframework.jms.core.JmsTemplate$2.doInJms(JmsTemplate.java:479)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:432)
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:477)
at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:543)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
changing proxyInterface to: javax.jms.Destination
<bean id="responseQueue" class="org.springframework.jndi.JndiObjectFactoryBean"
lazy-init="false">
| <property name="jndiName" value="queue/konektor_out" />
| <property name="cache" value="false" />
| <property name="proxyInterface" value="javax.jms.Destination" />
| </bean>
produces following output:
java.lang.ClassCastException: $Proxy1
at org.jboss.mq.SpySession.createProducer(SpySession.java:657)
at
org.springframework.jms.core.JmsTemplate.doCreateProducer(JmsTemplate.java:807)
at org.springframework.jms.core.JmsTemplate.createProducer(JmsTemplate.java:788)
at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:498)
at org.springframework.jms.core.JmsTemplate$2.doInJms(JmsTemplate.java:479)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:432)
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:477)
at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:543)
can anyone tell is it possible to change behaviour of this code:
SpyMessageProducer.class
if (destination == null || (destination instanceof SpyDestination) == false)
| throw new InvalidDestinationException("Destination is not an
instance of SpyDestination " + destination);
if SpyDestination was an interface in the code above, everything would be fine.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3933278#3933278
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3933278
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user