Something is up with the XML parser.  The specification for the page is not
being read correctly.

What's happening is that the Border component for the page is coming up with
allow-body set to false instead of true.

>From the DTD:

<!ELEMENT specification (description*, parameter*, reserved-parameter*,
property*, bean*,
component*, (external-asset | context-asset | private-asset)*)>
<!ATTLIST specification
class CDATA #REQUIRED
allow-body %attribute-flag; "yes"
allow-informal-parameters %attribute-flag; "yes"
>

The Border component does not specifiy a value for allow-body:

<specification
class="tutorial.workbench.components.Border"
allow-informal-parameters="no">


The code that reads the XML:

private ComponentSpecification convertComponentSpecification_2(Document
document)
throws DocumentParseException
{
ComponentSpecification specification =
factory.createComponentSpecification();
Element root = document.getDocumentElement();
specification.setAllowBody(getBooleanAttribute(root, "allow-body"));

And

private boolean getBooleanAttribute(Node node, String attributeName)
{
String attributeValue = getAttribute(node, attributeName);
return attributeValue != null && attributeValue.equals("yes");
}

And

protected String getAttribute(Node node, String attributeName)
{
NamedNodeMap map = node.getAttributes();
if (map == null)
return null;
Node attributeNode = map.getNamedItem(attributeName);
if (attributeNode == null)
return null;
return attributeNode.getNodeValue();
}


All I can surmise is the Caucho XML parser is not handling default values
for XML attributes correctly.  The attribute should appear in the attribute
map with the DTD-specified default value when the XML document does not
specify the attribute.  It is not.  I can attempt to patch Tapestry around
this, but I'd appreciate it if you would take this up with the Caucho folks
first.

Also, note the line:
return attributeValue != null && attributeValue.equals("yes");

This null check, which should not be necessary, was added recently just to
keep the specification parser from crashing with Caucho's XML parser.  Same
thing ... null should not be returned, but it is.  This is a bug, or
unwanted optimization, in thier XML parser.


----- Original Message -----
From: "Christian Sell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, May 06, 2002 2:29 PM
Subject: Re: Tapestry 2.02a and other appservers


> Howard,
>
> heres the exception I get when I access the tutorial workbench. It seems
to be related to localization, and its right inside your parser. I get it
when I click on a tab after opening the page - it seems that the first
exception gets swallowed somewhere. I find it a little disturbing that
exceptions are only displayed by tapestry, and not logged to the console or
elsewhere.
>
> Name: com.primix.tapestry.parse.TemplateParseException
> Message: Tag <form> on line 9 is a dynamic component, and may not appear
inside an ignored block.
> line: 9
> resourcePath: /tutorial/workbench/palette/Palette.html
> Trace:
> com.primix.tapestry.parse.TemplateParser.startTag(TemplateParser.java:655)
> com.primix.tapestry.parse.TemplateParser.parse(TemplateParser.java:292)
> com.primix.tapestry.parse.TemplateParser.parse(TemplateParser.java:213)
>
com.primix.tapestry.engine.DefaultTemplateSource.parseTemplate(DefaultTempla
teSource.java:333)
>
com.primix.tapestry.engine.DefaultTemplateSource.findTemplate(DefaultTemplat
eSource.java:292)
>
com.primix.tapestry.engine.DefaultTemplateSource.getTemplate(DefaultTemplate
Source.java:159)
> com.primix.tapestry.BaseComponent.readTemplate(BaseComponent.java:114)
> com.primix.tapestry.BaseComponent.finishLoad(BaseComponent.java:414)
>
com.primix.tapestry.pageload.PageLoader.constructComponent(PageLoader.java:2
91)
> com.primix.tapestry.pageload.PageLoader.loadPage(PageLoader.java:433)
> com.primix.tapestry.pageload.PageSource.getPage(PageSource.java:158)
> com.primix.tapestry.engine.RequestCycle.getPage(RequestCycle.java:220)
> com.primix.tapestry.engine.RequestCycle.setPage(RequestCycle.java:616)
> tutorial.workbench.components.Border.selectPage(Unknown Source)
> java.lang.reflect.Method.invoke(Native Method)
>
com.primix.tapestry.listener.ListenerMap.invokeTargetMethod(ListenerMap.java
:351)
> com.primix.tapestry.listener.ListenerMap.access$100(ListenerMap.java:59)
>
com.primix.tapestry.listener.ListenerMap$SyntheticContextListener.directTrig
gered(ListenerMap.java:161)
> com.primix.tapestry.link.Direct.trigger(Direct.java:265)
> com.primix.tapestry.engine.DirectService.service(DirectService.java:159)
> com.primix.tapestry.engine.AbstractEngine.service(AbstractEngine.java:706)
>
com.primix.tapestry.ApplicationServlet.doService(ApplicationServlet.java:203
)
> com.primix.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:168)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:126)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
>
com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:9
6)
> com.caucho.server.http.Invocation.service(Invocation.java:292)
> com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
> com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:218)
> com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:160)
> com.caucho.server.TcpConnection.run(TcpConnection.java:137)
> java.lang.Thread.run(Thread.java:484)
>
>
>
> >Something truly strange is going on.
> >
> >For instance, that parsing of templates should be
> >affected is very odd.  TemplateParser doesn't use an XML
> >parser, it's a little state machine I threw together
> >and has o dependencies on anything.
> >
> >Tapestry should be compatible with any XML parser; it
> >uses JAXP 1.1 to find a parser that meets its needs.
> >
> >I've been wearing a narrow groove using Tapestry with
> >Jetty and WebLogic ... it shouldn't be a complete
> >surprise that straying from that domain results in a
> >little bit of a teething problem.  Sounds like XML
> >parsing is a bit of an achille's heel.
> >
> >--
> >[EMAIL PROTECTED]
> >
> ><a href='http://tapestry.sf.net' target='_top'>http://tapestry.sf.net</a>
> >> >I've found that Jetty is very good at following standards.  In some
cases,
> >> >the standards aren't well defined, or others (such as Tomcat) just
flout
> >> >them.  I've made adjustments in the past for this kind of situation
and will
> >> >do so in the future, given sufficient details.  Tapestry doesn't do
anything
> >> >tricky with the servlet API, but there are occasions when the timing
of
> >> >operations varies.
> >>
> >> I am not against Jetty. I just happen to already have 4 appserver
configurations
> >> on my machine, and dont want to add another one. One of my foremost
criteria for
> >> my own apps - and libraries I use to build them - is appserver
independence.
> >> Seeing a specific server mentioned all over the introductory
documentation is
> >> something that makes me suspicious.
> >>
> >> >I'd be interested in seeing stack traces.  Are you getting the stale
session
> >> >page or some other error?  I know others have deployed real Tapestry
> >> >applications using Resin (perhaps not the same version).
> >>
> >> I would have liked to see stack traces, too. In the first case, I get
the stale
> >> session page (immediately, so something seems to fundamentally go
wrong). In the
> >> second case, I see the crippled workspace screen (the display area is
empty),
> >> and thats all. Note that I have not fiddeld with XML libraries (and
would like
> >> to avoid doing so as long as possible). I am only keeping tapestry's
and the
> >> contrib jar in resins lib directory.
> >>
> >> >> Under tomcat, I see errors in the console stating that page cleanup
failed
> >> >with a NullPointerException (this happens when the session times out
and the
> >> >SessionBindingListener callbacks fire).
> >> >
> >> >Again, stack traces would be useful.
> >>
> >> there wasnt much of a stack trace - anyway I'll get it as soon as I can
get to
> >> the machine. I also noticed a peculiarity under tomcat with the IN10
page in the
> >> worbench demo. When switching languages, only the main display area was
changed,
> >> whereas the tabs remsined unchanged.
> >>
> >> thanks,
> >> Christian
> >> __________________________________
> >> DynaBEAN Consulting
> >> Engineering the Future
> >> www.dynabean.com
> >>
> >> _______________________________________________________________
> >>
> >> Have big pipes? SourceForge.net is looking for download mirrors. We
supply
> >> the hardware. You get the recognition. Email Us:
[EMAIL PROTECTED]
> >> _______________________________________________
> >> Tapestry-developer mailing list
> >> [EMAIL PROTECTED]
> >> <a
href='https://lists.sourceforge.net/lists/listinfo/tapestry-developer'
target='_top'>https://lists.sourceforge.net/lists/listinfo/tapestry-develope
r</a>
> >


_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to