Problem with 2 jars


my project consist of two project

  • model.jar
  • webmanager.war

webmanager includes model.jar. model.jar has business logic, webmanager is vaadin representation logic.

But I get exception, when I change something in model.

Cause: java.lang.ClassCastException: com.snt.db.XPeople cannot be cast to com.snt.db.XPeople
at com.vaadin.event.ListenerMethod.receiveEvent(
at com.vaadin.event.EventRouter.fireEvent(
at com.vaadin.ui.AbstractComponent.fireEvent(

Then I have to restart tomcat (or glassfish) and everything works ok again.

Any ideas

Is the data objects (like XPeople) only in the model.jar, or do you have copies of them in webmanager.war? Sounds like it finds two different versions out of the same class, when it should only use one model.

Do you deploy only the webmanager.war into tomcat, or do you also add model.jar separately to it? You shouldn’t have to deploy the model.jar separately If webmanager.war includes it already. This could also cause in having to versions out of the same class.

Try to clean everything that goes to Tomcat and redeploy webmanager.

Thanks for suggestions, but it is still not working correctly.

Maybe it has something to do with fact that app is not copied to tomcat directory, but it is just deployed from netbeans (file deployment versus war deployment)?