简体   繁体   中英

Spring.Rest and Common.Logging 3.0 Compatability issues

I am deep in dll hell and have resorted to an open ended question here for some help. I use the springframework.net port in my web application and have recently upgraded to the pre-release 2.0 version. Everything is working correctly except for the new dependancy on commons.logging.

After a fair amount of googling I see that the previous common.logging 2.0 and the latest 3.0 are not compatable, but there is a workaround in the form of common.logging.core 3.0. After implementing that everything works fine.

However now I have had to upgrade Spring.Social.Twitter and Spring.Social.LinkedIn, which both have a dependancy on Spring.Rest ( 1.1.1.35040 ). The Spring.Rest library still has a dependancy on common.logging 2.0.

I thought that by simply slipping a binding redirect into my web.config all would be well, but it is not. When accessing anything from the Spring.Rest.RestTemplate class at runtime it fails with "Method not found: 'Common.Logging.ILog Common.Logging.LogManager.GetLogger(System.Type)'."

The culprit is here inside RestTemplate

private static readonly Common.Logging.ILog LOG = Common.Logging.LogManager.GetLogger(typeof(RestTemplate));

here is my binding redirect

<dependentAssembly>
    <assemblyIdentity name="Common.Logging" publicKeyToken="af08829b84f0328e" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
  </dependentAssembly>

I have tried every solution I can think of to get around this but am lost and desperately need a fix. Any help would really be appreciated.

Trying to resolve the same, but no way unfortunately.

The issue is that with Common.Logging 3.0 ILogger interface was moved from Common.Logging to Common.Logging.Core and therefore the binary couldn't find it. If you do the opposite redirection, the other binary would face the issue.

In other words the only way is to have both libraries compiled against the same version of Common.Logging as they're incompatible with each other.

It's actually not difficult job to compile Spring.Rest against Common.Logging (you have to just update Common.Logging and add Common.Logging.Core) but first it will be unsigned and second I'm a bit surprised whether Spring.Rest is still maintained - the last release is about 4 years old which is really shame as at least the Java version is pretty cool...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM