You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Jeremy Quinn <je...@media.demon.co.uk> on 2004/06/23 11:58:28 UTC

Serious FlowScript problem

Hi All

As reported before, I am still having a serious problem with FlowScript  
giving me Function not found errors.

The problem appears to be semi-random.

For example, I have a URL:
	moderate/index.html
Which calls a FlowScript:
	flow/moderate.js showJobs()
Which calls the internal pipeline:
	screen/moderation-jobs
Which uses a JXTemplate:
	content/templates/moderation-jobs.xml

The SiteMap: moderation.xmap, is mounted by the Project's Sitemap,  
which is mounted by Cocoon's main sitemap via a map:mount that has a  
full filesystem path to the Project Sitemap, with is outside of  
Cocoon's webapp.


First I access the URL: project/moderate/index.html
I get this error:

org.apache.cocoon.ResourceNotFoundException: Function  
"javascript:showJobs()" not found
         at  
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpret 
er.callFunction(FOM_JavaScriptInterpreter.java:700)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invo 
ke(CallFunctionNode.java:131)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:54)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i 
nvoke(PreparableMatchNode.java:139)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:76)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P 
ipelineNode.java:126)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:76)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke( 
PipelinesNode.java:95)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:280)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:224)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro 
cessor.java:283)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(Moun 
tNode.java:95)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:54)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i 
nvoke(PreparableMatchNode.java:139)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:76)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P 
ipelineNode.java:126)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:76)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke( 
PipelinesNode.java:95)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:280)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:224)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro 
cessor.java:283)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(Moun 
tNode.java:95)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:54)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i 
nvoke(PreparableMatchNode.java:139)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:76)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P 
ipelineNode.java:126)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:76)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke( 
PipelinesNode.java:95)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:280)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:224)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro 
cessor.java:283)
         at org.apache.cocoon.Cocoon.process(Cocoon.java:637)
         at  
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java: 
1119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at  
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:354)
         at  
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationH 
andler.java:294)
         at  
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 
567)
         at org.mortbay.http.HttpContext.handle(HttpContext.java:1808)
         at  
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationCon 
text.java:525)
         at org.mortbay.http.HttpContext.handle(HttpContext.java:1758)
         at org.mortbay.http.HttpServer.service(HttpServer.java:879)
         at  
org.mortbay.http.HttpConnection.service(HttpConnection.java:790)
         at  
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:952)
         at  
org.mortbay.http.HttpConnection.handle(HttpConnection.java:807)
         at  
org.mortbay.http.SocketListener.handleConnection(SocketListener.java: 
197)
         at  
org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
         at  
org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:501)


Then I touch the FlowScript file and hit the same url again:  
project/moderate/index.html
Then I get this error:

org.mozilla.javascript.EvaluatorException:  
"file:/Users/jerm/Development/Checkouts/ClientX/ProjectX/application/ 
webapp/flow/moderate.js", line 40: Ambiguous import: "[JavaClass  
uk.co.me.client.bean.ReviewCategory]" and and "[JavaClass  
uk.co.me.client.bean.ReviewCategory]".
         at  
org.apache.cocoon.components.flow.javascript.JSErrorReporter.runtimeErro 
r(JSErrorReporter.java:66)
         at  
org.mozilla.javascript.Context.reportRuntimeError(Context.java:588)
         at  
org.mozilla.javascript.Context.reportRuntimeError(Context.java:627)
         at  
org.mozilla.javascript.Context.reportRuntimeError2(Context.java:609)
         at  
org.mozilla.javascript.ImporterTopLevel.get(ImporterTopLevel.java:124)
         at  
org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1110)
         at  
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(C 
ontinuationInterpreter.java:1256)
         at  
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(C 
ontinuationInterpreter.java:190)
         at  
org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(C 
ontinuationInterpreter.java:138)
         at  
org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(Interp 
retedFunctionImpl.java:121)
         at  
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
         at  
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpret 
er.callFunction(FOM_JavaScriptInterpreter.java:702)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invo 
ke(CallFunctionNode.java:131)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:54)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i 
nvoke(PreparableMatchNode.java:139)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:76)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P 
ipelineNode.java:126)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:76)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke( 
PipelinesNode.java:95)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:280)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:224)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro 
cessor.java:283)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(Moun 
tNode.java:95)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:54)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i 
nvoke(PreparableMatchNode.java:139)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:76)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P 
ipelineNode.java:126)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:76)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke( 
PipelinesNode.java:95)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:280)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:224)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro 
cessor.java:283)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(Moun 
tNode.java:95)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:54)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i 
nvoke(PreparableMatchNode.java:139)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:76)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P 
ipelineNode.java:126)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:76)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke( 
PipelinesNode.java:95)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:280)
         at  
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process 
(ConcreteTreeProcessor.java:224)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro 
cessor.java:283)
         at org.apache.cocoon.Cocoon.process(Cocoon.java:637)
         at  
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java: 
1119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at  
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:354)
         at  
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationH 
andler.java:294)
         at  
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 
567)
         at org.mortbay.http.HttpContext.handle(HttpContext.java:1808)
         at  
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationCon 
text.java:525)
         at org.mortbay.http.HttpContext.handle(HttpContext.java:1758)
         at org.mortbay.http.HttpServer.service(HttpServer.java:879)
         at  
