Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

ZooKeeper can't load log4net assembly #54

Closed
Neftedollar opened this issue May 5, 2016 · 2 comments
Closed

ZooKeeper can't load log4net assembly #54

Neftedollar opened this issue May 5, 2016 · 2 comments

Comments

@Neftedollar
Copy link

Neftedollar commented May 5, 2016

var consumerConfig = ConsumerConfiguration.Configure("consumer");
var zkConsConnector = new ZookeeperConsumerConnector(consumerConfig, true); //exceptionThrownHere

Exception message:

ZookeeperConsumerConnector exception: Exception Message: Unable to connect to
SERVERSTRINGS
Source: KafkaNET.Library
Stack Trace:
в Kafka.Client.ZooKeeperIntegration.ZooKeeperConnection.Connect(IWatcher watcher)
в Kafka.Client.ZooKeeperIntegration.ZooKeeperClient.Connect()
в Kafka.Client.Consumers.ZookeeperConsumerConnector.ConnectZk()
в Kafka.Client.Consumers.ZookeeperConsumerConnector..ctor(ConsumerConfiguration config, Boolean enableFetcher, EventHandler rebalanceHandler, EventHandler zkDisconnectedHandler, EventHandler zkExpiredHandler)

---- Inner Exception ----
Exception Message: Could not load file or assembly "log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=1b44e1d426115821" or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source: ZooKeeperNet
Stack Trace:
в ZooKeeperNet.ZooKeeper..ctor(String connectstring, TimeSpan sessionTimeout, IWatcher watcher)
в Kafka.Client.ZooKeeperIntegration.ZooKeeperConnection.Connect(IWatcher watcher)

---- Inner Exception ----
Exception Message: Could not load file or assembly "log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821" or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source:
Stack Trace:

App.config:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="log4net" publicKeyToken="1b44e1d426115821" culture="neutral" />
      </dependentAssembly>
        <bindingRedirect oldVersion="0.0.0.0-1.2.10.0" newVersion="1.2.15.0"/>
    </assemblyBinding>
  </runtime>

Please tell me how Can I fix it? And why should we use log4net instead of ILog interface?

@mhorstma
Copy link
Contributor

mhorstma commented May 5, 2016

Unfortunately, I discovered this issue after making the upgrade. The problem is that log4net decided to change their public key token after version 1.2.10.0, so standard binding redirects don't work. There is discussion of this exact issue on stackoverflow (http://stackoverflow.com/questions/3158928/referencing-2-different-versions-of-log4net-in-the-same-solution) and we'll have to decide how to work around this painful break by either removing the log4net dependency and/or implementing some kind of workaround. I suspect the right thing to start with for now is to undo the log4net upgrade and go back to using 1.2.10 as ZooKeeper.Net requires.

@Neftedollar
Copy link
Author

Neftedollar commented May 6, 2016

@mhorstma thank u. It's realy helpfull.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants