play no play nice

18 views
Skip to first unread message

Adrian Cole

unread,
Apr 25, 2012, 2:05:48 PM4/25/12
to jclou...@googlegroups.com
Hi, all.

It has been raised to my attention that recent jclouds isn't naturally
compatible with Play (even 2.0). This is due to an upstream issue in
reflections, which doesn't support recent versions of guava [1].

This is totally solvable in the mean time, so I'll throw an example on
jclouds-examples shortly. Sorry about the glitch.

Cheers,
-A

[1] https://code.google.com/p/reflections/issues/detail?id=94

Adrian Cole

unread,
Apr 25, 2012, 8:50:34 PM4/25/12
to jclou...@googlegroups.com
Ok.

Here are the key things:

1. make sure a patched version of the guava-incompatible
JavassistAdapter is in your project:

https://github.com/jclouds/jclouds-examples/blob/master/play-compute/app/org/reflections/adapters/JavassistAdapter.java

2. make sure your deps are explicit and w/repos:
val appDependencies = Seq(
"com.google.guava" % "guava" % "12.0-rc2",
"org.jclouds" % "jclouds-compute" % "1.5.0-alpha.5"
)

val main = PlayProject(appName, appVersion, appDependencies,
mainLang = JAVA).settings(
resolvers += "Maven central" at "http://repo1.maven.org/maven2/",
resolvers += "Sonatype snapshots" at
"https://oss.sonatype.org/content/repositories/snapshots"
)
https://github.com/jclouds/jclouds-examples/blob/master/play-compute/project/Build.scala

ok. that should get folks working until upstream is sorted!

-A

Andrea

unread,
Apr 26, 2012, 11:49:05 AM4/26/12
to jclou...@googlegroups.com
Hi there,

thanks for the play-compute example.

Unfortunately if DB plugin is enabled on a play project, like I did on the play-compute example here
https://github.com/jclouds/jclouds-examples/commit/e520785db0624c063d4cd006a28f1c5db57bcb45

the reflections issue due to guava-incompatible is still there (well know bug as documented here http://code.google.com/p/reflections/issues/detail?id=94).

Do you have any idea/suggestion to workaround this problem?

It is really important,
Andrea 

Andrea

unread,
Apr 27, 2012, 7:33:54 AM4/27/12
to jclou...@googlegroups.com
Thanks to Ivan Meredith that helped me on patching reflections, I've unblocked the situation.

To replicate my working environment you have to

clone this repo https://github.com/hadashi/reflections.git, which is a clone of reflections repo + patch
mvn install -DskipTests=true

(tests are not all passing and maven plugin for reflections will fail as well)

then you need to add to your Build.scala

    val appDependencies = Seq(

      ....

      "org.reflections" % "reflections" % "0.9.7-SNAPSHOT"

    )


    val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(

      // temporary hack waiting for a public maven repo where to push the patched jar

      resolvers += "Local Maven Repository" at "file://"+Path.userHome+"/.m2/repository",

     .....

}

the Local Maven Repository will be removed as soon as Ivan will push the reflections-0.9.7-SNAPSHOT to a public maven repo.

- run "play dependencies"

- run "play run"

You can checkout an updated version of play-compute with this patched version:

Cheers,
Andrea

Adrian Cole

unread,
Apr 27, 2012, 12:48:39 PM4/27/12
to jclou...@googlegroups.com

This is great to hear!

Out of courtesy to others outside jclouds, can you update the reflections issue with the repo instructions?

-A

> --
> You received this message because you are subscribed to the Google Groups "jclouds-dev" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/jclouds-dev/-/wDtZzZKM47YJ.
>
> To post to this group, send email to jclou...@googlegroups.com.
> To unsubscribe from this group, send email to jclouds-dev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jclouds-dev?hl=en.

Andrea Turli

unread,
Apr 27, 2012, 1:04:41 PM4/27/12
to jclou...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages