Camel
  1. Camel
  2. CAMEL-1146

camel-mina adds two versions of slf4j on the classpath

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.0
    • Fix Version/s: 1.6.0, 2.0-M1
    • Component/s: camel-mina
    • Labels:
      None

      Description

      One version comes from camel-mina (version 1.5.5) and one from mina-core (version 1.4.3). This causes problems as seen when trying to use camel-mina at runtime or in my case deploying to ServiceMix. This is the error I get

      org.apache.xbean.kernel.ServiceRegistrationException: java.lang.NoSuchFieldError: name
      	at org.apache.xbean.kernel.standard.ServiceManagerRegistry.registerService(ServiceManagerRegistry.java:424)
      	at org.apache.xbean.kernel.standard.StandardKernel.registerService(StandardKernel.java:220)
      	at org.apache.xbean.server.spring.loader.SpringLoader.load(SpringLoader.java:152)
      	at org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:83)
      	at org.apache.servicemix.camel.CamelSpringDeployer.deploy(CamelSpringDeployer.java:83)
      	at org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)
      	at org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)
      	at org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:508)
      	at org.apache.servicemix.jbi.framework.AutoDeploymentService.checkPendingSAs(AutoDeploymentService.java:482)
      	at org.apache.servicemix.jbi.framework.AutoDeploymentService.checkPendingComponents(AutoDeploymentService.java:535)
      	at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateSharedLibrary(AutoDeploymentService.java:317)
      	at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:254)
      	at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:667)
      	at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)
      	at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:631)
      	at java.util.TimerThread.mainLoop(Timer.java:512)
      	at java.util.TimerThread.run(Timer.java:462)
      Caused by: java.lang.NoSuchFieldError: name
      	at org.slf4j.impl.SimpleLogger.<init>(SimpleLogger.java:83)
      	at org.slf4j.impl.SimpleLoggerFactory.getLogger(SimpleLoggerFactory.java:67)
      	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:103)
      	at org.apache.mina.util.NamePreservingRunnable.<init>(NamePreservingRunnable.java:32)
      	at org.apache.mina.transport.socket.nio.SocketAcceptor.startupWorker(SocketAcceptor.java:165)
      	at org.apache.mina.transport.socket.nio.SocketAcceptor.bind(SocketAcceptor.java:141)
      	at org.apache.camel.component.mina.MinaConsumer.doStart(MinaConsumer.java:60)
      	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
      	at org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:421)
      	at org.apache.camel.impl.DefaultCamelContext.startRoutes(DefaultCamelContext.java:659)
      	at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:632)
      	at org.apache.camel.spring.SpringCamelContext.maybeDoStart(SpringCamelContext.java:167)
      	at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:162)
      	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
      	at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:97)
      	at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:116)
      	at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
      	at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
      	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
      	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
      	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:617)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)
      	at org.apache.xbean.server.spring.configuration.SpringConfiguration.<init>(SpringConfiguration.java:63)
      	at org.apache.xbean.server.spring.configuration.SpringConfigurationServiceFactory.createService(SpringConfigurationServiceFactory.java:106)
      	at org.apache.xbean.kernel.standard.ServiceManager.start(ServiceManager.java:420)
      	at org.apache.xbean.kernel.standard.ServiceManager.initialize(ServiceManager.java:200)
      	at org.apache.xbean.kernel.standard.RegistryFutureTask$RegisterCallable.call(RegistryFutureTask.java:110)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:123)
      	at org.apache.xbean.kernel.standard.ServiceManagerRegistry.registerService(ServiceManagerRegistry.java:409)
      

        Activity

        Jonathan Anstey created issue -
        Jonathan Anstey made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Jonathan Anstey made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Jonathan Anstey added a comment -

        FYI I added a test case in ServiceMix for this here https://issues.apache.org/activemq/browse/SM-1720

        Show
        Jonathan Anstey added a comment - FYI I added a test case in ServiceMix for this here https://issues.apache.org/activemq/browse/SM-1720
        Hide
        Christopher Hunt added a comment -

        Hi there,

        Is this able to be worked around in 1.5.0? I tried excluding either slf4j from the camel-mina dependency but to no avail.

        As a further question, should this problem cause Mina to stop working?

        Kind regards,
        Christopher

        Show
        Christopher Hunt added a comment - Hi there, Is this able to be worked around in 1.5.0? I tried excluding either slf4j from the camel-mina dependency but to no avail. As a further question, should this problem cause Mina to stop working? Kind regards, Christopher
        Hide
        Christopher Hunt added a comment -

        I think I have a 1.5.0 work-around - it appears to work for me. Can you please confirm:

        <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-mina</artifactId>
        <version>1.5.0</version>
        <exclusions>
        <!-- This exclusion is a 1.5.0 work-around for CAMEL-1146 -->
        <exclusion>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        </exclusion>
        </exclusions>
        </dependency>
        <!-- This dependency is a 1.5.0 work-around for CAMEL-1146 -->
        <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.5.5</version>
        </dependency>

        Show
        Christopher Hunt added a comment - I think I have a 1.5.0 work-around - it appears to work for me. Can you please confirm: <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-mina</artifactId> <version>1.5.0</version> <exclusions> <!-- This exclusion is a 1.5.0 work-around for CAMEL-1146 --> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> </exclusion> </exclusions> </dependency> <!-- This dependency is a 1.5.0 work-around for CAMEL-1146 --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.5.5</version> </dependency>
        Hide
        Jonathan Anstey added a comment -

        Hi Christopher,

        The work-around I have been using is this:

        <dependency>
              <groupId>org.apache.camel</groupId>
              <artifactId>camel-mina</artifactId>
              <version>1.5.0</version>
                <exclusions>
                  <exclusion>
                    <groupId>org.apache.mina</groupId>
                    <artifactId>mina-core</artifactId>
                  </exclusion>
                </exclusions>
            </dependency>
            <dependency>
              <groupId>org.apache.mina</groupId>
              <artifactId>mina-core</artifactId>
              <version>1.1.7</version>
              <exclusions>
                <exclusion>
                  <groupId>org.slf4j</groupId>
                  <artifactId>slf4j-simple</artifactId>
                </exclusion>
                <exclusion>
                  <groupId>org.slf4j</groupId>
                  <artifactId>slf4j-api</artifactId>
                </exclusion>
              </exclusions>
            </dependency>
        

        The different version of slf4j seems to have no affect on mina (all mina unit tests passed) so all should be well.

        Show
        Jonathan Anstey added a comment - Hi Christopher, The work-around I have been using is this: <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-mina</artifactId> <version>1.5.0</version> <exclusions> <exclusion> <groupId>org.apache.mina</groupId> <artifactId>mina-core</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-core</artifactId> <version>1.1.7</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> </exclusions> </dependency> The different version of slf4j seems to have no affect on mina (all mina unit tests passed) so all should be well.
        Hadrian Zbarcea made changes -
        Fix Version/s 2.0.0 [ 11900 ]
        Fix Version/s 2.0-M1 [ 12061 ]
        Fix Version/s 1.6.0 [ 11991 ]
        Jeff Turner made changes -
        Fix Version/s 1.6.0 [ 11991 ]
        Hide
        Claus Ibsen added a comment -

        Closing 2.0m1 tickets

        Show
        Claus Ibsen added a comment - Closing 2.0m1 tickets
        Claus Ibsen made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Jeff Turner made changes -
        Project Import Sat Nov 27 00:14:50 EST 2010 [ 1290834890113 ]

          People

          • Assignee:
            Jonathan Anstey
            Reporter:
            Jonathan Anstey
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development