> -----Ursprungliche Nachricht-----
> Von: Scott Eade [mailto:[EMAIL PROTECTED]]
> Gesendet: Mittwoch, 9. Oktober 2002 01:05
> An: turbine-user
> Betreff: Re: casting extended User-object
>
>
> > From: "Marc Lustig" <[EMAIL PROTECTED]>
> >
> > Hi,
> > I have extended TurbineUser in my 2.2b3-based app.
> > Unfortunately when action-code is executed I get a "ClassCastException :
> > org.apache.turbine.om.security.TurbineUser"
> > when trying to get a user-reference like this:
> >
> > (AudiotexUser)data.getUser()
> >
> > Replacing the cast with TurbineUser has the same result.
> > Is anybody out there with an idea what is causing this?
>
> It depends.  How have you extended TurbineUser?  Does TR.props refer to
> TurbineUser ot to AudiotexUser?

For extending the user I have so far nothing done except putting the alias
table in app-schema.xml, so that torque generates the Peers like this:
public abstract class BaseAudiotexUser extends TurbineUser

I'm still bit confused by the two seperate TurbineUser-Classes, one in
org.apache.turbine.om.security, and the other one generated by Torque in
myorg.om.

TR.props:
services.SecurityService.user.class=org.apache.turbine.om.security.TurbineUs
er

So, apparently
data.getUser() returns org.apache.turbine.om.security.TurbineUser reference
But casting to (AudiotexUser) refers to class myorg.om.AudiotexUser which is
finally derived from BaseObject.

Any idea?

TIA.
Marc




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to