cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Phillips <scott.a.phill...@gmail.com>
Subject Re: Instruction INVOKEVIRTUAL constraint violated
Date Wed, 12 Apr 2006 22:42:32 GMT
I am expeirementing JavaFlow and it seems to me to be so much of a 
better fit for our needs than javascript. However in trying to implement 
it I hook it into my backend I am recieving errors which are close to 
the example provided but I've found that any class which is used by a 
javaflow class can not use static variables? This causes problems 
because the back-end API that I am calling uses static variables in 
large number of cases for it's internal logging.

my javaflow contains the following lines / class:

TestMe me = new TestMe();
me.doIt();
sendPage("some/page");

public class TestMe
{
   // I cause the problem
   private static String staticThing = "I am static";

   public String doIt() {
     return "I have done it.";
   }
}


The flow will fail with:
org.apache.bcel.verifier.exc.StructuralCodeConstraintException: 
Instruction NEW constraint violated: Class 
'org.dspace.app.xmlui.eperson.TestMe' is referenced, but cannot be 
loaded and resolved: 'VERIFIED_REJECTED
Number of LocalVariableTable attributes of Code attribute '<CODE>' 
(method 'public static String doItStatic()') exceeds number of local 
variable slots '0' ('There may be no more than one LocalVariableTable 
attribute per local variable in the Code attribute.').
'.
InstructionHandle:    0: new[187](3) 25

Execution Frame:
Local Variables:
0: org.dspace.app.xmlui.eperson.Flow
1: <unknown object>
OperandStack:
Slots used: 0 MaxStack: 2.
Execution flow:
    0: new 25	[InstructionContext]


If I remove the "staticThing" everything will just work. Any ideas or do 
I not understand something and javaflow can not handle static things? I 
would realy like to be able to develop the website with javaflow instead 
of using javascript now and converting it to javaflow later.

Scott--

Torsten Curdt wrote:
> 
> On 21.03.2006, at 20:26, Andrew Madu wrote:
> 
>> Hi,
>> can someone please tell me why defining a class variable in a  
>> javaflow class like so:
>>
>> public class Login extends AbstractContinuable
>> {
>>     static User userGlobal = new User();
>>     .........
>>
>>
>> would cause the following error to be generated?:
> 
> 
> Andrew, that's the BCEL code verifier that barfs on you.
> Obviously for no good reason. Since I don't think you
> are using trunk upgrading to a newer javaflow version
> is probably no option.
> 
> A subtile code change might make a difference. You could
> try a bit ...but rather I would re-think your approach.
> Despite the fact it should work - are you sure that a
> static global user object is the right way to go?
> 
> cheers
> -- 
> Torsten
> 
> 


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


Mime
View raw message