You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Timothy R J Langford <ti...@multicom.co.uk> on 2007/01/17 12:02:52 UTC

org.apache.activemq.spring.SpringProducer Jar

Hi All,

I a having problems getting the simple Spring configuration example to
work. I have the latest stable version of ActiveMQ and have set all the
jars on my classpath. However, I get the following error:


org.springframework.beans.factory.CannotLoadBeanClassException: Cannot
find class [org.apache.activemq.spring.SpringProducer] for bean with
name 'producer' defined in file
[/home/tim/versioned/orion_svn/dev/FAB2/Release/fab2/Services/Trips/beans.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.activemq.spring.SpringProducer
Caused by: 
java.lang.ClassNotFoundException:
org.apache.activemq.spring.SpringProducer


Can someone tell me which jar this class lives in? I dont seem to able
to find it.

Thanks,

Tim


Re: org.apache.activemq.spring.SpringProducer Jar

Posted by James Strachan <ja...@gmail.com>.
On 1/17/07, Tim Langford <ti...@multicom.co.uk> wrote:
>
> Yes! I see I have been foolish. Still at least this thread will document it
> for others like me! Thanks for putting me straight It can be tricky when
> learning various new techs at once and jars still drive me mad.
>
> Just a final quick point FYI is that my downloaded binary version of
> ActiveMQ did not seem to contain the SpringProducer test class. I dont know
> wether this is intentional or not. I expect it is.

Yeah - the test class only exists in source form for running the unit tests.

-- 

James
-------
http://radio.weblogs.com/0112098/

Re: org.apache.activemq.spring.SpringProducer Jar

Posted by Tim Langford <ti...@multicom.co.uk>.
Yes! I see I have been foolish. Still at least this thread will document it
for others like me! Thanks for putting me straight It can be tricky when
learning various new techs at once and jars still drive me mad.

Just a final quick point FYI is that my downloaded binary version of
ActiveMQ did not seem to contain the SpringProducer test class. I dont know
wether this is intentional or not. I expect it is.





James.Strachan wrote:
> 
> On 1/17/07, Tim Langford <ti...@multicom.co.uk> wrote:
>>
>> Oh Dear! I see now, this is a pojo using a Spring template isnt it? (it
>> is
>> actually commented in the config - sorry)
>>
>> Deepest apologies. The confusion with the validation and path/name of
>> class
>> confused my poor brain!
> 
> :)
> 
> Note that the org.apache.activemq.spring.SpringProducer class is just
> a little test helper class used in the unit tests to send messages;
> I'd hope you'd swap this for your own application code to send stuff
> :)
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/org.apache.activemq.spring.SpringProducer-Jar-tf3026581.html#a8409021
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: org.apache.activemq.spring.SpringProducer Jar

Posted by James Strachan <ja...@gmail.com>.
On 1/17/07, Tim Langford <ti...@multicom.co.uk> wrote:
>
> Oh Dear! I see now, this is a pojo using a Spring template isnt it? (it is
> actually commented in the config - sorry)
>
> Deepest apologies. The confusion with the validation and path/name of class
> confused my poor brain!

:)

Note that the org.apache.activemq.spring.SpringProducer class is just
a little test helper class used in the unit tests to send messages;
I'd hope you'd swap this for your own application code to send stuff
:)

-- 

James
-------
http://radio.weblogs.com/0112098/

Re: org.apache.activemq.spring.SpringProducer Jar

Posted by Tim Langford <ti...@multicom.co.uk>.
Oh Dear! I see now, this is a pojo using a Spring template isnt it? (it is
actually commented in the config - sorry)

Deepest apologies. The confusion with the validation and path/name of class
confused my poor brain!



-- 
View this message in context: http://www.nabble.com/org.apache.activemq.spring.SpringProducer-Jar-tf3026581.html#a8408531
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: org.apache.activemq.spring.SpringProducer Jar

Posted by Tim Langford <ti...@multicom.co.uk>.

Sorry, I guess I should have posted this. It is obtained from doccos on the
website. I previously had a problem with parsing this XML file, so disabled
the validation (based on similar solutions in this forum).

Apologies if this is some sort ofapplication classr. just the package
structure made me think that maybe it is part of the framework?



<?xml version="1.0" encoding="UTF-8"?>

<!-- START SNIPPET: spring -->
<beans 
  xmlns="http://www.springframework.org/schema/beans" 
  xmlns:amq="http://activemq.org/config/1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd 
  http://activemq.org/config/1.0
http://people.apache.org/repository/org.apache.activemq/xsds/activemq-core-4.1-incubator-SNAPSHOT.xsd">
  
  <!--  lets create an embedded ActiveMQ Broker -->
  <amq:broker useJmx="false" persistent="false">
    <amq:transportConnectors>
      <amq:transportConnector uri="tcp://localhost:0" />
    </amq:transportConnectors>
  </amq:broker>

   <!--  ActiveMQ destinations to use  -->
  <amq:queue id="destination" 
physicalName="org.apache.activemq.spring.Test.spring.embedded"/>

  <!-- JMS ConnectionFactory to use, configuring the embedded broker using
XML -->
  <amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost"/>
  

  <!-- Spring JMS Template -->
  <bean id="myJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory">
      <!-- lets wrap in a pool to avoid creating a connection per send -->

      <bean
class="org.springframework.jms.connection.SingleConnectionFactory">
        <property name="targetConnectionFactory">
          <ref local="jmsFactory" />
        </property>
      </bean>
    </property>
  </bean>

  <bean id="consumerJmsTemplate"
class="org.springframework.jms.core.JmsTemplate">

    <property name="connectionFactory" ref="jmsFactory"/>
  </bean>

  <!-- a sample POJO which uses a Spring JmsTemplate -->
  <bean id="producer" class="org.apache.activemq.spring.SpringProducer">
    <property name="template">
      <ref bean="myJmsTemplate"></ref>
    </property>

    <property name="destination">

      <ref bean="destination" />
    </property>

    <property name="messageCount">
      <value>10</value>
    </property>
  </bean>

  <!-- a sample POJO consumer -->

  <bean id="consumer" class="org.apache.activemq.spring.SpringConsumer">
    <property name="template" ref="consumerJmsTemplate"/>
    <property name="destination" ref="destination"/>
  </bean>

</beans>

<!-- END SNIPPET: spring -->
-- 
View this message in context: http://www.nabble.com/org.apache.activemq.spring.SpringProducer-Jar-tf3026581.html#a8408449
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: org.apache.activemq.spring.SpringProducer Jar

Posted by James Strachan <ja...@gmail.com>.
Whats the XML you are using?

On 1/17/07, Timothy R J Langford <ti...@multicom.co.uk> wrote:
> Hi All,
>
> I a having problems getting the simple Spring configuration example to
> work. I have the latest stable version of ActiveMQ and have set all the
> jars on my classpath. However, I get the following error:
>
>
> org.springframework.beans.factory.CannotLoadBeanClassException: Cannot
> find class [org.apache.activemq.spring.SpringProducer] for bean with
> name 'producer' defined in file
> [/home/tim/versioned/orion_svn/dev/FAB2/Release/fab2/Services/Trips/beans.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.activemq.spring.SpringProducer
> Caused by:
> java.lang.ClassNotFoundException:
> org.apache.activemq.spring.SpringProducer
>
>
> Can someone tell me which jar this class lives in? I dont seem to able
> to find it.
>
> Thanks,
>
> Tim
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/