Thanks for all the help so far. You're example worked great.

I'm running into an error when integrating the camel routes into a webapp
where I use the guice servlet for initialization. I have the same set of
changes you included in your diff, but the startup happens from a listener
defined in web.xml and looking like:

public class GuiceServletConfig extends GuiceServletContextListener {
    protected Injector getInjector() {
        Module camel = new MyModule();
        return Guice.createInjector(camel);
    }

there is some other code in there, but I've tried it with this simple
version. When I run, the error I get is:

com.google.inject.CreationException: Guice creation errors:

  while locating org.apache.camel.guice.GuiceCamelContext
  while locating org.apache.camel.CamelContext

1 error
        at
com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
        at
com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:179)
        at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
        at com.google.inject.Guice.createInjector(Guice.java:92)
        .

Any thoughts on this? I've confirmed that both the camel-guice and
camel-core jars are in the WEB-INF/lib.

--Tim
 
-- 
View this message in context: 
http://old.nabble.com/Using-Guice-with-Camel-tp26517323p26554341.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to