我按照网上的资料搭建了spring节点,如下:<bean id ="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean" >
     <property name = "jndiName" >
     <value>topic/test</value>
     </property>
</bean>
<bean id="jmsQueue" class = "org.springframework.jndi.JndiObjectFactoryBean" >
     <property name = "jndiName">
     <value>topic/test</value>
     </property>
</bean>
然后启动会出错:10:04:35,039 INFO  [STDOUT] 10:04:35,039 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsTemplate' defined in ServletContext resource [/WEB-INF/classes/dispatcher-servlet.xml]: Cannot create inner bean 'org.springframework.jms.connection.SingleConnectionFactory#6f403e' of type [org.springframework.jms.connection.SingleConnectionFactory] while setting bean property 'jmsConnectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jms.connection.SingleConnectionFactory#6f403e' defined in ServletContext resource [/WEB-INF/classes/dispatcher-servlet.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.jboss.mq.SpyTopic] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.jboss.mq.SpyTopic] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory': no matching editors or conversion strategy found
Caused by: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jms.connection.SingleConnectionFactory#6f403e' defined in ServletContext resource [/WEB-INF/classes/dispatcher-servlet.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.jboss.mq.SpyTopic] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.jboss.mq.SpyTopic] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory': no matching editors or conversion strategy found
Caused by: 
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.jboss.mq.SpyTopic] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.jboss.mq.SpyTopic] to required type [javax.jms.ConnectionFactory] for property 'targetConnectionFactory': no matching editors or conversion strategy found
Caused by: ............我感觉jndiName似乎是写错了,因为网上资料对于
<property name = "jndiName" >
     <value>topic/test</value>大多都没有解释,而我jboss的conf下的jndi.properties中也没有jndiname的设置,因此不知道value应该填写什么,就直接把jboss中设定的jms的name写上去了。我也不晓得是不是这个错,大家来说说看帮帮小弟啊!!!!