You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Stephan Coboos <cr...@gmx.net> on 2004/06/12 23:41:51 UTC
Problem using JavaFlow and exceptions
Hello,
I'am sorry but I have another problem using JavaFlow. I want to use my
own Exceptions in JavaFlow. One Exception contains a long type as
parameter. But if so, the flows will not load at startup. Please have a
look into my source code example:
package foo.bar;
import org.apache.cocoon.components.flow.java.AbstractContinuable;
public class TestFlow extends AbstractContinuable {
public void doTest() throws Exception {
while(true) {
this.sendPageAndWait("test.jxt");
throw new FooException("test", 123);
}
}
}
The class FooException:
package foo.bar;
public class FooException extends java.lang.Exception {
private long id = 0;
public FooException() {
}
public FooException(String msg) {
super(msg);
}
public FooException(String msg, long id) {
...
this.id = id;
}
}
If I use the parameter id, at first call of the corresponding url I got
the following error output into the logs of tomcat and flows will not work:
java.lang.VerifyError: (class: foo/bar/TestFlow, method: doTest
signature: ()V) Attempt to split long or double on the stack
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:1647)
at java.lang.Class.privateGetPublicMethods(Class.java:1770)
at java.lang.Class.getMethods(Class.java:824)
at
org.apache.cocoon.components.flow.java.JavaInterpreter.initialize(JavaInterpreter.java:119)
at
org.apache.cocoon.components.flow.java.JavaInterpreter.callFunction(JavaInterpreter.java:153)
at
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:130)
at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49)
at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)
at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126)
at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)
at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101)
at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:336)
at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:277)
at
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:103)
at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:49)
at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:130)
at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)
at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:126)
at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:72)
at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:101)
at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:336)
at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:277)
at org.apache.cocoon.Cocoon.process(Cocoon.java:619)
at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1073)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
at java.lang.Thread.run(Thread.java:534)
If I remove the parameter id all works fine? Is it another bug?
PS: Dear JavaFlow developers, I hope you are not angry about my many
postings/questions about JavaFlow ;-)
Regards
Stephan
Re: Problem using JavaFlow and exceptions
Posted by Stephan Michels <st...@apache.org>.
Am Sa, den 12.06.2004 schrieb Stephan Coboos um 23:41:
> Hello,
>
> I'am sorry but I have another problem using JavaFlow. I want to use my
> own Exceptions in JavaFlow. One Exception contains a long type as
> parameter. But if so, the flows will not load at startup. Please have a
> look into my source code example:
>
> public void doTest() throws Exception {
>
> while(true) {
>
> this.sendPageAndWait("test.jxt");
> throw new FooException("test", 123);
> }
> }
> }
> If I remove the parameter id all works fine? Is it another bug?
>
> PS: Dear JavaFlow developers, I hope you are not angry about my many
> postings/questions about JavaFlow ;-)
No, of course not. We are always happy to see some beta testers ;-)
I was aware of this problem, and had also noted this as todo point.
The problem was that you can't easily swap a double word variable and
a one word variable on the stack. I used now a cryptic combination
of stack operations.
It should now work, Stephan.