You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by zack1403 <za...@gmail.com> on 2009/04/12 22:02:57 UTC

A document must have exactly one root element exception on 5.1.0.2 upgrade.

Hey all,

Just upgraded to 5.1.0.2 and am getting this exception:

Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException: A
document must have exactly one root element. Element <html> is already the
root element. [at classpath:com/inavero/pulse/pages/report/Edit.tml, line
78]
	at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:948)
	at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$400(ComponentPageElementImpl.java:49)
	at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.callback(ComponentPageElementImpl.java:159)
	at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeforeRenderBodyPhase.render(ComponentPageElementImpl.java:302)
	at
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:74)
	... 74 more
Caused by: java.lang.IllegalStateException: A document must have exactly one
root element. Element <html> is already the root element.
	at
org.apache.tapestry5.internal.services.MarkupWriterImpl.element(MarkupWriterImpl.java:147)

Component works fine before upgrade but breaks after.  Exception is on the
'writer.element("li")' line in beforeRenderBody.  Here is the component
source: http://pastebin.com/m16768df7

Thanks!
Zack
-- 
View this message in context: http://www.nabble.com/A-document-must-have-exactly-one-root-element-exception-on-5.1.0.2-upgrade.-tp23014335p23014335.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: A document must have exactly one root element exception on 5.1.0.2 upgrade.

Posted by zack1403 <za...@gmail.com>.
Ugh sorry about the poorly formatted question. It was one of those issues
that seemed so clear when I posted it but looking back there wasn't a good
amount of information.  I figured it was merely an upgrade issue that I
wasnt aware of when moving to 5.1.

What was actually happening, for anyone else that might get this message,
was that I was calling element.close() one too many times.  Normally I would
run into the 'you have rendered unbalanced elements' exception but it just
so happens that i was making sure that there werent any in my cleanup
method.  The HTML element was actually being closed and LI elements were
being created after, hence the multiple root elements.

Anywho thanks for the suggestions guys, I provide more stripped down
snippets in the future :)


Howard Lewis Ship wrote:
> 
> http://www.catb.org/~esr/faqs/smart-questions.html
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator of Apache Tapestry
> Director of Open Source Technology at Formos
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/A-document-must-have-exactly-one-root-element-exception-on-5.1.0.2-upgrade.-tp23014335p23104665.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: A document must have exactly one root element exception on 5.1.0.2 upgrade.

Posted by Howard Lewis Ship <hl...@gmail.com>.
http://www.catb.org/~esr/faqs/smart-questions.html

On Tue, Apr 14, 2009 at 3:20 PM, zack1403 <za...@gmail.com> wrote:
>
> Anyone have a thought on this? I have no idea where to go from here.
>
> --
> View this message in context: http://www.nabble.com/A-document-must-have-exactly-one-root-element-exception-on-5.1.0.2-upgrade.-tp23014335p23049185.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry
Director of Open Source Technology at Formos

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: A document must have exactly one root element exception on 5.1.0.2 upgrade.

Posted by zack1403 <za...@gmail.com>.
Anyone have a thought on this? I have no idea where to go from here.

-- 
View this message in context: http://www.nabble.com/A-document-must-have-exactly-one-root-element-exception-on-5.1.0.2-upgrade.-tp23014335p23049185.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org