You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by Jeromy Evans <je...@blueskyminds.com.au> on 2008/12/17 01:32:58 UTC

Intermittent exceptions during Tiles 2 initialization (XML error reading definitions)

Hi,

[Tiles 2.0.4, Tomcat 5.5.25, Struts 2.0.11, struts2-tiles-plugin]

I'm trying to track down the source of the following intermittent  
exception.  It occurs immediately after a deployment of the webapp and  
doesn't affect the subsequent operation of Tiles.  It's definitely  
only a temporary issue during initialization.

2008-12-17 10:28:09,503 ERROR [http-8080-Processor24]  
[RoleSecurityTagSupport] Error executing tag: XML error reading  
definitions.
org.apache.tiles.definition.DefinitionsFactoryException: XML error  
reading definitions.
	at  
org 
.apache 
.tiles 
.definition 
.digester 
.DigesterDefinitionsReader.read(DigesterDefinitionsReader.java:251)

With a breakpoint inside the DigesterDefinitionsReader I found the  
true cause is a SAX exception that's wrapped by the  
DefinitionsFactoryException (it's not logged unfortunately):

org.xml.sax.SAXException: FWK005 parse may not be called while parsing.

caught at DefinitionsFactoryException.java:251.

This SAXException implies the Xerces DocumentBuilder is being accessed  
in two threads simultaneously which explains the intermittent nature  
of the problem.

The failure to read the definitions then leads to a variety of other  
Tiles-related exceptions until a moment later when the definitions are  
correctly read.   One guess is that Tiles is attempting to render a  
page before it's properly initialized via the struts2-tiles-plugin.

Has anyone seen this before and able to suggest a way to make it go  
away?  There's no obvious consequences other than exceptions in the  
log, but it's still annoying.

Below are examples of the other exceptions seen in association with  
the one above.  I presume they are all caused by the definitions not  
being read yet and/or failing to render part of page due to that  
(although I can't find a rationale explanation for the first one).

Thanks,
Jeromy Evans

2008-12-17 10:27:55,617 ERROR [http-8080-Processor24] [Digester] End  
event threw exception
java.lang.NoSuchMethodException: No such accessible method:  
addDefinition() on object: org.apache.tiles.Definition
	at  
org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java: 
214)
---	

2008-12-17 11:05:50,675 ERROR [http-8080-Processor24]  
[DefinitionsImpl] Error while resolving definition inheritance: child  
'admin.page.head' can't find its ancestor 'page.head'. Please check  
your description file.

---
2008-12-17 11:10:12,545 ERROR [http-8080-Processor25]  
[RenderTagSupport] Error during rendering
java.util.EmptyStackException
	at org.apache.commons.collections.ArrayStack.pop(ArrayStack.java:127)
	at org.apache.commons.digester.Digester.endElement(Digester.java:1208)


Re: Intermittent exceptions during Tiles 2 initialization (XML error reading definitions)

Posted by Antonio <an...@gmail.com>.
2008/12/17 Jeromy Evans <je...@blueskyminds.com.au>:
> [Tiles 2.0.4, Tomcat 5.5.25, Struts 2.0.11, struts2-tiles-plugin]

Please upgrade to the latest versions of Tiles (2.0.6) and Struts
(2.0.14) and tell us if it works or not.

Antonio