mfornos/Cream — Issue #4: Compatibility issues with play-morphia Module
Author: jazzdan
Created: 2012-02-21 03:07:16+00:00
State: open

I have run into some compatibility issues when using the cream module along side the [play-morphia](http://www.playframework.org/modules/morphia) module (mongodb). Here is what my dependencies.yml file looks like:

```yaml
# Application dependencies

require:
- play
- play -> morphia [1.2.4,)
- play -> cream 0.1
```

And this is what the output from $play run is after I hit http://localhost:9000:

```zsh
~ _ _
~ _ __ | | __ _ _ _| |
~ | '_ \| |/ _' | || |_|
~ | __/|_|\____|\__ (_)
~ |_| |__/
~
~ play! 1.2.4, http://www.playframework.org
~
~ Ctrl+C to stop
~
Listening for transport dt_socket at address: 8000
22:03:05,500 INFO ~ Starting /Users/dan/cloudcount/vc/CloudCount
22:03:05,505 WARN ~ Declaring modules in application.conf is deprecated. Use dependencies.yml instead (module.secure)
22:03:05,506 INFO ~ Module secure is available (/usr/local/Cellar/play/1.2.4/libexec/modules/secure)
22:03:05,506 INFO ~ Module cream is available (/usr/local/Cellar/play/1.2.4/libexec/modules/cream-0.1)
22:03:05,507 INFO ~ Module morphia is available (/Users/dan/cloudcount/vc/CloudCount/modules/morphia-1.2.4)
22:03:06,405 WARN ~ You're running Play! in DEV mode
22:03:06,521 INFO ~ Listening for HTTP on port 9000 (Waiting a first request to start) ...
22:03:17,391 ERROR ~

@69eid543g
Internal Server Error (500) for request GET /

Oops: NoSuchMethodError
An unexpected error occured caused by exception NoSuchMethodError: org.objectweb.asm.ClassWriter.(Z)V

play.exceptions.UnexpectedException: Unexpected Error
at play.Invoker$Invocation.onException(Invoker.java:244)
at play.Invoker$Invocation.run(Invoker.java:286)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(Z)V
at net.sf.cglib.core.DebuggingClassWriter.(DebuggingClassWriter.java:47)
at net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(DefaultGeneratorStrategy.java:30)
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:24)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
at net.sf.cglib.proxy.Enhancer.(Enhancer.java:69)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.google.code.morphia.mapping.lazy.LazyFeatureDependencies.testDependencyFullFilled(LazyFeatureDependencies.java:32)
at com.google.code.morphia.mapping.lazy.LazyFeatureDependencies.createDefaultProxyFactory(LazyFeatureDependencies.java:44)
at com.google.code.morphia.mapping.Mapper.(Mapper.java:96)
at com.google.code.morphia.Morphia.(Morphia.java:47)
at com.google.code.morphia.Morphia.(Morphia.java:43)
at play.modules.morphia.MorphiaPlugin.initMorphia_(MorphiaPlugin.java:391)
at play.modules.morphia.MorphiaPlugin.onApplicationStart(MorphiaPlugin.java:444)
at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:480)
at play.Play.start(Play.java:515)
at play.Play.detectChanges(Play.java:618)
at play.Invoker$Invocation.init(Invoker.java:198)
... 1 more
```
It appears that play-morphia and cream depend on two different versions of ASM.

Please let me know if there is any other information I can supply, or if there are any known workarounds for this issue.