Vadim Gritsenko wrote:

>Hi all,
>
>Is this an undiscovered bug in the TreeProcessor?
>
>0. Go to http://localhost:8080/cocoon/formvalidation/test
>1. Hit "submit"
>2. Touch sitemap.xmap
>3. Hit "submit"
>4. Get "java.lang.IllegalStateException: You cannot lookup components on
>a disposed ComponentManager"
>
>XSP page never gets new component manager on the sitemap
>re-initialization.
>

This seems to be a bug in the way the XSP engine handles CMs : 
ServerPagesGenerator calls ProgramGenerator.load() with its own CM, 
which is then propagated down to JavaProgram which uses it to create a 
ComponentHandler for the compiled XSP. The XSP is then stored in the 
ProgramGenerator cache.

Now the CM in ServerPagesGenerator is the local CM of the sitemap, 
created with the contents of <map:components>. When the sitemap is 
reloaded, this CM is disposed and a new one is created. But the cached 
XSP still references the previous CM which is now disposed.

This bug doesn't exist in the compiled engine because a compiled sitemap 
doesn't have a local CM, but only a set of selectors for each component 
type and thus the XSP uses Cocoon's root CM.

IMO, to solve this problem, the ProgramGenerator should use its own CM 
(i.e. Cocoon's root CM) to get a ComponentHandler and then make 
XSPGenerator (or AbstractServerPage?) recomposable so that it gets the 
correct sitemap CM.

Thoughts ? Does this affect also the JavaScript XSP engine ?

Sylvain

-- 
Sylvain Wallez
  Anyware Technologies                  Apache Cocoon
  http://www.anyware-tech.com           mailto:[EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to