Hi Scott,
I'm using javaflow which calls backend objects having static variables
(for example, enumerations), and didn't incurred in this problem.

I can't understand, are you using inner classes? In that case that's the
problem. Javaflow is limited in its class handling capacities, inner
classes can be a problem, static variables in the javaflow class can be
a problem, a flow subclassing another flow can be a problem. But using
external classes instead of inner classes should solve it, a KISS
approach is higly recommended :)

The problem is mainly in BCEL parsing/verifying, that's why in Jakarta
commons there is a new implementation of java continuations based on ASM
which will be used in cocoon 2.2 instead of BCEL.


Hope this helps,
Simone


Scott Phillips wrote:

> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

-- 
Simone Gianni

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to