You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dave Newton <ne...@yahoo.com> on 2007/11/16 15:41:28 UTC

[OT] Re: ClassCastException

What's "utente"?

In any case, you don't say where the exception is, but
for whatever reason your DAO isn't getting a user (if
that's where the exception is).

d.

--- slideharmony <se...@tiscali.it> wrote:

> 
> Hello,
> I have a problem saving a bean User. I use the
> following code:
> 
> UserDao dao = new UserDao();
> User user = new User();
> Service.populate(user);
> dao.save(utente);
> if(user != null){
> return SUCCESS;
> }
> 
> here is the dao.save method:
> 
> 
> public User save(User user){
> Utente newuser = null;
> begin();
> newuser = (User)getSession().save(user);
> commit();
> close();
> return newuser;
> }
> 
> this code throws a ClassCastException:
> java.lang.Long
> I have mapped all correctly, i have the same code
> that works perfectly in
> struts, but I get that exception with struts2. Can
> anybody help me?
> -- 
> View this message in context:
>
http://www.nabble.com/ClassCastException-tf4821639.html#a13794339
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


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