8 Replies Latest reply: Jul 11, 2012 4:57 AM by raymanf RSS

Error using HornetQ2.2.14 with Spring3.1

raymanf Newbie

Hi,

 

I am trying to create jmstemplate in my application and I get this error:

 

Jul 11, 2012 10:19:38 AM org.hornetq.core.logging.impl.JULLogDelegate warn
WARNING: Unexpected Netty Version was expecting 3.2.5.Final-a96d88c using 3.2.0.BETA1-r2215
2012-07-11 10:19:38,912 com.finbird.fixgw.test.TriggerBean [ERROR] java.lang.NoSuchMethodError: org.hornetq.spi.core.remoting.ConnectionLifeCycleListener.connectionCreated(Lorg/hornetq/spi/core/remoting/Connection;Lorg/hornetq/spi/core/protocol/ProtocolType;)V
java.lang.NoSuchMethodError: org.hornetq.spi.core.remoting.ConnectionLifeCycleListener.connectionCreated(Lorg/hornetq/spi/core/remoting/Connection;Lorg/hornetq/spi/core/protocol/ProtocolType;)V
Jul 11, 2012 10:20:39 AM org.hornetq.core.logging.impl.JULLogDelegate warn
WARNING: Connection failure has been detected: Did not receive data from /127.0.0.1:1036. It is likely the client has exited or crashed without closing its connection, or the network between the server and client has failed. You also might have configured connection-ttl and client-failure-check-period incorrectly. Please check user manual for more information. The connection will now be closed. [code=3]

 

I made sure I have the jars with ths package but its still crushing.

 

 

this is the netty jar:

netty-3.2.3.Final.jar

 

and I am using HornetQ2.2.14 jars.

 

and this is my xml configuration:

 

 

 

          <bean name="connectionFactory" class="org.hornetq.jms.client.HornetQJMSConnectionFactory">
                    <constructor-arg name="ha" value="false" />
                    <constructor-arg>
                              <bean class="org.hornetq.api.core.TransportConfiguration">
                                        <constructor-arg
                                                  value="org.hornetq.integration.transports.netty.NettyConnectorFactory" />
                                        <constructor-arg>
                                                  <map key-type="java.lang.String" value-type="java.lang.Object">
                                                            <entry key="port" value="5445"></entry>
                                                  </map>
                                        </constructor-arg>
                              </bean>
                    </constructor-arg>
          </bean>




<bean id="queueOneTemplate" class="org.springframework.jms.core.JmsTemplate">
                    <property name="connectionFactory" ref="connectionFactory" />
                    <property name="defaultDestination" ref="feedDispatcherTopic" />
                    <property name="pubSubDomain" value="true" />
                    <property name="receiveTimeout" value="1000" />
          </bean>

 

 

Java code:

 

public class MyMessageSender
{
          @Autowired
          private JmsTemplate queueOneTemplate;


          // To Queue One
          public void pushToQueueOne()
          {
                    queueOneTemplate.send(new MessageCreator()
                    {
                              public Message createMessage(Session session) throws JMSException
                              {
                                        ObjectMessage msg = session.createObjectMessage();
                                        String s = "test message";
                                        msg.setObject(s);
                                        return msg;
                              }
                    });
          }

}

 

 

 

Please if you have any idea?

 

thanks,

