disable lazy-initialisation in /WEB-INF/applicationContext.xml

<bean id="testDataProvider" 
class="org.apache.struts2.showcase.application.TestDataProvider" 
singleton="true" lazy-init="false"/>

Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




> To: user@struts.apache.org
> From: nathan.schu...@ngc.com
> Subject: Re: Struts2 + JPA + JSON - Help with error
> Date: Fri, 31 Jul 2009 13:50:14 +0000
> 
> Nathan Schulte <nathan.schulte <at> ngc.com> writes:
> 
> > 
> > Nathan Schulte <nathan.schulte <at> ngc.com> writes:
> > > here, http://article.gmane.org/gmane.comp.jakarta.struts.user/170543,
> > http://article.gmane.org/gmane.comp.jakarta.struts.user/170543
> > 
> > > Here is a link to the error, http://pastebin.com/m5d0d22c8.
> > http://pastebin.com/m5d0d22c8
> > 
> > Also, here is the exception report (of a similar action) given as the HTTP
> > response:
> > http://pastebin.com/m21348ec5
> > 
> 
> I have found a fix for this issue.  As it turns out, because the JSON Plugin 
> is
> using reflection, and the entities the JSON Plugin is reflecting on are using
> Hibernate/JPA "lazy initialization magic", the JSON Plugin was serializing the
> "magic" as well.  This "magic" contains references to underlying JPA
> implementation, which also contains references, which also contain references,
> all the way down past the JDBC layer.  I didn't go as far as to find out what
> was causing this particular error/exception, but simply knew that I don't want
> the Plugin to serialize the hibernateLazyInitializer instances in my 
> entities. 
> The Plugin supports property exclusion via regex, thus the simple fix.
> 
> Hey, perhaps this property exclusion property will come in handy to keep from
> loading the whole database into memory for those self joins I have on my
> entities... :P.
> 
> On another note, although this fixes my particular issue, perhaps there is 
> some
> more elegant solution to help with anything implementing this (or other
> problematic) OOP patterns.
> 
> -Nate
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_________________________________________________________________
Bing™ brings you maps, menus, and reviews organized in one place. Try it now.
http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TXT_MLOGEN_Local_Local_Restaurants_1x1

Reply via email to