Using guava in griffon gives Prohibited package exception

210 Views Asked by At

I am using Griffon and want to add the guava libraries as a dependency in my project. However, when I do this, even without using 1 class of it, I get the following exception:

Compilation error: BUG! exception in phase 'canonicalization' in source unit
'/home/wdb/myproject/griffon-app/controllers/MyController.groovy' Prohibited
package name: java.util.concurrent

Any idea what might be wrong? This is my java version (on Ubuntu 11.10):

wdb@wdb-laptop:~$ java -version
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) Server VM (build 20.2-b06, mixed mode)

I found this link that talks about using the bootclasspath for a similar problem, but that seems a bit drastic.

regards,

Wim

2

There are 2 best solutions below

0
On BEST ANSWER

It must be that Griffon does not honor 'provided' scope. I managed to get it working by editing BuilderConfig.groovy to:

compile( 'com.google.guava:guava:10.0.1' ) { 
    exclude 'guava-bootstrap' 
}
0
On

My wild guess is that our bootclasspath copy of java.util.concurrent.ExecutorService (necessary due to an incompatible change between JDK5 and JDK6) is showing up in your classpath. I don't really know Maven, but I would think that, because we identify the dependency as "provided", this shouldn't be happening.

That's not really an answer, but I hope it's enough to get you or someone else started.