Announcement Announcement Module
Collapse
No announcement yet.
Proxy error using JmsTemplate and MQ Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Proxy error using JmsTemplate and MQ

    Hi all

    I am using the JMSTemplate102 to grab a message off the queue.
    The queue itself is an MQQueue running on WebSphere.
    I get the following exception when trying to receive() from the JmsTemplate.

    Exception in thread "P=386473:O=0:CT" java.lang.IllegalArgumentException: object is not an instance of declaring class
    at java.lang.reflect.Method.invoke(Native Method)
    at org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:287)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:163)
    at $Proxy0.createQueueConnection(Unknown Source)
    at org.springframework.jms.core.JmsTemplate102.create Connection(JmsTemplate102.java:154)
    at org.springframework.jms.core.JmsTemplate.execute(J msTemplate.java:636)
    at org.springframework.jms.core.JmsTemplate.receive(J msTemplate.java:805) at au.com.application.myapp.domain.dao.hibernate.MyDa o.receive(MyDao.java:88)
    at au.com.application.myapp.service.MyService.readMes sage(MyService.java:77)
    at java.lang.reflect.Method.invoke(Native Method)
    at org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:287)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:155)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :122)
    at au.com.component.foundation.aop.AuditTrailAdvice.i nvoke(AuditTrailAdvice.java:42)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :144)
    at org.springframework.aop.framework.adapter.MethodBe foreAdviceInterceptor.invoke(MethodBeforeAdviceInt erceptor.java:53)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :144)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:174)
    at $Proxy2.readMessage(Unknown Source)
    at au.com.application.myapp.facade.daemon.Daemon.star tMainLoop(Daemon.java:95)
    at au.com..application.myapp.facade.daemon.Daemon.mai n(Daemon.java:46)

    My applicationContext :

    <bean id="ptlConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiTemplate">
    <ref bean="au-com-component-foundation-ejbJndiTemplate" />
    </property>
    <property name="jndiName">
    <value>ptl/PTLQCF</value>
    </property>
    <property name="proxyInterface">
    <value>javax.jms.QueueConnectionFactory</value>
    </property>
    </bean>

    <bean id="ptlAccountQueue" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiTemplate">
    <ref bean="au-com-component-foundation-ejbJndiTemplate" />
    </property>
    <property name="jndiName">
    <value>ptl/ACCOUNT_UPDATEQ.HZN</value>
    </property>
    <property name="proxyInterface">
    <value>javax.jms.Queue</value>
    </property>

    </bean>
    <!-- SERVICE LAYER -->
    <bean id="au-com-application-myApp-service-myService"
    class="au.com.application.myapp.service.MyService" >
    <property name="myDao">
    <ref local="au-com-application-myapp-domain-dao-hibernate-myDao"/>
    </property>
    </bean>
    <!--DATA ACCESS LAYER-->
    <bean id="au-com-application-myapp-domain-dao-hibernate-myDao" class="au.com.application.myapp.domain.dao.hiberna te.MyDao">
    <constructor-arg index="0">
    <ref local="ptlConnectionFactory"/>
    </constructor-arg>
    <constructor-arg index="1">
    <ref local="ptlAccountQueue"/>
    </constructor-arg>
    </bean>

    Can anyone enlighten me as to whats happenening when the Proxy class calls createQueueConnection ... It seems it's trying to resolve the proxy but isnt able to do so.

    Any help would be much appreciated.
Working...
X