You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Gary Larsen <ga...@envisn.com> on 2007/01/24 23:16:04 UTC

Continuation exception - 2.1.10 upgrade

I apologize for the post to the dev list.  I've been working at this strange
behavior for two days and have run out of things to try.  I'd appreciate any
tips on how to locate or work around the problem.

The first time in a session that a submit or action widget is clicked it
throws a continuation exception due to currentCall in
FOM_Cocoon.jsGet_request() being null.  After that exception, the widget
buttons work as expected.  

But, if I go to a form for the first time, hit the back button on the
browser, and go to the form again, the buttons work OK!

This has been working fine in 2.1.7 but I want to use newer xml libraries,
hence the upgrade.

I haven't been able to reproduce the exception in the samples, so I guess
it's a config/initialize problem or the samples don't cover my form
processing.  My forms are processed with flow script and use <fb> binding.

Is it possible the session is not being initialized properly?  I found some
cocoon sample flow script that used cocoon.createSession() but this appears
not to be valid call.

As a work around, is it possible to do a form.showForm() in background or
just have it redirect to another matcher to simulate the browser back
button? (my ignorance probably showing:-)

Below are some details. Thanks for any pointers,
Gary


Exception occurs at this point in the sitemap:

  <map:match pattern="*.continue">
    <map:call continuation="{1}"/>
  </map:match>

org.apache.cocoon.ProcessingException: Sitemap: error calling continuation
	at <map:call> -