org.mortbay.http.HttpConnection.service(HttpConnection.java:790)
         at  
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:952)
         at  
org.mortbay.http.HttpConnection.handle(HttpConnection.java:807)
         at  
org.mortbay.http.SocketListener.handleConnection(SocketListener.java: 
197)
         at  
org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
         at  
org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:501)


If I now reload the URL, the page works normally.

I have been seeing this problem ever since I moved to 2.1.5.
Interestingly, I never once saw this problem while I was working on the  
Query Bean addition to Cocoon I recently added.
I am wondering if we only get this problem because we are mounting an  
external project into Cocoon. This is the only difference I can think  
of between developing the Query Bean stuff and developing this project  
I am having this problem with.

We have to demo this project this weekend.
We are getting desperate for a solution, as Cocoon is acting very  
unreliably at the moment.

Has anybody got a clue as to what is going on here?


Thanks for any suggestions.

regards Jeremy

--------------------------------------------------------

                   If email from this address is not signed
                                 IT IS NOT FROM ME

                         Always check the label, folks !!!!!
--------------------------------------------------------

Re: Serious FlowScript problem

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 24 Jun 2004, at 14:21, Bertrand Delacretaz wrote:

> Le 23 juin 04, à 17:07, Jeremy Quinn a écrit :
>
>> ...in the first case it is loaded like this:
>> 	<map:flow language="javascript">
>> 		<map:script src="context://samples/blocks/lucene/query/query.js"/>
>> 	</map:flow>
>>
>> in the second case like this:
>> 	<map:flow language="javascript">
>> 		<map:script src="query.js"/>
>> 	</map:flow>
>>
>> I go back to the original url and it is still broken.
>>
>> What is going on ??????????
>
> Wild-guess mode on: could it be that the flowscript engine considers  
> these to be two different animals (due to the different way of  
> declaring the file) yet gets confused because they declare the same  
> stuff?

Thing is, it is random.
A FlowScript works one time and not another. This was only one scenario  
in which it happens. Normally my flowscripts are loaded as relative  
paths.

Gianugo very kindly spent some time with me with iChat and Subethaedit.

We looked at reducing the store size to 1 for the transient and store  
settings in cocoon.xconf, to see if caching might be a cause. The  
problem continued.

Then we discovered that different clients were getting different  
results.
I could access a URL that used FlowScript via 'localhost' and see the  
Function not found error.
Gianugo could access the same URL (externally) at the same time and see  
the page work.
I could run a different Browser.app and see the page work.
We could access a different URL, and maybe it would work on localhost  
but not remotely.

So we started thinking SESSION !!!!!

Does this trigger any synapses ?

As  
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpret 
er.callFunction is the last method in the stacktrace I tried rolling my  
version of FOM_JavaScriptInterpreter back. The problem still existed  
all the way back (from 1.30) to 1.26, so I don't think this is the  
likely cause.
I am not sure in which specific commit this problem started occurring,  
we had been using a release version of 2.1.4 for a while, and had not  
kept up with 2.1.5-dev very closely.

> Maybe activating logs or debugging the flowscript engine to find out  
> how/when both versions of the file are compiled/interpreted (I don't  
> even exactly know how they are handled) would help?

Thanks mate.


regards Jeremy



--------------------------------------------------------

                   If email from this address is not signed
                                 IT IS NOT FROM ME

                         Always check the label, folks !!!!!
--------------------------------------------------------


Re: Serious FlowScript problem

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 23 juin 04, à 17:07, Jeremy Quinn a écrit :

> ...in the first case it is loaded like this:
> 	<map:flow language="javascript">
> 		<map:script src="context://samples/blocks/lucene/query/query.js"/>
> 	</map:flow>
>
> in the second case like this:
> 	<map:flow language="javascript">
> 		<map:script src="query.js"/>
> 	</map:flow>
>
> I go back to the original url and it is still broken.
>
> What is going on ??????????

Wild-guess mode on: could it be that the flowscript engine considers 
these to be two different animals (due to the different way of 
declaring the file) yet gets confused because they declare the same 
stuff?

Maybe activating logs or debugging the flowscript engine to find out 
how/when both versions of the file are compiled/interpreted (I don't 
even exactly know how they are handled) would help?

-Bertrand


Re: Serious FlowScript problem

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 23 Jun 2004, at 13:08, Jeremy Quinn wrote:

