In our project , we use CGLib to enhance the domain object for some reason. When I update the objects that was enhanced by CGLib, I met some exception:
net.sf.hibernate.MappingException: No persister for: omega.domain.order.PchsOrder$$EnhancerByCGLIB$$d4c727b3
at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:347)
at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2690)
at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2697)
at net.sf.hibernate.impl.SessionImpl.update(SessionImpl.java:1338)
at org.springframework.orm.hibernate.HibernateTemplate$14.doInHibernate(HibernateTemplate.java:511)
at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:312)
at org.springframework.orm.hibernate.HibernateTemplate.update(HibernateTemplate.java:508)
at omega.framework.dao.hibernate.UpdateCommand.command(UpdateCommand.java:31)
at omega.framework.dao.hibernate.PersistenceCommand.execute(PersistenceCommand.java:28)
at omega.framework.dao.hibernate.DAOFactoryHibernateImpl$ManagerDelegate.invoke(DAOFactoryHibernateImpl.java:206)
at $Proxy0.update(Unknown Source)
at omega.solution.service.order.PchsOrderService$ApprovePchsOrder.execute(PchsOrderService.java:297)
at omega.framework.service.engine.CommandEngine.serviceInvoke(CommandEngine.java:49)
at omega.framework.service.engine.CommandEngine.runSync(CommandEngine.java:34)
at omega.framework.service.AbstractRunnable.runInTransaction(AbstractRunnable.java:89)
at omega.framework.service.AbstractRunnable.invoke(AbstractRunnable.java:51)
at omega.framework.service.DefaultAction.run(DefaultAction.java:50)
at omega.framework.service.DefaultDomainService.runAction(DefaultDomainService.java:49)
at omega.framework.ui.action.FormAction.actionPerformed(FormAction.java:127)
at nextapp.echo.AbstractButton.fireActionPerformed(AbstractButton.java:256)
at nextapp.echo.AbstractButton$EventForwarder.actionPerformed(AbstractButton.java:135)
at nextapp.echo.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:98)
at nextapp.echo.DefaultButtonModel.doAction(DefaultButtonModel.java:87)
at nextapp.echo.AbstractButton.doAction(AbstractButton.java:245)
at nextapp.echoservlet.ui.AbstractButtonUI.clientAction(AbstractButtonUI.java:86)
at nextapp.echoservlet.ControllerInputProcessor.doAction(ControllerInputProcessor.java:157)
at nextapp.echoservlet.ControllerInputProcessor.<init>(ControllerInputProcessor.java:126)
at nextapp.echoservlet.ControllerInputProcessor.process(ControllerInputProcessor.java:54)
at nextapp.echoservlet.Controller.service(Controller.java:609)
at nextapp.echoservlet.Connection.process(Connection.java:459)
at nextapp.echoservlet.EchoServer.process(EchoServer.java:314)
at nextapp.echoservlet.EchoServer.doPost(EchoServer.java:234)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:822)
at org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:171)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:813)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:494)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:569)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:624)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1434)
at org.mortbay.http.HttpServer.service(HttpServer.java:896)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:366)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Does hibernate can handle these enhanced objects? How to do this?
Thanks,
rst
|