struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas De Loof" <nicolas.del...@cgey.com>
Subject Re: class cast exception
Date Thu, 16 May 2002 11:29:34 GMT


Could you please post the source code of your
de.jamba.controller.web.FlowManager.processActionForm class ?

Nico

> Do Mai 16 12:42:51 CEST 2002:<E> <WebAppServletContext-det> FlowManager:
> Error c
> reating ActionForm instance of class
> 'de.jamba.b2b.tmotion.action.web.MyActionFo
> rm'
> java.lang.ClassCastException: de.jamba.b2b.tmotion.action.web.MyActionForm
>         at de.jamba.controller.web.FlowManager.processActionForm(Unknown
> Source)
>
>         at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:141
> 2)
>         at
> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:463)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
>         at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:106)
>         at
> weblogic.servlet.internal.ServletContextImpl.invokeServlet(Unknown So
> urce)
>         at
> weblogic.servlet.internal.ServletContextImpl.invokeServlet(Unknown So
> urce)
>         at
> weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
> ContextManager.java:252)
>         at weblogic.socket.MuxableSocketHTTP.invokeServlet(Unknown Source)
>         at weblogic.socket.MuxableSocketHTTP.execute(Unknown Source)
>         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
>
>
> _form:
> Do Mai 16 12:42:51 CEST 2002:<E> <WebAppServletContext-det> Servlet
> failed with
> Exception
> Nicolas De Loof wrote:
>
> >Could you please insert in your action class the line :
> >
> >System.out.println(form.getClass().getName());
> >(or another logging method)
> >
> >so we can have more infos about what's happening with your form ?
> >
> >and please give us the complete java source code of your FormBean as
> >attachement
> >
> >Nico
> >
> >
> >
> >
> >>Im shure....
> >>
> >>entry in struts-config
> >>===============
> >><form-bean     name="SimpleForm"
> >>             type="de.jamba.b2b.tmotion.action.web.MyActionForm"/>
> >>
> >><action    path="/action"
> >>               type="de.jamba.b2b.tmotion.action.web.StrutsAction"
> >>               name="SimpleForm"
> >>               scope="request"
> >>               validate="false">
> >>
> >>
> >>        <forward name="forward"    path="/test.jsp" />
> >>
> >>
> >>form - bean
> >>==========
> >>public class MyActionForm extends ActionForm {
> >>
> >>   private String param1;
> >>     public String getParam1(){
> >>       return param1;
> >>   }
> >>     public void setParam1(String param){
> >>       this.param1=param;
> >>   }
> >>
> >>
> >>}
> >>
> >>action
> >>=====
> >>
> >>public class StrutsAction extends Action{
> >>
> >>   public StrutsAction() {
> >>   }
> >>
> >>   public ActionForward perform(ActionMapping mapping,
> >>                ActionForm form,
> >>                HttpServletRequest request,
> >>                HttpServletResponse response)
> >>          throws IOException, ServletException
> >>   {
> >>     MyActionForm myActionForm = (MyActionForm) form;
> >>     myActionForm.setParam1("_new value");
> >>         return mapping.findForward("forward");
> >>   }
> >>
> >>}
> >>
> >>
> >>When connecting to the action (action.do) I get a class cast
> >>exception......
> >>and I dont know why..
> >>
> >>any help would be appreciated...
> >>
> >>Erich Meier wrote:
> >>
> >>
> >>
> >>>On Thu, May 16, 2002 at 11:13:17AM +0200, Thorsten Maus wrote:
> >>>
> >>>
> >>>
> >>>
> >>>>Hi there...
> >>>>
> >>>>I posted a question on a class cast exception yesterday....and Im not
> >>>>getting any further..
> >>>>
> >>>>I give you the important code on the next lines...and hopefully your
> >>>>able to help me
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>[...]
> >>>
> >>>
> >>>
> >>>
> >>>>form - bean
> >>>>==========
> >>>>public class MyActionForm extends ActionForm {
> >>>>
> >>>>
> >>>>
> >>>>
> >>>Are you sure, that this ActionForm class is the
> >>>org.apache.struts.action.ActionForm class? Or did you define your own
> >>>
> >>>
> >ActionForm
> >
> >
> >>>class that is not derived from the struts one?
> >>>
> >>>The rest looks correct.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>(** have seen starwars this night ... **)
> >>>>
> >>>>
> >>>>
> >>>>
> >>>Is it worth it?
> >>>
> >>>Regards,
> >>>Erich
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>--
> >>To unsubscribe, e-mail:
> >>
> >>
> ><mailto:struts-user-unsubscribe@jakarta.apache.org>
> >
> >
> >>For additional commands, e-mail:
> >>
> >>
> ><mailto:struts-user-help@jakarta.apache.org>
> >
> >
> >--
> >To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
> >
> >
>
>
>


----------------------------------------------------------------------------
----


> /**
>  *  File:              BuyProductForm.java
>  *  System:             Jamba! Plattform
>  *  Module:             Product (de.jamba.product)
>  *  Description:        Form bean associated to the BuyProductAction.
>  *  Preconditions:
>  *  Copyright:         Jamba! AG
>  *  Source: $Source:
/var/cvs/core-001/src/de/jamba/product/action/web/BuyProductForm.java,v $
>  *  Author:             $Author: bfinder $
>  *  Date: $Date: 2001/12/13 13:02:54 $
>  *  Version:            $Revision: 1.41 $
>  *
>  */
>
> package de.jamba.b2b.tmotion.action.web;
>
>
> import java.util.*;
> import java.io.*;
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpSession;
> import org.apache.struts.action.ActionError;
> import org.apache.struts.action.ActionErrors;
> import org.apache.struts.action.ActionMapping;
> import org.apache.struts.action.ActionForm;
>
>
>
> public class MyActionForm extends ActionForm {
>
> private String param1;
>
> public String getParam1(){
> return param1;
> }
>
> public void setParam1(String param){
> this.param1=param;
> }
>
>
> }
>


----------------------------------------------------------------------------
----


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


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


Mime
View raw message