This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need guidance on Introduction to Spring JMS Active MQ - icoding club  RSS feed

 
Prem Mehrotra
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am following ar blog which is very good for someone like me who wants to get into Spring, JMS and ActiveMQ…
http://icodingclub.blogspot.com/2011/07/introduction-of-spring-jms-with.html

When I run TestJMSListener as a java application, I am getting following error:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in class path resource [com/jms/helloworld/config/JMSConfig.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'brokerurl' of bean class [org.apache.activemq.ActiveMQConnectionFactory]: Bean property 'brokerurl' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

I do not know how to fix it, below is my JMSConfig.xml file:

<beans xmlns:jms="http://www.springframework.org/schema/jms"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jms
http://www.springframework.org/schema/jms/spring-jms-3.0.xsd">
<bean class="org.apache.activemq.command.ActiveMQQueue" id="destination">
<constructor-arg value="TEST.Q1"></constructor-arg>
</bean>
<bean class="org.apache.activemq.ActiveMQConnectionFactory" id="connectionFactory"
p:brokerurl="tcp://localhost:61616"></bean>
<bean class="com.jms.helloworld.listner.MessageListenerImpl" id="simpleMessageListener"> </bean>
<bean class="org.springframework.jms.listener.DefaultMessageListenerContainer" id="jmsContainer">
<property name="connectionFactory" ref="connectionFactory"></property>
<property name="destination" ref="destination"></property>
<property name="messageListener" ref="simpleMessageListener"></property>
</bean>
</beans>


Thanks a lot.

Also which are good java forums where I can get help on something like this.


Prem
 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Welcome to the ranch!

Here is the docs:
http://activemq.apache.org/maven/apidocs/org/apache/activemq/ActiveMQConnectionFactory.html

There is no property named brokerurl:


Invalid property 'brokerurl' of bean class [org.apache.activemq.ActiveMQConnectionFactory]: Bean property 'brokerurl' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?


The correct name for the property is brokerURL, with uppercase letters for "URL". Just replace brokerurl for brokerURL in your config file.
 
Prem Mehrotra
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much, you resolved my problem. It shows you power of these forums, otherwise I would have struggled for days.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!