I am trying to get a JMS queue to work in JBoss, but I keep getting an error.
I am working off of the example here, but when I start up JBoss I get the following:
The AppCtx defining the beans in question look like:Code:4:26:28,464 INFO [STDOUT] 14:26:28,459 ERROR [ContextLoader] Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'listenerContainer' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (2) are: PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.jboss.mq.SpyConnectionFactory] to required type [javax.jms.ConnectionFactory] for property 'connectionFactory'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.jboss.mq.SpyConnectionFactory] to required type [javax.jms.ConnectionFactory] for property 'connectionFactory': no matching editors or conversion strategy found PropertyAccessException 2: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.jboss.mq.SpyQueue] to required type [javax.jms.Destination] for property 'destination'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.jboss.mq.SpyQueue] to required type [javax.jms.Destination] for property 'destination': no matching editors or conversion strategy found Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (2) are: PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.jboss.mq.SpyConnectionFactory] to required type [javax.jms.ConnectionFactory] for property 'connectionFactory'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.jboss.mq.SpyConnectionFactory] to required type [javax.jms.ConnectionFactory] for property 'connectionFactory': no matching editors or conversion strategy found ...
And the Queue is defined as such:Code:<bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiTemplate"> <ref bean="jndiTemplate" /> </property> <property name="jndiName"> <value>UIL2ConnectionFactory</value> </property> </bean> <!-- JMS Destination --> <bean id="destination" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiTemplate"> <ref bean="jndiTemplate" /> </property> <property name="jndiName"> <value>queue/HashGrabberQueue</value> </property> </bean> <!-- this is the Message Driven POJO (MDP) --> <bean id="messageListener" class="com.codechimp.hashgrabber.HashProcessor" /> <!-- and this is the message listener container --> <bean id="listenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer102"> <property name="concurrentConsumers" value="1" /> <property name="connectionFactory" ref="connectionFactory" /> <property name="destination" ref="destination" /> <property name="messageListener" ref="messageListener" /> </bean>
I am not sure what I am doing wrong here, but I would like to understand.Code:<server> <!-- Destination without a configured SecurityManager or without a a SecurityConf will default to role guest with read=true, write=true, create=false. --> <mbean code="org.jboss.mq.server.jmx.Queue" name="jboss.mq.destination:service=Queue,name=HashGrabberQueue"> <depends optional-attribute-name="DestinationManager"> jboss.mq:service=DestinationManager </depends> </mbean> </server>
Edit: If someone could just point me in the direction of a better guide for doing JMS in JBoss 4.x using Spring 2.0 that would be awesome.
Edit 2:
I have tried SEVERAL things, and was hoping someone could point me in the right direction by now. Obviously the problem I am having stems from the fact the "ConnectionFactory" I am getting from JNDI is not of the right class type...this I know. What I don't know is how/where to get the right type. So far I have tried the following:
- I changed the JndiObjectFactoryBean to lookup "java:/JmsXA", which identifies itself as class type org.jboss.resource.adapter.jms.JmsConnectionFactor yImpl. This throws the same sort of conversion exception as before.
- I tried copying the Bean setup in a different post that used a org.springframework.jms.connection.SingleConnectio nFactory, but it complains with the same error about conversion.
- I tried looking up all things in JNDI named ConnectionFactory or with ConnectionFactory as part of its classname somewhere, and the only ones I have is either the org.jboss.mq.SpyConnectionFactory, org.jboss.mq.SpyXAConnectionFactory, or org.jboss.resource.adapter.jms.JmsConnectionFactor yImpl. Nothing else seems to identify its class type as a "ConnectionFactory" thats not one of those 3 things.
I am really getting desparate here. I will take any leads anyone can give me, but I honestly feel I have expended all my possibilities up to this point.


Reply With Quote
