ClassCast Exception in a CrossContext Web Application
843841Sep 26 2006 — edited Sep 26 2006This is my set-up...
I have two applications sharing a context in a Tomcat container. The first application (A) handles authentication requests and generates a token and writes it to a Hashtable stored in the servlet context....
The second (B) app picks-up (supposed to) the token generated by A; B calls context A via context.getContext("/A"); acquires the token object from A and as a result, grants or rejects access to the application...
The object written in the context variable is a Serialized object... Both contexts A and B have the object under the same packages.
Within context A I am able to retrieve the object contents, after I write it... It gives a java.lang.classcastexception in context B... When I repeat this exercise with String or Vector types the program works, but I seem to get the exception whenever I am trying to acquire my object...
Any ideas are appreciated...