Akka, Guice and class loaders
I see that Akka has different class loaders for the "main" server (microkernel) and for each of the "deployed" applications under the "deploy" folder.
In my application (actors) I use Guice to inject Morphia datastore to the actors and the following problem occurs:
During Morphia creation I have to specify mapped classes, which Morphia searches for in "its" classloader, but in my case the mapped classes are provided as part of the JAR file in the deploy folder, together with acrors. It appears that the "Injection" is being done in the "main" class loader which is unaware of the "application" classloader and the mapping of the resources fails.
IMHO the injection should be done the in the application class loader, exactly as actor execution.
In my application (actors) I use Guice to inject Morphia datastore to the actors and the following problem occurs:
During Morphia creation I have to specify mapped classes, which Morphia searches for in "its" classloader, but in my case the mapped classes are provided as part of the JAR file in the deploy folder, together with acrors. It appears that the "Injection" is being done in the "main" class loader which is unaware of the "application" classloader and the mapping of the resources fails.
IMHO the injection should be done the in the application class loader, exactly as actor execution.
Leave a comment
on 2011-02-23 09:24 *
By viktorklang
Is this really something to fix in Akka? Just specify the correct CL to Morphia?