Я получаю "неинициализированный прокси, переданный в persist ()" при сохранении объекта.Что это значит ?org.hibernate.PersistentObjectException: неинициализированный прокси, переданный функции persist ()
У сущности есть отношение один ко многим, как @ManyToOne @JoinColumn (name = "brand_id") private Brand brand;
и одно отношение OneToOne как, @OneToOne (cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JoinColumn (name = "addressToSendAC_FK") private BrandAddress addressToSendAC;
Они вызывают ошибку?
Редактировать:
Добавлена трассировка стека.[# | 2011-06-30T14: 36: 29,920 + 0530 | ТЯЖЕЛАЯ | glassfish3.0.1 | javax.enterprise.system.std.com.sun.enterprise.v3.services.impl | _ThreadID = 58; _ThreadName = Thread-1..java: 1147) в org.hibernate.ejb.AbstractEntityManagerImpl.convert (AbstractEntityManagerImpl.java:1153) в org.hibernate.ejb.AbstractEntityManagerImpl.persist (AbstractEntityManagerImpl.jent.omp.ower.ompor .67) .67) .67BrandRegistry $ 11.execute (BrandRegistry.java:271) в com.wompower.entity.accessor.common.AbstractEntityAccessor.doInTransaction (AbstractEntityAccessor.java:82) в com.wompower.entity.accessor.brand.BrandRegistry.addBrandjg: 267) at com.wompower.backing.brand.ActivationCodeBacking.generateActivationCode (ActivationCodeBacking.java:141) в sun.reflect.NativeMethodAccessorImpl.invoke0 (нативный метод) в sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) в sun.reflect.Dljhoot.lang.reflect.Method.invoke (Method.java:613) в com.sun.el.parser.AstValue.invoke (AstValue.java:234) в com.sun.el.MethodExpressionImpl.invoke (MethodExpressionImpl.java:297) в com.sun.faces.facelets.el.TagMethodExpression.invoke (TagMethodExpression.java:98) в javax.faces.event.MethodExpressionActionListener.processAction (MethodExpressionActionListener.java:148) в javax.faceEer.ecessAActionEvent.java:88) на javax.faces.component.UIComponentBase.broadcast (UIComponentBase.java:772) на javax.faces.component.UICommand.broadcast (UICommand.java:300) на javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775) в javax.faces.component.UIViewRoot.processApplication (UIViewRoot.java:1267)на com.sun.faces.lifecycle.InvokeApplicationPhase.execute (InvokeApplicationPhase.java:82) на com.sun.faces.lifecycle.Phase.doPhase (Phase.java:101) на com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) в javax.faces.webapp.FacesServlet.service (FacesServlet.java:312) в org.apache.catalina.core.StandardWrapper.service (StandardWrapper.java:1523) в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:343) в org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:215) в org.primefaces.webapp.filter.Fil.pload.FilUpFв org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:256) в org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:215) в com.ocililFilterFretter.java: 115) в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:256) в org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:215) в org.apache.catalina.core.ApplicationDispatcher.doInvoke (ApplicationDispatcher.java:820)в org.apache.catalina.core.ApplicationDispatcher.invoke (ApplicationDispatcher.java:684)
в org.apache.catalina.core.ApplicationDispatcher.processRequest (ApplicationDispatcher.java:517)
в org.apache.catalina.core.ApplicationDispatcher.doDispatch (ApplicationDispatcher.java:488)
в org.apache.catalina.core.ApplicationDispatcher.dispatch (ApplicationDispatcher.java:379)
в org.apache.catalina.core.ApplicationDispatcher.dispatch (ApplicationDispatcher.java:336)
в org.apache.catalina.core.ApplicationDispatcher.forward (ApplicationDispatcher.java:314)
на com.ocpsoft.pretty.PrettyFilter.doFilter (PrettyFilter.java:107)
в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:256)
в org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:215)
в org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:277)
в org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:188)
в org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:641)
на com.sun.enterprise.web.WebPipeline.invoke (WebPipeline.java:97)
в com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke (PESessionLockingStandardPipeline.java:85)
в org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:185)
в org.apache.catalina.connector.CoyoteAdapter.doService (CoyoteAdapter.java:325)
в org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:226)
на com.sun.enterprise.v3.services.impl.ContainerMapper.service (ContainerMapper.java:165)
в com.sun.grizzly.http.ProcessorTask.invokeAdapter (ProcessorTask.java:791)
на com.sun.grizzly.http.ProcessorTask.doProcess (ProcessorTask.java:693)
на com.sun.grizzly.http.ProcessorTask.process (ProcessorTask.java:954)
на com.sun.grizzly.http.DefaultProtocolFilter.execute (DefaultProtocolFilter.java:170)
в com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter (DefaultProtocolChain.java:135)
на com.sun.grizzly.DefaultProtocolChain.execute (DefaultProtocolChain.java:102)
на com.sun.grizzly.DefaultProtocolChain.execute (DefaultProtocolChain.java:88)
на com.sun.grizzly.http.HttpProtocolChain.execute (HttpProtocolChain.java:76)
в com.sun.grizzly.ProtocolChainContextTask.doCall (ProtocolChainContextTask.java:53)
на com.sun.grizzly.SelectionKeyContextTask.call (SelectionKeyContextTask.java:57)
на com.sun.grizzly.ContextTask.run (ContextTask.java:69)
на com.sun.grizzly.util.AbstractThreadPool $ Worker.doWork (AbstractThreadPool.java:330)
на com.sun.grizzly.util.AbstractThreadPool $ Worker.run (AbstractThreadPool.java:309)
at java.lang.Thread.run (Thread.java:729)
Вызывается: org.hibernate.PersistentObjectException: неинициализированный прокси передается в persist ()
в org.hibernate.event.def.DefaultPersistEventListener.onPersist (DefaultPersistEventListener.java:83)
в org.hibernate.impl.SessionImpl.firePersist (SessionImpl.java:799)
в org.hibernate.impl.SessionImpl.persist (SessionImpl.java:791)
в org.hibernate.engine.EJB3CascadingAction $ 1.cascade (EJB3CascadingAction.java:48)
в org.hibernate.engine.Cascade.cascadeToOne (Cascade.java:392)
в org.hibernate.engine.Cascade.cascadeAssociation (Cascade.java:335)
в org.hibernate.engine.Cascade.cascadeProperty (Cascade.java:204)
в org.hibernate.engine.Cascade.cascade (Cascade.java:161)
at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave (AbstractSaveEventListener.java:450)
в org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate (AbstractSaveEventListener.java:282)
в org.hibernate.event.def.AbstractSaveEventListener.performSave (AbstractSaveEventListener.java:203)
в org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId (AbstractSaveEventListener.java:143)в org.hibernate.ejb.event.(DefaultPersistEventListener.java:135) в org.hibernate.impl.SessionImpl.firePersist (SessionImpl.java:799) в org.hibernate.impl.SessionImpl.persist (SessionImpl.java:791) в org.hibernate.enascAJJ..cascade (EJB3CascadingAction.java:48) в org.hibernate.engine.Cascade.cascadeToOne (Cascade.java:392) в org.hibernate.engine.Cascade.cascadeAssociation (Cascade.java:335) в org.hibernate.engine.Cascade.cascadeProperty (Cascade.java:204) в org.hibernate.engine.Cascade.cascade (Cascade.java:161) в org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave (AbstractSaveEventListener.java:4).event.def.AbstractSaveEventListener.performSaveOrReplicate (AbstractSaveEventListener.Java: 282) в org.hibernate.event.def.AbstractSaveEventListener.performSave (AbstractSaveEventListener.java:203) в org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId (AbstractSaveEventListenh.jb) .j#]
[# | 2011-06-30T14: 36: 29.920 + 0530 | SEVERE | glassfish3.0.1 | javax.enterprise.system.std.com.sun.enterprise.v3.services.impl | _ThreadID= 58; _ThreadName = Thread-1; | event.EJB3PersistEventListener.saveWithGeneratedId (EJB3PersistEventListener.java:69) в org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient (DefaultPersistEv.DefaultPersistEventListener.onPersist (DefaultPersistEventListener.java:135) в org.hibernate.event.def.DefaultPersistEventListener.onPersist (DefaultPersistEventListener.java:61) в org.hibernate.impl.SessionImplj.histerPhister.impl.SessionImpl.persist (SessionImpl.java:782) в org.hibernate.impl.SessionImpl.persist (SessionImpl.java: 786) at org.hibernate.ejb.AbstractEntityManagerImpl.persist (AbstractEntityManagerImpl.java:672) ... еще 63