0

I am migrating a legacy web application from Jboss AS7.1 to Wildfly 8.2. The application works perfectly on AS7. It stores a User object in the session using session.setAttribute() and retrieves it in various places where it needs to know the user details.

The application works fine on the first start of the Wildfly server. When I re-deploy the application (from Eclipse) it then fails when retrieving the session attribute with a ClassCastException (com.mycompany.User cannot be cast to com.mycompany.User). I cannot run the application without restarting the server completely. The application is a basic war deployment with a few dependencies in the lib folder.

I've run in debug and dumped the classloader name and can't see any problems. There is only 1 version of the User class in the application (it's inside a jar in the WEB-INF/lib folder). If I retrieve the session attribute as an Object and check 'obj instanceof User' it returns false. It seems to be holding onto something between deployments somehow but I can't find out what.

Has anyone come across anything similar? Thanks

0 Answers0