users@glassfish.java.net

[gf-users] Re: How can I prevent application class conflict with bundled Guava (4.1)

From: Pawel Veselov <pawel.veselov_at_gmail.com>
Date: Mon, 23 Feb 2015 18:34:39 -0800

On Thu, Feb 19, 2015 at 3:06 PM, Joe Di Pol <joe.dipol_at_oracle.com> wrote:

>
> Known bug:
>
> https://java.net/jira/browse/GLASSFISH-20850
>
> There are some (ugly) workarounds mentioned in the bug comments.
>

Thank you. I solved this by rebuilding a GF class, so I posted my comments
into the issue as well.


>
>
> Joe
>
>
>
> On 2/19/15 1:01 PM, Pawel Veselov wrote:
>
> Hi.
>
> Running on GlassFish Server Open Source Edition 4.1 (build 13).
>
> I have an application that uses, and packages, Google collect library.
> GF 4.1 also uses classes of the same library, as part of Guava.
> Specifically, there is a ImmutableSet class that have differences in
> signatures for certain methods.
>
> (GF) ./glassfish/modules/guava.jar
> : com/google/common/collect/ImmutableSet.class
> (MY) lib/google-collect-1.0-rc1.jar
> : com/google/common/collect/ImmutableSet.class
>
> Once GF attempts to load the web application
> (com.sun.enterprise.web.WebModule.start(WebModule.java:691)), a signature
> mismatch exception is thrown, since the class is (apparently) being loaded
> from the "Common" classloader.
>
> [skipped]