cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Coboos <cromo...@gmx.net>
Subject [BUG] Registering of JavaFlow fails (was: [JavaFlow] java.lang.VerifyException)
Date Tue, 01 Jun 2004 18:23:22 GMT
Hello,

I have a problem using Objects in JavaFlow before a while loop. Please 
see my first posting [JavaFlow] java.lang.VerifyException. In my opinion 
it can be a bug in the JavaFlow block.

Because my fist posting was not so clear, I had tried to reproduce the 
error for a while and I had discovered the following code which creates 
such an error (you need the packages of Lucene):

package foo.bar;

import org.apache.cocoon.components.flow.java.AbstractContinuable;
import org.apache.lucene.queryParser.*;
import org.apache.lucene.search.*;
import org.apache.lucene.analysis.standard.StandardAnalyzer;

public class TestFlow extends AbstractContinuable {

    public void doTest() throws Exception {
       
         // This causes an error -> The class can not be registered at 
first call!!!
        Query query = null;
        Hits hits;
        IndexSearcher searcher = null;
       // end
 
        while(true) {
           
            this.sendPageAndWait("foo");
           
            query = QueryParser.parse("foo", "bar", new StandardAnalyzer());
            hits = searcher.search(query);
        }
    }
}

If you test this error you can see that the first call of any (!) url of 
the corresponding cocoon app causes in a empty page. The flow-log shows 
as last entry the following line:

registered java class "foo.bar.TestFlow" for flow

Then, Cocoon stops working and displays a empty page.
In the logs of my servlet container Tomcat I can see the follwing error 
message:

2004-06-01 19:58:33 StandardWrapperValve[Cocoon]: Servlet.service() for 
servlet Cocoon threw exception
java.lang.VerifyError: (class: foo/bar/TestFlow, method: doTest 
signature: ()V) Incompatible object argument for function call
    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:96)
    at 
org.apache.cocoon.components.flow.java.JavaInterpreter.callFunction(JavaInterpreter.java:130)
    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.handleCocoonRedirect(TreeProcessor.java:382)
    at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.access$000(TreeProcessor.java:66)
    at 
org.apache.cocoon.components.treeprocessor.TreeProcessor$TreeProcessorRedirector.cocoonRedirect(TreeProcessor.java:543)
    at 
org.apache.cocoon.environment.ForwardRedirector.redirect(ForwardRedirector.java:58)
    at 
org.apache.cocoon.components.treeprocessor.sitemap.RedirectToURINode.invoke(RedirectToURINode.java:69)
    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 change the code of the JavaFlow class and declare the variables 
"query", "hits" and "searcher" outside the method "doTest", no error 
will occur. See as follow:

package foo.bar;

import org.apache.cocoon.components.flow.java.AbstractContinuable;
import org.apache.lucene.queryParser.*;
import org.apache.lucene.search.*;
import org.apache.lucene.analysis.standard.StandardAnalyzer;

public class TestFlow extends AbstractContinuable {

     // This works because it is ouside of doTest()
        Query query = null;
        Hits hits;
        IndexSearcher searcher = null;
    // end

    public void doTest() throws Exception {
 
        while(true) {
           
            this.sendPageAndWait("foo");
           
            query = QueryParser.parse("foo", "bar", new StandardAnalyzer());
            hits = searcher.search(query);
        }
    }
}

Is it really a bug? Why is it not possible to declare these three line 
within the method doTest? What can I do?

Thank you.

Regards
Stephan




Mime
View raw message