Re: Weird bug
.corelib.components.RenderObject.beginRender(RenderObject.java:40) at org.apache.tapestry5.corelib.components.RenderObject.beginRender(RenderObject.java) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl$11$1.run(ComponentPageElementImpl.java:334) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:899) ... 51 more Original-Nachricht Datum: Sun, 25 Jan 2009 11:55:18 -0800 Von: Howard Lewis Ship hls...@gmail.com An: Tapestry users users@tapestry.apache.org Betreff: Re: Weird bug I'm curious as well as to why this would result in a 500 rather than the T5 ExceptionReport. Any other configuration? What's the full stack trace of the exception? On Sun, Jan 25, 2009 at 4:54 AM, Thiago HP thiag...@gmail.com wrote: On Sat, Jan 24, 2009 at 8:01 PM, superoverdr...@gmx.de wrote: The following code: public Object onActivate(int domainID) { domain = (Domain)sessionManager.getSession().load(Domain.class, new Integer(domainID)); return this; } One advice: some very subtle and hard-to-find @Persist-related bugs may happen when you return this in a event handler method. Return null instead. Another advice: Session.load() raises an exception whan the wanted object was not loaded in this session before. As stated before, use Session.get(). 1. How do you avoid this error? This is a LazyInstantiationException. It happens when you try to lazy-load some property value from an object that is not associated with an open session. To associate an object with a session. do session.lock(object, LockMode.NONE). 2. Why is this a Jetty error and not a Tapestry5 error message? Is this something I should report as bugreport? IMHO, it is a bug. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Weird bug
Maybe there is a problem with lazy fetching. So if you call getXXX on lazy attribute you force hibernate to fetch it, because it is still managed. If you need attribute later and entity is detached getter fails. So just call getter on attributes you need to force load and you will be ok. T superoverdr...@gmx.de napsal(a): The same (if you mean the hibernate session). With get it works instead of load...but Strange that getDomainName() which is in the same table cause it to load associated tables Original-Nachricht Datum: Sun, 25 Jan 2009 01:11:54 +0100 Von: Tomas Kolda ko...@web2net.cz An: Tapestry users users@tapestry.apache.org Betreff: Re: Weird bug What happen when you use injected session instead of sessionmanager? @Inject private Session session; public Object onActivate(int domainID) { domain = (Domain)this.session.get(Domain.class, Integer.valueOf(domainID)); return this; } Tomas superoverdr...@gmx.de napsal(a): The following code: public Object onActivate(int domainID) { domain = (Domain)sessionManager.getSession().load(Domain.class, new Integer(domainID)); return this; } leads to: HTTP ERROR: 500 Render queue error in BeginRender[core/ExceptionReport:renderobject_0]: could not initialize proxy - no Session RequestURI=/editdomain Powered by Jetty:// However, if I add this line: public Object onActivate(int domainID) { domain = (Domain)sessionManager.getSession().load(Domain.class, new Integer(domainID)); System.out.println(domain.getDomainName()); return this; } The error does not occur. My question is: 1. How do you avoid this error? 2. Why is this a Jetty error and not a Tapestry5 error message? Is this something I should report as bugreport? Thanks! Toby - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Weird bug
On Sat, Jan 24, 2009 at 8:01 PM, superoverdr...@gmx.de wrote: The following code: public Object onActivate(int domainID) { domain = (Domain)sessionManager.getSession().load(Domain.class, new Integer(domainID)); return this; } One advice: some very subtle and hard-to-find @Persist-related bugs may happen when you return this in a event handler method. Return null instead. Another advice: Session.load() raises an exception whan the wanted object was not loaded in this session before. As stated before, use Session.get(). 1. How do you avoid this error? This is a LazyInstantiationException. It happens when you try to lazy-load some property value from an object that is not associated with an open session. To associate an object with a session. do session.lock(object, LockMode.NONE). 2. Why is this a Jetty error and not a Tapestry5 error message? Is this something I should report as bugreport? IMHO, it is a bug. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Weird bug
I'm curious as well as to why this would result in a 500 rather than the T5 ExceptionReport. Any other configuration? What's the full stack trace of the exception? On Sun, Jan 25, 2009 at 4:54 AM, Thiago HP thiag...@gmail.com wrote: On Sat, Jan 24, 2009 at 8:01 PM, superoverdr...@gmx.de wrote: The following code: public Object onActivate(int domainID) { domain = (Domain)sessionManager.getSession().load(Domain.class, new Integer(domainID)); return this; } One advice: some very subtle and hard-to-find @Persist-related bugs may happen when you return this in a event handler method. Return null instead. Another advice: Session.load() raises an exception whan the wanted object was not loaded in this session before. As stated before, use Session.get(). 1. How do you avoid this error? This is a LazyInstantiationException. It happens when you try to lazy-load some property value from an object that is not associated with an open session. To associate an object with a session. do session.lock(object, LockMode.NONE). 2. Why is this a Jetty error and not a Tapestry5 error message? Is this something I should report as bugreport? IMHO, it is a bug. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Weird bug
:18 -0800 Von: Howard Lewis Ship hls...@gmail.com An: Tapestry users users@tapestry.apache.org Betreff: Re: Weird bug I'm curious as well as to why this would result in a 500 rather than the T5 ExceptionReport. Any other configuration? What's the full stack trace of the exception? On Sun, Jan 25, 2009 at 4:54 AM, Thiago HP thiag...@gmail.com wrote: On Sat, Jan 24, 2009 at 8:01 PM, superoverdr...@gmx.de wrote: The following code: public Object onActivate(int domainID) { domain = (Domain)sessionManager.getSession().load(Domain.class, new Integer(domainID)); return this; } One advice: some very subtle and hard-to-find @Persist-related bugs may happen when you return this in a event handler method. Return null instead. Another advice: Session.load() raises an exception whan the wanted object was not loaded in this session before. As stated before, use Session.get(). 1. How do you avoid this error? This is a LazyInstantiationException. It happens when you try to lazy-load some property value from an object that is not associated with an open session. To associate an object with a session. do session.lock(object, LockMode.NONE). 2. Why is this a Jetty error and not a Tapestry5 error message? Is this something I should report as bugreport? IMHO, it is a bug. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Weird bug
Hi, this is complety unrelate to Tapestry. Go and ask the Hibernate forums or read Hibernate docs (API of load() and get() would be a good starter). Cheers, Andy superoverdr...@gmx.de schrieb: The following code: public Object onActivate(int domainID) { domain = (Domain)sessionManager.getSession().load(Domain.class, new Integer(domainID)); return this; } leads to: HTTP ERROR: 500 Render queue error in BeginRender[core/ExceptionReport:renderobject_0]: could not initialize proxy - no Session RequestURI=/editdomain Powered by Jetty:// However, if I add this line: public Object onActivate(int domainID) { domain = (Domain)sessionManager.getSession().load(Domain.class, new Integer(domainID)); System.out.println(domain.getDomainName()); return this; } The error does not occur. My question is: 1. How do you avoid this error? 2. Why is this a Jetty error and not a Tapestry5 error message? Is this something I should report as bugreport? Thanks! Toby - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Weird bug
What happen when you use injected session instead of sessionmanager? @Inject private Session session; public Object onActivate(int domainID) { domain = (Domain)this.session.get(Domain.class, Integer.valueOf(domainID)); return this; } Tomas superoverdr...@gmx.de napsal(a): The following code: public Object onActivate(int domainID) { domain = (Domain)sessionManager.getSession().load(Domain.class, new Integer(domainID)); return this; } leads to: HTTP ERROR: 500 Render queue error in BeginRender[core/ExceptionReport:renderobject_0]: could not initialize proxy - no Session RequestURI=/editdomain Powered by Jetty:// However, if I add this line: public Object onActivate(int domainID) { domain = (Domain)sessionManager.getSession().load(Domain.class, new Integer(domainID)); System.out.println(domain.getDomainName()); return this; } The error does not occur. My question is: 1. How do you avoid this error? 2. Why is this a Jetty error and not a Tapestry5 error message? Is this something I should report as bugreport? Thanks! Toby - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Weird bug
Not quite...ideally it would at least not crash completely and manage to display a Tapestry error message Eager fetches are not an option for me in this case... Original-Nachricht Datum: Sun, 25 Jan 2009 00:34:05 +0100 Von: Andy Pahne andy.pa...@googlemail.com An: Tapestry users users@tapestry.apache.org Betreff: Re: Weird bug Hi, this is complety unrelate to Tapestry. Go and ask the Hibernate forums or read Hibernate docs (API of load() and get() would be a good starter). Cheers, Andy superoverdr...@gmx.de schrieb: The following code: public Object onActivate(int domainID) { domain = (Domain)sessionManager.getSession().load(Domain.class, new Integer(domainID)); return this; } leads to: HTTP ERROR: 500 Render queue error in BeginRender[core/ExceptionReport:renderobject_0]: could not initialize proxy - no Session RequestURI=/editdomain Powered by Jetty:// However, if I add this line: public Object onActivate(int domainID) { domain = (Domain)sessionManager.getSession().load(Domain.class, new Integer(domainID)); System.out.println(domain.getDomainName()); return this; } The error does not occur. My question is: 1. How do you avoid this error? 2. Why is this a Jetty error and not a Tapestry5 error message? Is this something I should report as bugreport? Thanks! Toby - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Weird bug
The same (if you mean the hibernate session). With get it works instead of load...but Strange that getDomainName() which is in the same table cause it to load associated tables Original-Nachricht Datum: Sun, 25 Jan 2009 01:11:54 +0100 Von: Tomas Kolda ko...@web2net.cz An: Tapestry users users@tapestry.apache.org Betreff: Re: Weird bug What happen when you use injected session instead of sessionmanager? @Inject private Session session; public Object onActivate(int domainID) { domain = (Domain)this.session.get(Domain.class, Integer.valueOf(domainID)); return this; } Tomas superoverdr...@gmx.de napsal(a): The following code: public Object onActivate(int domainID) { domain = (Domain)sessionManager.getSession().load(Domain.class, new Integer(domainID)); return this; } leads to: HTTP ERROR: 500 Render queue error in BeginRender[core/ExceptionReport:renderobject_0]: could not initialize proxy - no Session RequestURI=/editdomain Powered by Jetty:// However, if I add this line: public Object onActivate(int domainID) { domain = (Domain)sessionManager.getSession().load(Domain.class, new Integer(domainID)); System.out.println(domain.getDomainName()); return this; } The error does not occur. My question is: 1. How do you avoid this error? 2. Why is this a Jetty error and not a Tapestry5 error message? Is this something I should report as bugreport? Thanks! Toby - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org