You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by footh <fo...@yahoo.com> on 2006/02/25 03:24:01 UTC

JavaFlow and Objects

I'm doing this in a javaflow:

void doPages() {

Vector myVec = null

try {
  myVec = new Vector();
  // do stuff with myVec
catch (Exception e) {
}

myVec.clear();

}

When I have the myVec.clear() statement, the flow
causes this error in Tomcat (and, the page never
renders):

java.lang.VerifyError: (class:
com/mycom/cocoon/flows/MainFlow, method: doPages
signature: ()V) Incompatible object argument for
function call

The solution is to instantiate the Vector when it is
declared outside of the try/catch.

This isn't too big of a deal, but it cost me a lot of
debugging time.  I'm wondering what might be causing
it.

(It actually came up with the VarMap I use as an
argument to sendPage(), so it isn't just vectors.  It
causes me to instantiate these objects outside of the
try/catch, even though logic might be executed later
that decides the object isn't even needed.)

-JF



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: JavaFlow and Objects

Posted by Simone Gianni <s....@thebug.it>.
Hi Footh,
this error happens sometimes, it's connected (somehow) to the BCEL 
modifications javaflow applies to your classes to make the continuations 
magic possible.

This usually can be solved by explicit casting, expecially during 
variables declarations, for example :

Vector v = (Vector)null;

Sometimes it also happens on method calls (AFAIR, happened to me only 
once) :

((Vector)v).clear();

YMMV, but  usually this is the way.

Simone

footh wrote:

>I'm doing this in a javaflow:
>
>void doPages() {
>
>Vector myVec = null
>
>try {
>  myVec = new Vector();
>  // do stuff with myVec
>catch (Exception e) {
>}
>
>myVec.clear();
>
>}
>
>When I have the myVec.clear() statement, the flow
>causes this error in Tomcat (and, the page never
>renders):
>
>java.lang.VerifyError: (class:
>com/mycom/cocoon/flows/MainFlow, method: doPages
>signature: ()V) Incompatible object argument for
>function call
>
>The solution is to instantiate the Vector when it is
>declared outside of the try/catch.
>
>This isn't too big of a deal, but it cost me a lot of
>debugging time.  I'm wondering what might be causing
>it.
>
>(It actually came up with the VarMap I use as an
>argument to sendPage(), so it isn't just vectors.  It
>causes me to instantiate these objects outside of the
>try/catch, even though logic might be executed later
>that decides the object isn't even needed.)
>
>-JF
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>  
>
-- 
Simone Gianni


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org