Running ROP and CayenneFilter on same project
---------------------------------------------
Key: CAY-1673
URL: https://issues.apache.org/jira/browse/CAY-1673
Project: Cayenne
Issue Type: Bug
Components: ROP
Affects Versions: 3.1M3
Environment: Tomcat 7.0.14
Reporter: Jozef DropĨo
mapping for CayenneFilter is "/*" and I have ROPHessianServlet mounted on
"/hessian". The problem is when I start the project webpages run perfectly, but
after first call on ROPHessianServlet, I've got this error:
org.apache.cayenne.ConfigurationException: [v.3.1M3 Sep 12 2011 19:59:45] DI
container has no binding for key <BindingKey:
org.apache.cayenne.configuration.web.RequestHandler>
at
org.apache.cayenne.di.spi.DefaultInjector.getProvider(DefaultInjector.java:123)
at
org.apache.cayenne.di.spi.DefaultInjector.getProvider(DefaultInjector.java:111)
at
org.apache.cayenne.di.spi.DefaultInjector.getInstance(DefaultInjector.java:103)
at
org.apache.cayenne.configuration.web.CayenneFilter.doFilter(CayenneFilter.java:92)
I find out that this error is caused because in init method of
ROPHessianServlet is no merging between existing ServerContext and new
ServerContext created by servlet.
I also fixed this bug by changing init method like this:
....
ArrayList<Module> modules = new ArrayList<Module>();
if (currentRuntime != null) {
modules.addAll(Arrays.asList(currentRuntime.getModules()));
}
modules.add(new ROPServerModule(
eventBridgeParameters));
ServerRuntime runtime = new ServerRuntime(configurationLocation,
modules.toArray(new Module[modules.size()]));
....
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira