3 Replies Latest reply on May 30, 2017 6:16 AM by grgrzybek

    ActiveMQ - bundle wiring for org.apache.activemq.activemq-osgi is no longer valid.

    jaisha57

      We are using Jboss Fuse 6.3 and Fabric8 container

       

      Broker configuration

      Bean xml file in the attachment.

      URL: failover:(tcp://ip1:port,tcp://ip1:port)?randomize=false

       

      Refereed below bug and applied workaround but still facing the same issue.

      [ENTESB-5948] ActiveMQConnection Disconnect Invalidates Wiring For activemq-osgi Bundle  - JBoss Issue Tracker

       

      Added below in POM

      <Import-Package>*,org.apache.activemq.transport.failover,org.apache.activemq.util,org.apache.activemq.*</Import-Package>

       

      Changed bundle start level 100 by using Karaf Features and sample below:

      <features>

        <repository>mvn:org.apache.activemq/activemq-karaf/5.11.0.redhat-630187/xml/features</repository>

        <feature name='bundle-name' version='${project.version}'>

        <feature>activemq-camel</feature>

        <feature>camel-jms</feature>

        <!-- we should start last -->

        <bundle start-level="100">mvn:repo</bundle>

        </feature>

      </features>

       

      After doing all above, ended getting below error.

      2017-05-30 10:25:29,934 | ERROR | ActiveMQ Task-3  | TaskRunnerFactory                | 168 - org.apache.activemq.activemq-osgi - 5.11.0.redhat-630187 | Error in thread 'ActiveMQ Task-3'

      java.lang.NoClassDefFoundError: org/apache/activemq/util/IOExceptionSupport

              at org.apache.activemq.transport.TransportFactory.createWireFormatFactory(TransportFactory.java:205)

              at org.apache.activemq.transport.TransportFactory.createWireFormat(TransportFactory.java:189)

              at org.apache.activemq.transport.TransportFactory.doCompositeConnect(TransportFactory.java:134)

              at org.apache.activemq.transport.TransportFactory.compositeConnect(TransportFactory.java:91)

              at org.apache.activemq.transport.failover.FailoverTransport.doReconnect(FailoverTransport.java:1012)[168:org.apache.activemq.activemq-osgi:5.11.0.redhat-630187]

              at org.apache.activemq.transport.failover.FailoverTransport$2.iterate(FailoverTransport.java:147)[168:org.apache.activemq.activemq-osgi:5.11.0.redhat-630187]

              at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:133)

              at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_102]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_102]

              at java.lang.Thread.run(Thread.java:745)[:1.8.0_102]

      Caused by: java.lang.ClassNotFoundException: Unable to load class 'org.apache.activemq.util.IOExceptionSupport' because the bundle wiring for org.apache.activemq.activemq-osgi is no longer valid.

              at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1521)[org.apache.felix.framework-4.4.1.jar:]

              at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77)[org.apache.felix.framework-4.4.1.jar:]

              at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1993)[org.apache.felix.framework-4.4.1.jar:]

              at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_102]

       

      Further, added below and still error

      <Import-Package>*,org.apache.activemq.util.IOExceptionSupport,org.apache.activemq.transport.failover,org.apache.activemq.util,org.apache.activemq.*</Import-Package>

       

      osgi.wiring.package; filter:="(osgi.wiring.package=org.apache.activemq.util.IOExceptionSupport)"]]

              at org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)[86:io.fabric8.fabric-agent:1.2.0.redhat-630187]

              at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:236)[86:io.fabric8.fabric-agent:1.2.0.redhat-630187]

              at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:159)[86:io.fabric8.fabric-agent:1.2.0.redhat-630187]

              at io.fabric8.agent.region.SubsystemResolver.resolve(SubsystemResolver.java:190)[86:io.fabric8.fabric-agent:1.2.0.redhat-630187]

              at io.fabric8.agent.service.Deployer.deploy(Deployer.java:273)[86:io.fabric8.fabric-agent:1.2.0.redhat-630187]

              at io.fabric8.agent.service.Agent.provision(Agent.java:366)[86:io.fabric8.fabric-agent:1.2.0.redhat-630187]

              at io.fabric8.agent.service.Agent.provision(Agent.java:199)[86:io.fabric8.fabric-agent:1.2.0.redhat-630187]

              at io.fabric8.agent.DeploymentAgent.doUpdate(DeploymentAgent.java:753)[86:io.fabric8.fabric-agent:1.2.0.redhat-630187]

              at io.fabric8.agent.DeploymentAgent$4.run(DeploymentAgent.java:303)[86:io.fabric8.fabric-agent:1.2.0.redhat-630187]

              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_102]

              at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_102]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_102]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_102]

              at java.lang.Thread.run(Thread.java:745)[:1.8.0_102]

       

      This is reproducible,

      1. Two ActiveMQ bundle which are created as two profiles

      2. Added those profiles to the container (will observe container reloads all the profiles by added two new once as well)

      3. Remove one of the profile from the container, when it again reloads we end up with this error (java.lang.NoClassDefFoundError: org/apache/activemq/util/IOExceptionSupport)

       

      Please do support us in fixing this issue.

      grgrzybek - seeking your help as well.

        • 1. Re: ActiveMQ - bundle wiring for org.apache.activemq.activemq-osgi is no longer valid.
          grgrzybek

          Hello Jayashankar

           

          You're using JBoss Fuse 6.3.0.GA. This problem is related to issue https://issues.jboss.org/browse/ENTESB-5948 which occurs when you have failover: transport and use fabric mode. When the refresh happens (at fabric-agent level), fabric can't detect that your bundles are wired to ActiveMQ, because you are tied to it implicitly (by using failover: transport in Camel URI).

           

          Your:

          <Import-Package>*,org.apache.activemq.util.IOExceptionSupport,org.apache.activemq.transport.failover,org.apache.activemq.util,org.apache.activemq.*</Import-Package>

          was good attempt, but you can't specify classes in Import-Package clause - you just have to <Import-Package>*, org.apache.activemq</Import-Package>. This import is not actually to load classes, but to notify fabric-agent's resolver that your bundle is wired to ActiveMQ, so when ActiveMQ bundles are refreshed your bundle will be refreshed to (and rewired to new wiring of ActiveMQ).

           

          regards

          Grzegorz Grzybek

          1 of 1 people found this helpful
          • 2. Re: ActiveMQ - bundle wiring for org.apache.activemq.activemq-osgi is no longer valid.
            jaisha57

            Hi grgrzybek,

             

            Thanks for the quick reply!!

             

            After adding below to the pom, still same error message.

            <Import-Package>*, org.apache.activemq</Import-Package>

             

            MANIFEST.MF

            Import-Package: javax.sql,javax.xml.bind.annotation,org.apache.activemq,org.apache.activemq.camel.component;version="[5.11,6)",org.apache.activemq.pool,org.apache.camel;version="[2.17,3)",org.apache.camel.component.jms;version="[2.17,3)",org.apache.commons.dbcp;version="[1.4,2)",org.springframework.jdbc.core,org.springframework.jdbc.object,org.springframework.jms.connection,org.xml.sax

             

            Please help to fix it, will be looking forward for the response.
            Thanks in advance!

            • 3. Re: ActiveMQ - bundle wiring for org.apache.activemq.activemq-osgi is no longer valid.
              grgrzybek

              Hmm, Then it may be something different (even if I can't imagine now what this is)...

               

              Please send me more information - github project? a heap dump (share via dropbox)?

               

              regards

              Grzegorz Grzybek