ray.

  • 1. Re: Error using HornetQ2.2.14 with Spring3.1
    Andy Taylor Master

    looks like you have a classpath issue somewhere, maybe mixing HornetQ versions.

  • 2. Re: Error using HornetQ2.2.14 with Spring3.1
    raymanf Newbie

    I was looking and looking and couldnt find any duplication.

     

    Thats my classpath, another eye wont harm:)

     

     

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

    <classpath>

              <classpathentry kind="src" path="src"/>

              <classpathentry kind="src" path="resources"/>

              <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>

              <classpathentry kind="lib" path="lib/aopalliance-1.0.jar"/>

              <classpathentry kind="lib" path="lib/asm.jar"/>

              <classpathentry kind="lib" path="lib/aspectjweaver.jar"/>

              <classpathentry kind="lib" path="lib/cglib-2.1.3.jar"/>

              <classpathentry kind="lib" path="lib/cglib-2.2.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.aop-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.asm-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.aspects-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.beans-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.context-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.context.support-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.core-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.expression-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.instrument-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.instrument.tomcat-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.jdbc-3.1.1.RELEASE.jar" sourcepath="C:/Documents and Settings/idan.f/.m2/repository/org/springframework/spring-jdbc/3.1.1.RELEASE/spring-jdbc-3.1.1.RELEASE-sources.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.jms-3.1.1.RELEASE.jar" sourcepath="C:/Documents and Settings/idan.f/.m2/repository/org/springframework/spring-jms/3.1.1.RELEASE/spring-jms-3.1.1.RELEASE-sources.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.orm-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.oxm-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.spring-library-3.1.1.RELEASE.libd"/>

              <classpathentry kind="lib" path="lib/org.springframework.test-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.transaction-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.web-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.web.portlet-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.web.servlet-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/org.springframework.web.struts-3.1.1.RELEASE.jar"/>

              <classpathentry kind="lib" path="lib/hornetq-bootstrap.jar"/>

              <classpathentry kind="lib" path="lib/hornetq-core.jar"/>

              <classpathentry kind="lib" path="lib/hornetq-jms.jar"/>

              <classpathentry kind="lib" path="lib/hornetq-logging.jar"/>

              <classpathentry kind="lib" path="lib/jboss-logging-spi-2.1.1.GA.jar"/>

              <classpathentry kind="lib" path="lib/jnpserver.jar"/>

              <classpathentry kind="lib" path="lib/commons-daemon-1.0.3.jar"/>

              <classpathentry kind="lib" path="lib/commons-logging.jar"/>

              <classpathentry kind="lib" path="lib/mx4j-tools.jar"/>

              <classpathentry kind="lib" path="lib/jboss-common-4.0.2.jar"/>

              <classpathentry kind="lib" path="lib/javax.jms-1.1.jar"/>

              <classpathentry kind="lib" path="jboss/jboss-messaging-client.jar"/>

              <classpathentry kind="lib" path="jboss/jboss-messaging.jar"/>

              <classpathentry kind="lib" path="jboss/jms-api.jar"/>

              <classpathentry kind="lib" path="jboss/mina-core-1.1.0.jar"/>

              <classpathentry kind="lib" path="jboss/proxool-0.9.1.jar"/>

              <classpathentry kind="lib" path="jboss/slf4j-api-1.5.3.jar"/>

              <classpathentry kind="lib" path="jboss/slf4j-log4j12-1.5.3.jar"/>

              <classpathentry kind="lib" path="jboss/trove.jar"/>

              <classpathentry kind="lib" path="jboss/xercesImpl.jar"/>

              <classpathentry kind="lib" path="lib/finbird-commons.jar"/>

              <classpathentry kind="lib" path="lib/jbossall-client.jar"/>

              <classpathentry kind="lib" path="lib/commons-dbcp-1.4.jar"/>

              <classpathentry kind="lib" path="lib/commons-pool-1.6.jar"/>

              <classpathentry kind="lib" path="lib/ojdbc11.jar"/>

              <classpathentry kind="lib" path="lib/jcl-over-slf4j-1.5.3.jar"/>

              <classpathentry kind="lib" path="jboss/jboss-aop-jdk50.jar"/>

              <classpathentry kind="lib" path="lib/log4j-1.2.15.jar"/>

              <classpathentry kind="lib" path="lib/scheduling.jar"/>

              <classpathentry kind="lib" path="lib/quickfixj-all-1.5.0.jar"/>

              <classpathentry kind="lib" path="lib/hornetq-transports-2.1.0.r9031.jar"/>

              <classpathentry kind="lib" path="lib/netty-3.2.7.Final.jar"/>

              <classpathentry kind="output" path="bin"/>

    </classpath>

     

     

    Mybe you can see duplication or something I should pay attention to.

     

    the class which gives me the nosuchmethod: org.hornetq.spi.core.remoting.ConnectionLifeCycleListener.connectionCreated is inside hornetq-core.jar

  • 3. Re: Error using HornetQ2.2.14 with Spring3.1
    Jeff Mesnil Master

    raymanf wrote:

     

    I was looking and looking and couldnt find any duplication.

     

    Thats my classpath, another eye wont harm:)

     

     

              <classpathentry kind="lib" path="lib/hornetq-bootstrap.jar"/>

              <classpathentry kind="lib" path="lib/hornetq-core.jar"/>

              <classpathentry kind="lib" path="lib/hornetq-jms.jar"/>

              <classpathentry kind="lib" path="lib/hornetq-logging.jar"/>

     

     

              <classpathentry kind="lib" path="lib/jbossall-client.jar"/>

     

              <classpathentry kind="lib" path="lib/hornetq-transports-2.1.0.r9031.jar"/>

              <classpathentry kind="lib" path="lib/netty-3.2.7.Final.jar"/>

     

    Your classpath looks bogus.

    Which versions are the hornetq-*.jar from?

    Why keep a hornetq-transports-2.1.0.r9031.jar?

    Does jbossall-client.jar contains HornetQ or Netty classes?

    You say you use Netty 3.2.3 but in the classpath it's netty-3.2.7.Final.jar and your logs tell otherwise:

     

    Jul 11, 2012 10:19:38 AM org.hornetq.core.logging.impl.JULLogDelegate warn WARNING: Unexpected Netty Version was expecting 3.2.5.Final-a96d88c using 3.2.0.BETA1-r2215 


     


  • 4. Re: Error using HornetQ2.2.14 with Spring3.1
    raymanf Newbie

    okie. I guess I made some changes in the jars  after my last reply.

     

    So:

    1. the hornetq version is 2.2.14

    2. I kept hornetq-transports-2.1.0.r9031.jar coz there I have the netty path.

    3. jbossall-client.jar i am using for other purpose coz from this project Iam also doing lookup to jboss4.

     

    what do you think I should pay attention to?

  • 5. Re: Error using HornetQ2.2.14 with Spring3.1
    raymanf Newbie

    If I take the transports jar off I get this:

     

    2012-07-11 11:43:08,438 com.finbird.fixgw.test.TriggerBean [ERROR] org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: Failed to create session factory; nested exception is java.lang.IllegalArgumentException: Could not find class org.hornetq.integration.transports.netty.NettyConnectorFactory

    org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: Failed to create session factory; nested exception is java.lang.IllegalArgumentException: Could not find class org.hornetq.integration.transports.netty.NettyConnectorFactory

    Jul 11, 2012 11:43:09 AM org.hornetq.core.logging.impl.JULLogDelegate warn

    WARNING: I'm closing a core ClientSessionFactory you left open. Please make sure you close all ClientSessionFactories explicitly before letting them go out of scope! 22050297

    Jul 11, 2012 11:43:09 AM org.hornetq.core.logging.impl.JULLogDelegate warn

    WARNING: The ClientSessionFactory you didn't close was created here:

    java.lang.Exception

              at org.hornetq.core.client.impl.ClientSessionFactoryImpl.<init>(ClientSessionFactoryImpl.java:181)

              at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:737)

              at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:601)

              at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:119)

              at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:114)

              at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)

              at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:456)

              at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:534)

              at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:526)

              at com..fixgw.test.MyMessageSender.pushToQueueOne(MyMessageSender.java:20)

              at com..fixgw.test.TriggerBean.start(TriggerBean.java:50)

              at com..fixgw.daemon.FeedDaemon.start(FeedDaemon.java:80)

              at com.finbird.fixgw.daemon.FeedDaemon.main(FeedDaemon.java:97)

  • 6. Re: Error using HornetQ2.2.14 with Spring3.1
    Andy Taylor Master

    I think that is pretty self explanatory, you dont have Netty on the classpath. Simply go thru your jars and make sure they are all consistent with what you want on the classpath.

  • 7. Re: Error using HornetQ2.2.14 with Spring3.1
    raymanf Newbie

    Look When I add back hornetq-transports-2.1.0.r9031.jar then this error is gone and then I get the other error:

     


    WARNING: Unexpected Netty Version was expecting 3.2.5.Final-a96d88c using 3.2.0.BETA1-r2215
    2012-07-11 10:19:38,912 com.finbird.fixgw.test.TriggerBean [ERROR] java.lang.NoSuchMethodError: org.hornetq.spi.core.remoting.ConnectionLifeCycleListener.connectionCreated(Lorg/hornetq/spi/core/remoting/Connection;Lorg/hornetq/spi/core/protocol/ProtocolType;)V
    java.lang.NoSuchMethodError: org.hornetq.spi.core.remoting.ConnectionLifeCycleListener.connectionCreated(Lorg/hornetq/spi/core/remoting/Connection;Lorg/hornetq/spi/core/protocol/ProtocolType;)V
    Jul 11, 2012 10:20:39 AM org.hornetq.core.logging.impl.JULLogDelegate warn
    WARNING: Connection failure has been detected: Did not receive data from /127.0.0.1:1036. It is likely the client has exited or crashed without closing its connection, or the network between the server and client has failed. You also might have configured connection-ttl and client-failure-check-period incorrectly. Please check user manual for more information. The connection will now be closed. [code=3]

     

    mybe something is wrong with my connectionFactory settings in the xml?

    (

  • 8. Re: Error using HornetQ2.2.14 with Spring3.1
    raymanf Newbie

    Okie I found the solution I change the field in the connectionFactory settings to this:

    org.hornetq.core.remoting.impl.netty.NettyConnectorFactory