On 12/15/2017 2:16 AM, Prasanth Pasala wrote:
> ServletContext sContext = context.getContext("/context2");
> RequestDispatcher rd = sContext.getRequestDispatcher(resource);
> rd.forward(request, response);
>
> Thanks,
> Prasanth
>
> Exception: java.lang.RuntimeException: java.lang.RuntimeException:
> java.lang.ClassCastException:
> org.apache.struts2.dispatcher.mapper.ActionMapping cannot be cast to
> org.apache.struts2.dispatcher.mapper.ActionMapping
I found [1]:
> usually when you get ClassCastExceptions you cannot explain you have loaded
> the class with one classloader then try to cast it to the same class loaded
> by another classloader. This will not work - they are represented by two
> different Class objects inside the JVM and the cast will fail.
[1] https://stackoverflow.com/a/826345/1362623