-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cross-context forward results in ClassCastException of TracingLogger #5404
Comments
This is TracingLogger$1:
This Is it possibly your case, too? |
Ok, see minimal example on https://github.com/gluser1357/jerseyissues/tree/issue-5404-crosscontext. Could you please test and try to reproduce the problem? Please refer to the readme.txt for short instructions. To your latest question - Jersey jars are part of both webapps, yes. Since both webapps have identical content, Jersey jars exist twice in Tomcat and are of the same version. Since I started with a clean Tomcat instance I don't think that other Jersey libraries are on the classpath. |
Each app is loaded by a different instance of ParallelWebappClassLoader. The instance of TracingLogger loaded by As a workaround, try to use a shared library with Jersey in Tomcat, which should be loaded by the parent URLClassLoader and so the class should be castable. We try to provide a fix to check whether the property is of the |
Super, thank you. A fix would be great since shared libs have their own issues to take care of. |
We observed recently that forwardings from a Jersey filter in webapp A to a resource of another webapp B (requiring
<Context crossContext="true">
in context.xml) like......lead always to the following exception, making forward's effectively impossible:
We use Jersey 3.1.3 and Tomcat 10.1.
We found this error already described in an article from 2015: https://stackoverflow.com/questions/29558166/cross-context-request-forwarding-in-tomcat-results-in-java-lang-classcastexcepti
How can this error be fixed or avoided?
The text was updated successfully, but these errors were encountered: