Note that there are some explanatory texts on larger screens.

plurals
  1. POClassCastException with GWT/RequestFactory on WebLogic
    primarykey
    data
    text
    <p>I'm setting up a GWT application based on GWT/RequestFactory on client side, and JPA/EclipseLink over WebLogic on server side.</p> <p>However, during development, everytime I change something on the server-side code (it can be an entity, the DAO, or even a comment in a Java file!), I get a <code>ClassCastException</code> between 2 apparently similar classes when I try to use my application, and the only way to get rid of it is to restart my WebLogic server. Even redeploying the application doesn't help.</p> <blockquote> <p>Feb 10, 2012 4:08:10 PM com.google.web.bindery.requestfactory.server.RequestFactoryServlet doPost SEVERE: Unexpected error java.lang.ClassCastException: com.mycompany.MyClass cannot be cast to com.mycompany.MyClass at com.mycompany.server.locator.CodeLevelLocator.getId(MyClassLocator.java:1) at com.google.web.bindery.requestfactory.server.LocatorServiceLayer.doGetId(LocatorServiceLayer.java:168) at com.google.web.bindery.requestfactory.server.LocatorServiceLayer.getId(LocatorServiceLayer.java:66) at com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.getId(ServiceLayerDecorator.java:81)</p> </blockquote> <p>Any idea how to avoid this server restart?</p> <p>Thanks.</p> <p><em>EDIT</em>: I'm setting up a bounty on this, because restarting WebLogic after each server change is really painful!!!</p> <p><em>EDIT2</em> solved thanks to James by adding the following ServletContextListener:</p> <pre><code>public class DeploymentListener implements ServletContextListener { private static Logger log = LoggerFactory .getLogger(DeploymentListener.class.getName()); @Override public void contextDestroyed(ServletContextEvent arg0) { try { // close the Entity Manager Factory. EMF.close(); } catch (Exception e) { log.error("Error closing the Entity Manager Factory", e); } } @Override public void contextInitialized(ServletContextEvent arg0) { // nothing to do } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload