cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29308] New: - issue with javaflow continuations
Date Mon, 31 May 2004 05:36:56 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29308>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29308

issue with javaflow continuations

           Summary: issue with javaflow continuations
           Product: Cocoon 2
           Version: 2.1.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: blocks
        AssignedTo: dev@cocoon.apache.org
        ReportedBy: dustbin777@yahoo.com


hi, 

i rewrote SimpleFlow.java testcase to try out returning of objects in java
continuations like below (attached). I am getting a exception when i execute the
test case :

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at
org.apache.cocoon.components.flow.java.test.FlowTest.testSimple(FlowTest.java:117)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
Caused by: java.lang.IllegalAccessError: tried to access class
org.apache.cocoon.components.flow.java.test.FooInner from class
org.apache.cocoon.components.flow.java.test.SimpleFlow
	at org.apache.cocoon.components.flow.java.test.SimpleFlow.foo(SimpleFlow.java:42)
	at org.apache.cocoon.components.flow.java.test.SimpleFlow.run(SimpleFlow.java:46)
	... 23 more






package org.apache.cocoon.components.flow.java.test;

import org.apache.cocoon.components.flow.java.*;
import org.apache.cocoon.forms.FormContext;
import java.util.Locale;
class FooInner {
    public FooInner(int i, int j) {

    }
}

public class SimpleFlow extends AbstractSimpleFlow {

    public SimpleFlow() {
        if (Continuation.currentContinuation() != null)
            throw new RuntimeException("Conitnuation should not exist");
        //sendPageAndWait("should not stop");
    }
    public FooInner foo() {
        float a = 1;
        sendPageAndWait("getNumberA");
        System.out.println("old a=" + a);
        a = Float.parseFloat(getRequest().getParameter("a"));
        System.out.println("a=" + a);
        sendPage("result", new VarMap().add("result", a + 1));
        System.out.println("end of flow");
        return new FooInner(12,12);
    }
    public boolean run() {
        System.out.println("start of flow");
        Object res = foo();
        System.out.println("Result of foo is " + res);
        return true;
    }

    public void testNew(Locale locale) {
        FormContext formContext = new FormContext(getRequest(), locale);
    }

    public void testCatch() {
        try {
            sendPageAndWait("getNumberA");
            float a = Float.parseFloat(getRequest().getParameter("a"));
        } catch (NumberFormatException nfe) {
            sendPageAndWait("error");
        }
        sendPage("result");
    }

    public void testFinally() {
        try {
            sendPageAndWait("getNumberA");
            float a = Float.parseFloat(getRequest().getParameter("a"));
        } finally {
            sendPageAndWait("result");
        }
    }

    public void testEmpty() {
        //nothing
    }

    public void testAbstract() {
        super.parent();
    }

    public void testDelegate() {
        CalculatorFlow flow = new CalculatorFlow();
        flow.run();
    }
}



I checked the sourcecode generated out of the continuationclassloader and it
seems to be ok. not sure why it is giving this error. The sourcecode (decompiled
using jad tool)  says

        System.out.println("end of flow");
        12;
        continuationstack.pushInt(12);
        continuationstack;
        JVM INSTR swap ;
        pushInt();
        return new FooInner(continuationstack.popInt(), continuationstack.popInt());

Mime
View raw message