You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Florent Guillaume <fg...@nuxeo.com> on 2015/02/16 13:04:43 UTC

Guice 4.0-beta5

Hi,

We're trying to the latest use jclouds 1.8.1 with a recent version of
Guice 4.0-beta5, as Guice 3 is quite old.

There are two problems:

1. jclouds has to be modified to work with Guice 4.0-beta5. Otherwise
you get this:

    1) Overriding @Provides methods is not allowed.
    @Provides method:
org.jclouds.logging.config.LoggingModule.createLoggerFactory()
    overridden by:
org.jclouds.logging.jdk.config.JDKLoggingModule.createLoggerFactory()
     at com.google.inject.internal.ProviderMethodsModule.getProviderMethods(ProviderMethodsModule.java:128)

The @Provides annotation has to be moved from the base method to each
of the overriding concrete methods. I'm attaching to this mail an
example which solves my use case for reference but there are likely
other places where this has to be done.

2. jclouds depends on Rocoto 6.2 which is basically unmaintained. We
had to fork it, a (very simple) patch is available at
https://github.com/nuxeo/rocoto/commit/7c09617dac9cbbf8cd9f179ceb799f9d5e733d46

Because Rocoto is unmaintained, a solution has to be found for jclouds
to keep using it. Maybe it could simply be included as an additional
module inside jclouds?


It would be great if the upcoming jclouds 1.9.0 would include this to
support a more recent version of Guice, because otherwise projects
using it with Java 8 and requiring a recent Guice won't work. Witness
for instance https://issues.jenkins-ci.org/browse/JENKINS-26639


Regards,
Florent


-- 
Florent Guillaume, Director of R&D, Nuxeo
Open Source Content Management Platform for Business Apps
http://www.nuxeo.com   http://community.nuxeo.com

Re: Guice 4.0-beta5

Posted by Ignasi Barrera <na...@apache.org>.
Thanks for the feedback Florent,

Mind opening a JIRA issue [1] so we can properly track this? Also, I see no
problem in your patch, as it should be backwards compatible, so if you want
to open a PR with it, that would make things move faster :)

Regarding Rocoto, IIRC we only use it to parse the properties provided to
the context when building it, but I think we should be able to remove it,
as it does not provide many value IMO. I'd suggest to add a separate issue
for that so we can properly work on it too.


Thx!

I.

[1] https://issues.apache.org/jira/browse/JCLOUDS

On 16 February 2015 at 13:04, Florent Guillaume <fg...@nuxeo.com> wrote:

> Hi,
>
> We're trying to the latest use jclouds 1.8.1 with a recent version of
> Guice 4.0-beta5, as Guice 3 is quite old.
>
> There are two problems:
>
> 1. jclouds has to be modified to work with Guice 4.0-beta5. Otherwise
> you get this:
>
>     1) Overriding @Provides methods is not allowed.
>     @Provides method:
> org.jclouds.logging.config.LoggingModule.createLoggerFactory()
>     overridden by:
> org.jclouds.logging.jdk.config.JDKLoggingModule.createLoggerFactory()
>      at
> com.google.inject.internal.ProviderMethodsModule.getProviderMethods(ProviderMethodsModule.java:128)
>
> The @Provides annotation has to be moved from the base method to each
> of the overriding concrete methods. I'm attaching to this mail an
> example which solves my use case for reference but there are likely
> other places where this has to be done.
>
> 2. jclouds depends on Rocoto 6.2 which is basically unmaintained. We
> had to fork it, a (very simple) patch is available at
>
> https://github.com/nuxeo/rocoto/commit/7c09617dac9cbbf8cd9f179ceb799f9d5e733d46
>
> Because Rocoto is unmaintained, a solution has to be found for jclouds
> to keep using it. Maybe it could simply be included as an additional
> module inside jclouds?
>
>
> It would be great if the upcoming jclouds 1.9.0 would include this to
> support a more recent version of Guice, because otherwise projects
> using it with Java 8 and requiring a recent Guice won't work. Witness
> for instance https://issues.jenkins-ci.org/browse/JENKINS-26639
>
>
> Regards,
> Florent
>
>
> --
> Florent Guillaume, Director of R&D, Nuxeo
> Open Source Content Management Platform for Business Apps
> http://www.nuxeo.com   http://community.nuxeo.com
>