file:/C:/work/netvisn-server/webapps/netvisn/sitemap.xmap:1103:64
...
Caused by: org.mozilla.javascript.WrappedException: Wrapped
java.lang.NullPointerException
(resource://org/apache/cocoon/forms/flow/javascript/Form.js#209)
...
Caused by: java.lang.NullPointerException
	at
org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon.jsGet_request(FO
M_Cocoon.java:577)


The only other thing unusual in the log is this exception at Tomcat
shutdown:

INFO  [main] catalina.session.ManagerBase 2007-01-24 16:55:10,234 - Cannot
serialize session attribute FOM JavaScript GLOBAL
SCOPE/file:/C:/work/netvisn-server/webapps/netvisn/sitemap.xmap for session
C35B93DAD99DB250D8394FA3CDEAB5E7
java.io.NotSerializableException: org.mozilla.javascript.LazilyLoadedCtor


RE: Continuation exception - 2.1.10 upgrade

Posted by Gary Larsen <ga...@envisn.com>.
> We also spent 2 days trying to fix it inside the rhino code. 
> Our work around after 2 days was to continue using 
> rhino1.5r4-continuations-R26.jar. The latest cocoon 
> revision using the 
> later jar on subversion is 479984.
 
When I extracted this revision it looks like Tortoise extracted the trunk
version of the blocks so I get compile errors:

cocoon-block-forms-compile:
Compiling 380 source files to
C:\development\envisn\cocoon-2.1.10.479984\build\c
ocoon\blocks\forms\dest
C:\development\envisn\cocoon-2.1.10.479984\src\blocks\forms\java\org\apache\
coco
on\forms\util\JavaScriptHelper.java:63:
compileReader(org.mozilla.javascript.Scr
iptable,java.io.Reader,java.lang.String,int,java.lang.Object) in
org.mozilla.jav
ascript.Context cannot be applied to
(java.io.StringReader,java.lang.String,int,
<nulltype>)
            script = ctx.compileReader(new StringReader(jsText), // in
 
I guess I'll try 2.1.9 unless there is an easy way to get a revision where
the blocks work also.

Gary



RE: Continuation exception - 2.1.10 upgrade

Posted by Gary Larsen <ga...@envisn.com>.
It good to know it's not only me.  I'll try the revision you suggested.

Thanks again for help,
Gary


> -----Original Message-----
> From: Antonio Gallardo [mailto:agallardo@agssa.net] 
> Sent: Thursday, January 25, 2007 10:52 AM
> To: dev@cocoon.apache.org
> Subject: Re: Continuation exception - 2.1.10 upgrade
> 
> Hi Gary,
> 
> We hit the same issue last week. It is a bug in the new rhino 
> jar. Same as you all our flow applications fails with the new 
> rhino introduced in 2.1.10.
> 
> We also spent 2 days trying to fix it inside the rhino code. 
> Our work around after 2 days was to continue using 
> rhino1.5r4-continuations-R26.jar. The latest cocoon revision 
> using the later jar on subversion is 479984.
> 
> Best Regards,
> 
> Antonio Gallardo.
> 
> 
> Gary Larsen escribió:
> >  
> > I just tried my application using 2.1.9 and the forms/continuations 
> > are working OK.  This Cocoon version is using 
> > rhino1.5r4-continuations-R26.jar so I would like to move to 
> 2.1.10 if possible.
> >
> > I'm not sure if this is a problem of my configuration/code 
> > compatibilty with 2.1.10 or possibly a bug in that version.
> >
> > Any suggestions on how a non-cocoon-dev person can track down this 
> > problem (if that's possible :-) would be great.
> >
> > Thanks,
> > Gary
> >
> >
> >   
> >>> hi Gary, would you confirm if the issue is similar to:
> >>>
> >>> http://issues.apache.org/jira/browse/COCOON-1579
> >>>       
> >> The issue is similar in that I'm using a flow function and jx 
> >> template with a continuation.  The behavior is reversed as 
> my first 
> >> continuation throws an exception and after that the continuations 
> >> work.
> >>
> >> My exception is thrown at FOM_Cocoon.jsGet_request (rather than
> >> FOM_Cocoon.jsGet_continuation) but my guess is that they 
> are both due 
> >> to currentCall being null.
> >>
> >>     
> 


Re: Continuation exception - 2.1.10 upgrade

Posted by Antonio Gallardo <ag...@agssa.net>.
Hi Gary,

We hit the same issue last week. It is a bug in the new rhino jar. Same 
as you all our flow applications fails with the new rhino introduced in 
2.1.10.

We also spent 2 days trying to fix it inside the rhino code. Our work 
around after 2 days was to continue using 
rhino1.5r4-continuations-R26.jar. The latest cocoon revision using the 
later jar on subversion is 479984.

Best Regards,

Antonio Gallardo.


Gary Larsen escribió:
>  
> I just tried my application using 2.1.9 and the forms/continuations are
> working OK.  This Cocoon version is using rhino1.5r4-continuations-R26.jar
> so I would like to move to 2.1.10 if possible.
>
> I'm not sure if this is a problem of my configuration/code compatibilty with
> 2.1.10 or possibly a bug in that version.
>
> Any suggestions on how a non-cocoon-dev person can track down this problem
> (if that's possible :-) would be great.
>
> Thanks,
> Gary 
>
>
>   
>>> hi Gary, would you confirm if the issue is similar to:
>>>
>>> http://issues.apache.org/jira/browse/COCOON-1579
>>>       
>> The issue is similar in that I'm using a flow function and jx 
>> template with a continuation.  The behavior is reversed as my 
>> first continuation throws an exception and after that the 
>> continuations work.  
>>
>> My exception is thrown at FOM_Cocoon.jsGet_request (rather than
>> FOM_Cocoon.jsGet_continuation) but my guess is that they are 
>> both due to currentCall being null.
>>
>>     


RE: Continuation exception - 2.1.10 upgrade

Posted by Gary Larsen <ga...@envisn.com>.
 
I just tried my application using 2.1.9 and the forms/continuations are
working OK.  This Cocoon version is using rhino1.5r4-continuations-R26.jar
so I would like to move to 2.1.10 if possible.

I'm not sure if this is a problem of my configuration/code compatibilty with
2.1.10 or possibly a bug in that version.

Any suggestions on how a non-cocoon-dev person can track down this problem
(if that's possible :-) would be great.

Thanks,
Gary 


> 
> > hi Gary, would you confirm if the issue is similar to:
> > 
> > http://issues.apache.org/jira/browse/COCOON-1579
> 
> The issue is similar in that I'm using a flow function and jx 
> template with a continuation.  The behavior is reversed as my 
> first continuation throws an exception and after that the 
> continuations work.  
> 
> My exception is thrown at FOM_Cocoon.jsGet_request (rather than
> FOM_Cocoon.jsGet_continuation) but my guess is that they are 
> both due to currentCall being null.
> 


RE: Continuation exception - 2.1.10 upgrade

Posted by Gary Larsen <ga...@envisn.com>.
Hi Antonio.  Thanks for taking a look at this.

> hi Gary, would you confirm if the issue is similar to:
> 
> http://issues.apache.org/jira/browse/COCOON-1579

The issue is similar in that I'm using a flow function and jx template with
a continuation.  The behavior is reversed as my first continuation throws an
exception and after that the continuations work.  

My exception is thrown at FOM_Cocoon.jsGet_request (rather than
FOM_Cocoon.jsGet_continuation) but my guess is that they are both due to
currentCall being null.

I'm using the rhino js-1.6R5.jar that installed with 2.1.10.  (this is
another reason for upgrading to hopefully be able to install in WebLogic)

In case it's helpful the matchers and flow are below. Maybe a different
coding approach would work better?

I'm lost inside Cocoon code so any pointers on debugging this would be
helpful.  I tried adding some debug logging in FOM_Cocoon but that didn't
help me.

Thanks,
Gary


<map:match pattern="form/do-*">
 <map:call function="handleForm">
   <map:parameter name="function" value="do_{1}"/>
   <map:parameter name="definitionURI"
value="context://site/forms/definition/{1}Form.xml"/>
   <map:parameter name="bindingURI"
value="context://site/forms/binding/{1}FormBinding.xml"/>
 </map:call>
</map:match>

---------------
function do_netvisnAdministration(form) {

 var appContext = cocoon.context.getAttribute(applicationContextKey);
 var bean =
Packages.com.envisn.nv.form.BeanFactory.getNetVisnAdminForm(appContext);

 form.load(bean);
 form.showForm("form/display-netvisnAdministration");
.....
---------------

<map:match pattern="form/display-*">
 <map:generate type="jx" label="debug1"
src="context://site/forms/template/{1}Template.xml"/>
 <map:transform type="forms" label="content1"/>
 <map:call resource="simple-page2html" label="content2">
  <map:parameter name="file"
value="context://site/forms/template/{1}Template.xml"/>
 </map:call>
 <map:transform
src="context://site/forms/resources/forms-samples-styling.xsl"
label="content3"/>
 <map:serialize/>
</map:match>

----------------
<map:match pattern="*.continue">
   <map:call continuation="{1}"/>
</map:match>



Re: Continuation exception - 2.1.10 upgrade

Posted by Antonio Gallardo <ag...@agssa.net>.
hi Gary, would you confirm if the issue is similar to:

http://issues.apache.org/jira/browse/COCOON-1579

Best Regards,

Antonio Gallardo.


Gary Larsen escribió:
> I apologize for the post to the dev list.  I've been working at this strange
> behavior for two days and have run out of things to try.  I'd appreciate any
> tips on how to locate or work around the problem.
>
> The first time in a session that a submit or action widget is clicked it
> throws a continuation exception due to currentCall in
> FOM_Cocoon.jsGet_request() being null.  After that exception, the widget
> buttons work as expected.  
>
> But, if I go to a form for the first time, hit the back button on the
> browser, and go to the form again, the buttons work OK!
>
> This has been working fine in 2.1.7 but I want to use newer xml libraries,
> hence the upgrade.
>
> I haven't been able to reproduce the exception in the samples, so I guess
> it's a config/initialize problem or the samples don't cover my form
> processing.  My forms are processed with flow script and use <fb> binding.
>
> Is it possible the session is not being initialized properly?  I found some
> cocoon sample flow script that used cocoon.createSession() but this appears
> not to be valid call.
>
> As a work around, is it possible to do a form.showForm() in background or
> just have it redirect to another matcher to simulate the browser back
> button? (my ignorance probably showing:-)
>
> Below are some details. Thanks for any pointers,
> Gary
>
>
> Exception occurs at this point in the sitemap:
>
>   <map:match pattern="*.continue">
>     <map:call continuation="{1}"/>
>   </map:match>
>
> org.apache.cocoon.ProcessingException: Sitemap: error calling continuation
> 	at <map:call> -
> file:/C:/work/netvisn-server/webapps/netvisn/sitemap.xmap:1103:64
> ...
> Caused by: org.mozilla.javascript.WrappedException: Wrapped
> java.lang.NullPointerException
> (resource://org/apache/cocoon/forms/flow/javascript/Form.js#209)
> ...
> Caused by: java.lang.NullPointerException
> 	at
> org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon.jsGet_request(FO
> M_Cocoon.java:577)
>
>
> The only other thing unusual in the log is this exception at Tomcat
> shutdown:
>
> INFO  [main] catalina.session.ManagerBase 2007-01-24 16:55:10,234 - Cannot
> serialize session attribute FOM JavaScript GLOBAL
> SCOPE/file:/C:/work/netvisn-server/webapps/netvisn/sitemap.xmap for session
> C35B93DAD99DB250D8394FA3CDEAB5E7
> java.io.NotSerializableException: org.mozilla.javascript.LazilyLoadedCtor
>