We used to have a EAR that included an EJB jar and a WAR. From the EJB we sent a dto class to the WAR. Everything was fine.
Now we have tried to extract the WAR from the EAR and created a EJB-client (API jar) that the WAR uses. This API jar includes the dto class that we send from the EJB to the WAR.
In the EAR the API is deployed in the lib directory.
In the WAR we have the same API jar in WEB-INF/lib directory.
But now we get a ClassCastException when accessing the internals of the dto class.
The method call to the EJB goes ok and we can assign the resulting List in the WAR. But when we try to read a value from the DTO class we get ClassCastException.
We have checked over and over again so the API jar is not imported twice somewhere in the EAR or the WAR. But now we are at the brink of giving up.
Anybody have any idea what we are doing wrong?