You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Flynn <pf...@imbolc.ucc.ie> on 2002/07/15 13:39:03 UTC

testing error

I've added the following lines to the distribution sitemap.xmap
(using the jakarta-tomcat-4.0.4-b2-01-LE-jdk14 distribution),
immediately before the section commented "Sites":

      <map:match pattern="cc">
	<map:generate src="cc/homepage.xml"/>
	<map:transform src="cc/styles/homepage.xsl"/>
	<map:serialize type="html"/>
      </map:match>

      <map:match pattern="cc/objectives">
	<map:generate src="cc/info/objectives.xml"/>
	<map:transform src="cc/styles/information.xsl"/>
	<map:serialize type="html"/>
      </map:match>
      
      <map:match pattern="information.css"> 
	<map:read mime-type="text/css" src="cc/styles/information.css"/> 
      </map:match>
      
      <!-- ================  Sites  =========================== --> 

The files are all in place as given within the cocoon directory:

$ ls -lR cc
cc:
total 16
drwxrwxr-x    2 peter    peter        4096 Jul 15 12:24 dtds
-rw-rw-r--    1 peter    peter         403 Jul 11 11:27 homepage.xml
drwxrwxr-x    2 peter    peter        4096 Jul 15 11:44 info
drwxrwxr-x    2 peter    peter        4096 Jul 15 12:25 styles

cc/dtds:
total 4
-rw-rw-r--    1 peter    peter         962 Jul 11 09:13 website.dtd

cc/info:
total 4
-rw-rw-r--    1 peter    peter        3568 Jul 12 14:59 objectives.xml

cc/styles:
total 16
-rw-rw-r--    1 peter    peter         331 Jul 11 09:16 homepage.xsl
-rw-rw-r--    1 peter    peter         155 Jul 12 14:57 information.css
-rw-rw-r--    1 peter    peter        4996 Jul 12 14:59 information.xsl
$

and both XML files have been validated with nsgmls and they both
transform correctly with xt and their relevant XSL files, so I'm
satisfied the documents are syntactically correct. 

When I request cc in a browser (ie http://localhost:8080/cocoon/cc) it
works perfectly (as do all the distro examples). But when I try
http://localhost:8080/cc/objectives I get

   The org.apache.cocoon.www.sitemap_xmap notifies that 
   org.apache.cocoon.ProcessingException says:

   Exception in creating Transform Handler

   More precisely:

   org.apache.cocoon.ProcessingException: Exception in creating 
   Transform Handler: java.lang.NullPointerException

This sounds as if it cannot fire up the transformer. I've obviously
made some error, but I can't see where. This is under RHL 7.2 with
j2sdk1.4.0 on a 500MHz Pentium with 128Mb memory and several Gb of
spare disk. I can't work out why it would have such a problem.

The trace says (to start with)

Original exception : java.lang.NullPointerException
at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:656)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:445)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:216)
at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(XMLNamespaceBinder.java:829)
at org.apache.xerces.impl.XMLNamespaceBinder.emptyElement(XMLNamespaceBinder.java:590)
at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:829)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:748)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1454)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:525)
at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:581)

Is there any way of making it turn off the Java stuff and turn on proper
reporting, so I can see the line number and character offset in the XML
or XSL document where the error was thrown? The Java trace is fine for
tracking bugs in the Java code, but where the error is the likely to be
the user's (ie, mine) rather than Cocoon's authors' ("yours" :-) we do
need user-document error reporting, if only to ascertain if the bug really
is in the user document and not in the Java code.

///Peter


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>