Hi Ivy team

Our team are about to use Guava in our project. The version we use is 19.0. When we test on Axon.ivy Designer, everything works just fine. However, when we deploy on engine, it get exception at runtime:

Caused by: java.lang.NoSuchMethodError: com.google.common.collect.Range.closed(Ljava/lang/Comparable;Ljava/lang/Comparable;)Lcom/google/common/collect/Range;

After digging around, we discovered that there are 2 jars of guava in Axon.ivy engine's lib/shared directory: guava-16.0.1.jar and guava-11.0.2.jar. At runtime, somehow Axon.ivy Engine chooses to load guava-11.0.2.jar and ignore the other jar.

My questions are:

  • Why there two jars of two different version?
  • Is there anyway we can use guava-19.0 without overriding Axon.ivy engine's lib/shared?

asked 10.05.2016 at 12:47

Genzer%20Hawker's gravatar image

Genzer Hawker
(suspended)
accept rate: 66%

edited 10.05.2016 at 12:50


I suggest that you repackage the guava version you want to use into a new namespace. Then you are save that no other version is used. More about repackaging can be found in this post: http://answers.axonivy.com/questions/960/use-the-latest-hsqldb-within-my-project

link

answered 10.05.2016 at 13:27

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958
accept rate: 70%

Then somehow I lose the benefits of using maven to control dependency. Not to mention I have to re-repack every time I want to use a newer version. Is there any better way to deal with this? I mean, in the future release of Axon.ivy?

(10.05.2016 at 13:36) Genzer Hawker Genzer%20Hawker's gravatar image

It could be part of the 'applicationContextVersion' feature which we are prototyping right now and should be released at least with 7.0. But to be 100% sure, that the server runtime behaves like the designer, OSGI classloading is required. Today there are no plans to do this...

(10.05.2016 at 13:59) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image

But you haven't answered the first question though: why are there 2 version of guava in axon.ivy engine's shared lib? Is it intentional?

(10.05.2016 at 14:44) Genzer Hawker Genzer%20Hawker's gravatar image

No its not intentional. I've fixed it on trunk. With the next version (6.2) only guava-16 will be on the classpath.

(10.05.2016 at 14:51) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×8
×4
×1

Asked: 10.05.2016 at 12:47

Seen: 2,170 times

Last updated: 10.05.2016 at 14:51