turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juergen Hoffmann" <hoffm...@apache.org>
Subject AW: StackOverflowError when calling user.save()
Date Wed, 10 Dec 2008 13:14:28 GMT
Hi Ludwig,

please have a look at:

http://turbine.apache.org/turbine/turbine-2.3.3/howto/extend-user-howto.html

Kind regards

Juergen

> -----Urspr√ľngliche Nachricht-----
> Von: Ludwig Magnusson [mailto:ludwig@greenstreetconsulting.se]
> Gesendet: Dienstag, 9. Dezember 2008 17:05
> An: 'Turbine Users List'
> Betreff: RE: StackOverflowError when calling user.save()
> 
> Thank you, it is a little bit clearer now.
> One thing I don't understand however is this:
> In
> http://turbine.apache.org/turbine/turbine-2.3.3/services/torque-
> security-ser
> vice.html there is an exapmple of an extended user class. It looks lie
> this:
> public class ExtendedUser extends TorqueUser
> {
>   public ExtendedUser()
>   {
>       super();
>   }
> 
>   public ExtendedUser(Persistent obj)
>   {
>       super(obj);
>   }
> 
>   public String getPhone()
>   {....
> 
> How is this class created? Do I write it myself or is it created via
> the ant
> script? The thing that confuses me is that it extends TorqueUser and
> not
> BaseExtendedUser. How do I make that connection?
> /Ludwig
> 
> -----Original Message-----
> From: Juergen Hoffmann [mailto:hoffmann@apache.org]
> Sent: den 9 december 2008 16:22
> To: 'Turbine Users List'
> Subject: AW: StackOverflowError when calling user.save()
> 
> Hi Ludwig,
> 
> so not use the TurbineUser Directly. Please use TurbineSecurity Object
> for
> that.
> 
> Please read
> 
> http://turbine.apache.org/turbine/turbine-
> 2.3.3/apidocs/org/apache/turbine/s
> ervices/security/TurbineSecurity.html
> http://turbine.apache.org/turbine/turbine-2.3.3/services/torque-
> security-ser
> vice.html
> 
> It will make everything a lot clearer
> 
> Kind regards
> 
> Juergen
> 
> 
> > -----Urspr√ľngliche Nachricht-----
> > Von: Ludwig Magnusson [mailto:ludwig@greenstreetconsulting.se]
> > Gesendet: Dienstag, 9. Dezember 2008 13:36
> > An: user@turbine.apache.org
> > Betreff: StackOverflowError when calling user.save()
> >
> > Hello!
> >
> > I'm setting up a turbine/torque site and I am having trouble with my
> > user om
> > class. Calling the save method initiates a circular pattern of method
> > calls.
> > After a few seconds the JVM thorws a StackOverflowError. At first I
> > thought
> > it might have something to do with my configuration on extending the
> > turbine
> > user but I tried to do it with the turbine user class
> > (org.apache.turbine.om.security.TurbineUser) and the same error
> occurs.
> >
> > Here is my code:
> >
> >
> >
> > TurbineUser user = new TurbineUser();
> >
> > user.setEmail("r2@d2.com");
> >
> > user.setName("R2D2");
> >
> > user.setPassword("ilovec3po");
> >
> > user.setFirstName("R2");
> >
> > user.setLastName("D2");
> >
> > user.save();
> >
> >
> >
> > This is the stack trace that is printed:
> >
> >
> >
> > Horrible Exception: java.lang.reflect.InvocationTargetException
> >
> >         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
> >
> org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(Velo
> > cityA
> > ctionEvent.java:135)
> >
> >         at
> >
> org.apache.turbine.util.velocity.VelocityActionEvent.perform(VelocityAc
> > tionE
> > vent.java:78)
> >
> >         at
> >
> org.apache.turbine.modules.actions.VelocityAction.perform(VelocityActio
> > n.jav
> > a:72)
> >
> >         at
> > org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:99)
> >
> >         at
> >
> org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:1
> > 13)
> >
> >         at org.apache.turbine.modules.Page.build(Page.java:53)
> >
> >         at
> > org.apache.turbine.modules.PageLoader.exec(PageLoader.java:101)
> >
> >         at org.apache.turbine.Turbine.doGet(Turbine.java:789)
> >
> >         at org.apache.turbine.Turbine.doPost(Turbine.java:884)
> >
> >         at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
> >
> >         at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
> >
> >         at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
> > ation
> > FilterChain.java:269)
> >
> >         at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
> > terCh
> > ain.java:188)
> >
> >         at
> >
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
> > ve.ja
> > va:213)
> >
> >         at
> >
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal
> > ve.ja
> > va:172)
> >
> >         at
> >
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticato
> > rBase
> > .java:433)
> >
> >         at
> >
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav
> > a:127
> > )
> >
> >         at
> >
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav
> > a:117
> > )
> >
> >         at
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve
> > .java
> > :108)
> >
> >         at
> >
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
> > 174)
> >
> >         at
> >
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:8
> > 75)
> >
> >         at
> >
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.pro
> > cessC
> > onnection(Http11BaseProtocol.java:665)
> >
> >         at
> >
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoin
> > t.jav
> > a:528)
> >
> >         at
> >
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollo
> > werWo
> > rkerThread.java:81)
> >
> >         at
> >
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo
> > l.jav
> > a:689)
> >
> >         at java.lang.Thread.run(Unknown Source)
> >
> > Caused by: java.lang.StackOverflowError
> >
> >         at java.lang.ClassLoader.findBootstrapClass(Native Method)
> >
> >         at java.lang.ClassLoader.findBootstrapClass0(Unknown Source)
> >
> >         at java.lang.ClassLoader.loadClass(Unknown Source)
> >
> >         at java.lang.ClassLoader.loadClass(Unknown Source)
> >
> >         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> >
> >         at java.lang.ClassLoader.loadClass(Unknown Source)
> >
> >         at
> >
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoade
> > r.jav
> > a:1301)
> >
> >         at
> >
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoade
> > r.jav
> > a:1232)
> >
> >         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> >
> >         at
> >
> org.apache.commons.lang.exception.NestableException.<init>(NestableExce
> > ption
> > .java:95)
> >
> >         at
> > org.apache.torque.TorqueException.<init>(TorqueException.java:79)
> >
> >         at
> >
> org.apache.turbine.services.security.torque.UserPeerManager.doSelect(Us
> > erPee
> > rManager.java:736)
> >
> >         at
> >
> org.apache.turbine.services.security.torque.TorqueUserManager.accountEx
> > ists(
> > TorqueUserManager.java:102)
> >
> >         at
> >
> org.apache.turbine.services.security.torque.TorqueUserManager.accountEx
> > ists(
> > TorqueUserManager.java:81)
> >
> >         at
> >
> org.apache.turbine.services.security.BaseSecurityService.accountExists(
> > BaseS
> > ecurityService.java:656)
> >
> >         at
> >
> org.apache.turbine.services.security.TurbineSecurity.accountExists(Turb
> > ineSe
> > curity.java:228)
> >
> >         at
> > org.apache.turbine.om.security.TurbineUser.save(TurbineUser.java:634)
> >
> >         at
> >
> org.apache.turbine.services.security.torque.TorqueUserManager.createAcc
> > ount(
> > TorqueUserManager.java:460)
> >
> >         at
> >
> org.apache.turbine.services.security.BaseSecurityService.addUser(BaseSe
> > curit
> > yService.java:827)
> >
> >         at
> >
> org.apache.turbine.services.security.TurbineSecurity.addUser(TurbineSec
> > urity
> > .java:561)
> >
> >         at
> > org.apache.turbine.om.security.TurbineUser.save(TurbineUser.java:640)
> >
> >         at
> >
> org.apache.turbine.services.security.torque.TorqueUserManager.createAcc
> > ount(
> > TorqueUserManager.java:460)
> >
> >         at
> >
> org.apache.turbine.services.security.BaseSecurityService.addUser(BaseSe
> > curit
> > yService.java:827)
> >
> >         at
> >
> org.apache.turbine.services.security.TurbineSecurity.addUser(TurbineSec
> > urity
> > .java:561)
> >
> >         at
> > org.apache.turbine.om.security.TurbineUser.save(TurbineUser.java:640)
> >
> >
> >
> > The four last lines then loop forever (at least for a long while =) )
> >
> > I took a  look in the code for TorqueUserManager and the last thing
> > done in
> > the createAccount-method is to save the user object wich does indeed
> > start
> > the process over again. Is this correct?
> >
> > Any help is appreciated.
> >
> > /Ludwig
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@turbine.apache.org
> For additional commands, e-mail: user-help@turbine.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@turbine.apache.org
> For additional commands, e-mail: user-help@turbine.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@turbine.apache.org
For additional commands, e-mail: user-help@turbine.apache.org


Mime
View raw message