Linkage Error Jodatime 5.8.17

Lars Kölpin November 27, 2015

Hello everybody.

We are currently upgrading our confluence version from 5.1 to 5.8.17.

There is a plugin running on 5.1.3 with a depedency to jodatime 2.2 working perfectly fine atm.

After loading the plugin to 5.8.17, everytime  it's rendering method gets invoked, an exception occurs saying

Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.joda.time.DateTime.toString(Lorg/joda/time/format/DateTimeFormatter;)Ljava/lang/String;" the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) of the current class, , and the class loader (instance of org/apache/catalina/loader/WebappClassLoader) for the method's defining class, org/joda/time/base/AbstractInstant, have different Class objects for the type org/joda/time/format/DateTimeFormatter used in the signature...

 

After some reading (here https://answers.atlassian.com/questions/275026 and here i noticed, that jodatime is already bundled to confluence 5.8.17. 

 

The first link says, i should simply upgrade the plugin version. So I updated my atlas-sdk and my pom.xml to the following

...
<dependency>
    <groupId>com.atlassian.confluence</groupId>
    <artifactId>confluence</artifactId>
    <version>${confluence.version}</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>joda-time</groupId>
    <artifactId>joda-time</artifactId>
    <version>2.8.2</version>
    <scope>provided</scope>
</dependency>
 
..
 
<properties>
    <confluence.version>5.8.17</confluence.version>
    <confluence.data.version>5.8.17</confluence.data.version>
    <amps.version>6.1.0</amps.version>
    <plugin.testrunner.version>1.1.1</plugin.testrunner.version>
</properties>

 

but it's still not working.

 

Any advice would be appreciated.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 28, 2015

Hi Lars,

Saw your question few days ago but only yesterday eve it came to me that you do not need to declare dependency for joda-time since it's already part of confluence as shown on the pic. By declaring the joda-time dependency you are creating a problem by tying your code to the joda-time version you declared and getting the different version from the confluence in the run-time.

To resolve the problem: remove the dependency, run atlas-mvn eclipse:eclipse, adjust your joda related code if needed.

image2015-11-28 14:2:15.png

Lars Kölpin November 28, 2015

got it working! Thank you

TAGS
AUG Leaders

Atlassian Community Events