Hi,
camel-guice has a jndi context which hold the reference of the JMS
component and the someBean. So you need to create that context in your
GuceServletConfig.
You can find use code in the MyActivitor[1] about how to create that
context.
[1]
https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-guice-jms/src/main/java/org/apache/camel/example/guice/jms/MyActivator.java
Willem
mumbly wrote:
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