Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.0.5
Mapping documents:
<hibernate-mapping>
Code:
<class name="clientes.Cliente" table="Clientes">
<id name="id" column="id" type="integer">
<generator class="native"/>
</id>
<property name="Activo" column="Activo" not-null="true" type="boolean"/>
<property name="Comentarios" column="Comentarios" not-null="false" length="400" type="string"/>
<property name="Direccion" column="Direccion" not-null="true" length="200" type="string"/>
<property name="EMail" column="EMail" not-null="false" length="50" type="string"/>
<property name="Fax" column="Fax" not-null="false" length="20" type="string"/>
<property name="Telefono" column="Telefono" not-null="true" length="20" type="string"/>
<property name="Login" column="Login" not-null="false" length="20" type="string" />
<property name="Password" column="Password" not-null="false" length="20" type="string"/>
<property name="Nombre" column="Nombre" not-null="true" length="20" type="string"/>
<property name="Apellido" column="Apellido" not-null="false" length="20" type="string"/>
<property name="TipoDocumento" column="TipoDocumento" not-null="true" type="integer"/>
<property name="NumeroDocumento" column="NumeroDocumento" not-null="true" type="integer"/>
<property name="Celular" column="Celular" not-null="false" length="20" type="string"/>
<property name="CUILoCUIT" column="CUILoCUIT" not-null="true" type="boolean"/>
<property name="NumeroCUILoCUIT" column="NumeroCUILoCUIT" length="50" not-null="true" type="string"/>
<property name="AccesoWeb" column="AccesoWeb" not-null="true" type="boolean"/>
<property name="idEmpresa" column="idEmpresa" not-null="true" type="integer"/>
<many-to-one name="Empresa" column="idEmpresa" class="clientes.Empresa" update="false" insert="false" />
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Code:
session.merge(o);
session.flush();
session.refresh(o);
Full stack trace of any exception that occurs:Code:
GRAVE: could not initialize proxy - the owning Session was closed
org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:53)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:84)
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:134)
at clientes.Empresa$$EnhancerByCGLIB$$a57e897a.getDenominacion(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:491)
at ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:904)
at ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor.java:54)
at ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:122)
at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1616)
at ognl.ASTProperty.getValueBody(ASTProperty.java:96)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
at ognl.SimpleNode.getValue(SimpleNode.java:190)
at ognl.ASTChain.getValueBody(ASTChain.java:109)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
at ognl.SimpleNode.getValue(SimpleNode.java:190)
at ognl.Ognl.getValue(Ognl.java:333)
at com.opensymphony.xwork.util.OgnlValueStack.findValue(OgnlValueStack.java:167)
at com.opensymphony.webwork.views.jsp.PropertyTag.doStartTag(PropertyTag.java:55)
at org.apache.jsp.WEB.Clientes.clientesLoad_jsp._jspx_meth_ww_property_2(org.apache.jsp.WEB.Clientes.clientesLoad_jsp:425)
at org.apache.jsp.WEB.Clientes.clientesLoad_jsp._jspx_meth_ww_if_1(org.apache.jsp.WEB.Clientes.clientesLoad_jsp:402)
at org.apache.jsp.WEB.Clientes.clientesLoad_jsp._jspx_meth_ww_form_0(org.apache.jsp.WEB.Clientes.clientesLoad_jsp:277)
at org.apache.jsp.WEB.Clientes.clientesLoad_jsp._jspService(org.apache.jsp.WEB.Clientes.clientesLoad_jsp:138)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at com.opensymphony.webwork.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:81)
at com.opensymphony.webwork.dispatcher.WebWorkResultSupport.execute(WebWorkResultSupport.java:109)
at com.opensymphony.xwork.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:263)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:187)
at com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.intercept(DefaultWorkflowInterceptor.java:55)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at seguridad.ZeroPoint.intercept(ZeroPoint.java:48)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:115)
at com.opensymphony.webwork.dispatcher.ServletDispatcher.serviceAction(ServletDispatcher.java:272)
at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:237)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
[b]Name and version of the database you are using:[/b]
Microsoft SQL Server 2000
I need to refresh the one-to-one associated object, but when i shot the 'session.refresh(object)'... i'm getting this exception. It's a web-app (webwork).
**Any** idea will be appreciated. Thank you!!!