You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ecs-user@jakarta.apache.org by LeBaron Price <LP...@vansd.org> on 2001/06/12 22:56:08 UTC

form.toString() class cast exception

Good morning all, sorry to email every one, but I'm recompiling some old code for an update I did in another section of the program, but now it seems like this won't compile.. 

can someone take a look at it and help me see what I'm missing? 

thanks, 
LeBaron. 


It seems as though the form.toString() is causing the class cast exception, or at least that's what I'd guess from where the Log.trace() stops working, but then there's all that about 'Options' in the Jserve error_log, so  I'm not sure what's up exactly. This was code written for an earlier version of ECS by the guys that were here before me, is there a new way of printing the form to the output stream? any help is greatly appreciated. 

//the code I'm trying to debug. 
|
| Form f = getInsertForm (editTask, session);
| Log.trace ( "got the form back" ) ;
| f.addElement (new Input ("hidden", "modifyTask", task_id));
| Log.trace ( "added something to it." ) ;
| out.println (f.toString());
| Log.trace ( "but I'm not going to get here, cause something in the toString() method is killing my app" ) ;
|
\\

//from the Jserv log
|
| [12/06/2001 12:51:56:095] (ERROR) ajp12: Servlet Error: java.lang.ClassCastException: 
| [Lorg.apache.ecs.html.Option;: [Lorg.apache.ecs.html.Option;
| [12/06/2001 12:51:56:095] (ERROR) an error returned handling request via protocol "ajpv12"
| [12/06/2001 12:51:56:097 PDT] java.lang.ClassCastException: [Lorg.apache.ecs.html.Option;
| at org.apache.ecs.ElementAttributes.createStartTag(Compiled Code)
| at org.apache.ecs.GenericElement.output(Compiled Code)
| at org.apache.ecs.ConcreteElement.output(Compiled Code)
| at org.apache.ecs.ConcreteElement.output(Compiled Code)
| at org.apache.ecs.ConcreteElement.output(Compiled Code)
| at org.apache.ecs.ConcreteElement.output(Compiled Code)
| at org.apache.ecs.ConcreteElement.output(Compiled Code)
| at org.apache.ecs.GenericElement.toString(Compiled Code)
| at vsd.apps.sap.individualServlet.showTaskEditView(individualServlet.java:446)
| at vsd.apps.sap.individualServlet.doGet(individualServlet.java:165)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:499)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
| at org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
| at org.apache.jserv.JServConnection.run(Compiled Code)
| at java.lang.Thread.run(Compiled Code)
|
\\

// the result of my Log.trace commands from above. 
| 06/12/01 19:51:56(43.275):38: trace: system.main.Thread-20: StackTrace.<init>:0:
|  got the form back
|
| 06/12/01 19:51:56(43.285):39: trace: system.main.Thread-20: StackTrace.<init>:0:
|  added something to it.
|
\\

I'm using ECS 1.4.1 with Oracle 9ias (Apache / Jserv) on a unix family box




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


Re: form.toString() class cast exception

Posted by Stephan Nagy <sn...@connectria.com>.
LeBaron Price wrote:

>Good morning all, sorry to email every one, but I'm recompiling some old code for an update I did in another section of the program, but now it seems like this won't compile.. 
>
>can someone take a look at it and help me see what I'm missing? 
>
>thanks, 
>LeBaron. 
>
>
>It seems as though the form.toString() is causing the class cast exception, or at least that's what I'd guess from where the Log.trace() stops working, but then there's all that about 'Options' in the Jserve error_log, so  I'm not sure what's up exactly. This was code written for an earlier version of ECS by the guys that were here before me, is there a new way of printing the form to the output stream? any help is greatly appreciated. 
>
For a better way to print the element try :

form.output(OutputStream) || form.output(PrintWriter)

As for the class cast exception I'll try and reproduce it when I get to 
the house tonight.

-stephan




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


Re: form.toString() class cast exception

Posted by robert burrell donkin <ro...@mac.com>.
On Tuesday, June 12, 2001, at 09:56 PM, LeBaron Price wrote:

> Good morning all, sorry to email every one, but I'm recompiling some 
> old code for an update I did in another section of the program, but now 
> it seems like this won't compile..

i'm guess from the log that it compiles but throws a ClassCastException 
when it runs...
am i correct?

>
> can someone take a look at it and help me see what I'm missing?
>

my gut feeling is that this might be a versioning problem.

two things that you can quickly check are:

1. that you're using identical ecs jar's at compile time and run time

2. that you've recompiled all your code not just that which you've 
changed. (when i get an error like this, the first thing i try is a 
clean compile.) you can get a ClassCastException if you change a library 
you compile against but don't recompile all your code which references 
that library.

- robert

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