>>> On 23 Jun 2004, at 10:58, Jeremy Quinn wrote:
>>>
>>>> I have been seeing this problem ever since I moved to 2.1.5.
>>>> Interestingly, I never once saw this problem while I was working on 
>>>> the Query Bean addition to Cocoon I recently added.
>>>>

One of my pipelines uses the Query Bean stuff I added recently.

I call the url:
	
	http://localhost:8888/myprojectname/search/advanced.html

and I get the usual :

org.apache.cocoon.ResourceNotFoundException: Function 
"javascript:simpleLuceneQuery()" not found

I immediately call the url:

	http://localhost:8888/samples/blocks/lucene/query/advanced.html

Which uses exactly the same flowscript file, and it works perfectly 
!!!!!!!
And I do not mean the same content, I mean it really uses the SAME file.

in the first case it is loaded like this:
	<map:flow language="javascript">
		<map:script src="context://samples/blocks/lucene/query/query.js"/>
	</map:flow>

in the second case like this:
	<map:flow language="javascript">
		<map:script src="query.js"/>
	</map:flow>

I go back to the original url and it is still broken.

What is going on ??????????

Can someone at least suggest a way to find out *where* it is going 
wrong?

regards Jeremy




Re: Serious FlowScript problem

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 23 Jun 2004, at 12:55, Jeremy Quinn wrote:

>
> On 23 Jun 2004, at 12:11, Jeremy Quinn wrote:
>
>>
>> On 23 Jun 2004, at 10:58, Jeremy Quinn wrote:
>>
>>> I have been seeing this problem ever since I moved to 2.1.5.
>>> Interestingly, I never once saw this problem while I was working on 
>>> the Query Bean addition to Cocoon I recently added.
>>> I am wondering if we only get this problem because we are mounting 
>>> an external project into Cocoon. This is the only difference I can 
>>> think of between developing the Query Bean stuff and developing this 
>>> project I am having this problem with.
>>
>> I tried moving our project inside cocoon/build/webapp to test the 
>> above.
>> I still get the random function not found errors.
>
> I have tried the following, with no fix yet:
>
> 1) changed all pipelines to noncaching, by setting the default in the 
> project sitemap
> 2) moved flowscript file importing from the sitemap to the flowscript 
> file
> 3) changed the encoding of flowscript file from 'MacRoman' to 'UTF-8 
> No BOM'
> 4) removed space between the function name and the brackets:
>     function blah () {}
>                         ^
>
> I am still getting random function not found errors.

I have just tried adding 		
	<map:pipes default="noncaching"/>
to the component section of each of my sitemaps.

I am still getting the random function not found errors.

Can anyone suggest another thing to try, I am running out of ideas.

regards Jeremy

--------------------------------------------------------

                   If email from this address is not signed
                                 IT IS NOT FROM ME

                         Always check the label, folks !!!!!
--------------------------------------------------------


Re: Serious FlowScript problem

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 23 Jun 2004, at 12:11, Jeremy Quinn wrote:

>
> On 23 Jun 2004, at 10:58, Jeremy Quinn wrote:
>
>> I have been seeing this problem ever since I moved to 2.1.5.
>> Interestingly, I never once saw this problem while I was working on 
>> the Query Bean addition to Cocoon I recently added.
>> I am wondering if we only get this problem because we are mounting an 
>> external project into Cocoon. This is the only difference I can think 
>> of between developing the Query Bean stuff and developing this 
>> project I am having this problem with.
>
> I tried moving our project inside cocoon/build/webapp to test the 
> above.
> I still get the random function not found errors.

I have tried the following, with no fix yet:

1) changed all pipelines to noncaching, by setting the default in the 
project sitemap
2) moved flowscript file importing from the sitemap to the flowscript 
file
3) changed the encoding of flowscript file from 'MacRoman' to 'UTF-8 No 
BOM'
4) removed space between the function name and the brackets:
     function blah () {}
                         ^

I am still getting random function not found errors.


Thanks for any help

regards Jeremy


--------------------------------------------------------

                   If email from this address is not signed
                                 IT IS NOT FROM ME

                         Always check the label, folks !!!!!
--------------------------------------------------------


Re: Serious FlowScript problem

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 23 Jun 2004, at 10:58, Jeremy Quinn wrote:

> I have been seeing this problem ever since I moved to 2.1.5.
> Interestingly, I never once saw this problem while I was working on 
> the Query Bean addition to Cocoon I recently added.
> I am wondering if we only get this problem because we are mounting an 
> external project into Cocoon. This is the only difference I can think 
> of between developing the Query Bean stuff and developing this project 
> I am having this problem with.

I tried moving our project inside cocoon/build/webapp to test the above.
I still get the random function not found errors.

regards Jeremy

--------------------------------------------------------

                   If email from this address is not signed
                                 IT IS NOT FROM ME

                         Always check the label, folks !!!!!
--------------------------------------------------------