3 Replies Latest reply on Feb 13, 2010 4:14 AM by Tim Fox

    Getting a LinkageError when loading HornetQ

    D Garrison Newbie

      Trying to start hornetQ server in jboss 4.2.3 running with java jdk1.5.0_14

      Getting the linkage error below; using the spring definition below the error.

      Wondering if anyone has any suggestions.

      Thanks in advance,

      David

       

      2010-02-11 08:46:34,664 INFO  [com.zilliant.server.util.ZilliantAnnotationSessionFactoryBean] Closing Hibernate SessionFactory

      2010-02-11 08:46:34,664 INFO  [org.hibernate.impl.SessionFactoryImpl] closing

      2010-02-11 08:46:34,664 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hornetQ' defined in resource loaded from byte array: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.hornetq.core.server.impl.HornetQServerImpl]; constructor threw exception; nested exception is java.lang.LinkageError: loader constraints violated when linking javax/management/MBeanServer class

      org.springframework.beans.FatalBeanException: Could not instantiate class [org.hornetq.core.server.impl.HornetQServerImpl]; constructor threw exception; nested exception is java.lang.LinkageError: loader constraints violated when linking javax/management/MBeanServer class

      java.lang.LinkageError: loader constraints violated when linking javax/management/MBeanServer class

                      at org.hornetq.core.server.impl.HornetQServerImpl.<init>(HornetQServerImpl.java:247)

                      at org.hornetq.core.server.impl.HornetQServerImpl.<init>(HornetQServerImpl.java:222)

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

                      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

                      at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

                      at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:172)

                      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:78)

       

       

       

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

      <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

      <beans>

         <bean id="inVMTransport" class="org.hornetq.api.core.TransportConfiguration">

                      <constructor-arg index="0">

                                      <value>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</value>

                      </constructor-arg>

         </bean>

       

         <bean id="configuration" class="org.hornetq.core.config.impl.ConfigurationImpl">

                      <property name="acceptorConfigurations">

                                      <set>

                                                      <ref bean="inVMTransport"/>

                                      </set>

                      </property>

                      <property name="securityEnabled">

                                      <value>false</value>

                      </property>

         </bean>

       

         <bean id="hornetQ" class="org.hornetq.core.server.impl.HornetQServerImpl">     

            <constructor-arg index="0"><ref bean="configuration"/></constructor-arg>        

         </bean>

       

        <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">

            <property name="targetObject"><ref local="hornetQ"/></property>

            <property name="targetMethod"><value>start</value></property>

        </bean>

       

      </beans>