You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lars Huttar <la...@sil.org> on 2003/10/11 03:27:40 UTC

NullPointerException in JTidy or HTMLGenerator

Dear Cocooners,

I'm trying to get the CLI working to generate static web sites.
We're using Cocoon v. 2.0.5-dev (mistake?).
Things seem to fail in HTMLGenerator and/or jtidy; no static
content gets generated. Anybody know of a fix?

I've got a batch file running, run.bat, to start the CLI.

My command line is:
$ ./run.bat -c . -C WEB-INF/cocoon.xconf -d tmp -f urlfile.txt > CLI-out.txt

I get a java.sql.SQLException saying the database is already in use by
another process, but I assume I can ignore that since I'm not using any
database.

urlfile.txt contains one URL, "mount/gem/workbench/About/Home", which
works fine when I use it from a browser to connect to Cocoon.

Looking at the debug output in CLI.txt, it seems that the URL is getting
interpreted right by the sitemap, but at some point the process crashes
with a NullPointerException in org.apache.xml.utils.AttList.getValue(AttList.java:247)
which is being called by HTMLGenerator.  Here's the error message in context
(for the entire debug output, see http://www.huttar.net/lars-kathy/tmp/CLI-out.txt
[0.5MB]).

========================= excerpt from CLI-out.txt =======================
...
DEBUG   2003-10-10 19:29:08.472 [core.sou] (): Resolving 'about/Home.htm' in context
'file:/c:/Program Files/Apache Group/Tomcat 4.1/webapps/cocoon/mount/gem/'
DEBUG   2003-10-10 19:29:08.472 [core.sou] (): Resolved to 'file:/c:/Program Files/Apache
Group/Tomcat 4.1/webapps/cocoon/mount/gem/about/Home.htm'
DEBUG   2003-10-10 19:29:08.472 [        ] (): Resolved to 'cocoon://mount/gem/About/Home'
DEBUG   2003-10-10 19:29:08.472 [core.sto] (): NOT Found key: PK_G-html--1160095671642672732_
DEBUG   2003-10-10 19:29:08.472 [core.sto] (): NOT Found file: PK_G-html--1160095671642672732_
DEBUG   2003-10-10 19:29:08.472 [core.eve] (): Caching content for further requests of
'About/Home'.
DEBUG   2003-10-10 19:29:08.472 [manager ] (): Got a
org.apache.cocoon.components.sax.XMLByteStreamCompiler from the pool.
WARN    2003-10-10 19:29:08.713 [sitemap ] ():
Tidy (vers 4th August 2000) Parsing "InputStream"
line 2 column 1 - Warning: inserting missing 'title' element

InputStream: Document content looks like HTML 2.0
1 warnings/errors were found!

***********vvvv********** Here it is **********vvvv*******
ERROR   2003-10-10 19:29:08.723 [sitemap ] (): Could not setup jtidy
java.lang.NullPointerException
	at org.apache.xml.utils.AttList.getValue(AttList.java:247)
	at org.apache.cocoon.xml.xlink.ExtendedXLinkPipe.startElement(ExtendedXLinkPipe.java:81)
	at org.apache.cocoon.components.sax.XMLTeePipe.startElement(XMLTeePipe.java:118)
	at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1017
)
	at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:346)
[...snip...]
	at org.apache.cocoon.xml.dom.DOMStreamer.stream(DOMStreamer.java:176)
	at org.apache.cocoon.generation.HTMLGenerator.generate(HTMLGenerator.java:284)
	at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:262)
[...snip...]
	at org.apache.cocoon.Main.processURI(Main.java:690)
	at org.apache.cocoon.Main.process(Main.java:566)
	at org.apache.cocoon.Main.main(Main.java:384)
DEBUG   2003-10-10 19:29:08.733 [manager ] (): Put a
org.apache.cocoon.components.sax.XMLByteStreamCompiler back into the pool.
DEBUG   2003-10-10 19:29:08.733 [core.eve] (): Recycling of CachingEventPipeline
...
============================== end of excerpt =========================


I checked the destination directory, ./tmp, and it was empty.
Nothing got generated.
Any ideas?

Surely the whole process isn't crashing just because my HTML lacks
a <title> element? (No, actually I went back just now and added a title
element to that web page, and got rid of the title element warning,
but still have the same jtidy error and NullPointerException.)

The relevant sitemap, mount/gem/sitemap.xmap, can be perused at
http://www.huttar.net/lars-kathy/tmp/sitemap.xmap
The HTML file being accessed, Home.htm, is in the same directory.

Thanks for any help!

Lars


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


Re: xsp: returning nodes

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
If you have the control of the function, then you can use:

org.w3c.dom.DocumentFragment

Info about this interface you can find here:

http://xml.apache.org/xerces-j/apiDocs/org/w3c/dom/DocumentFragment.html

I would help if you can explain more about what are you trying to do.

Best Regards,

Antonio Gallardo.

Michael Hohmann dijo:
> Hi all,
>
> I want an xml-structure that is returned by a function as String to be
> maintained as xml and not to be treated as text.
> I tried it like this:
>
> <xsp:logic>
> String noder(void)
> {Return("<test>testvalue</test>");}
> </xsp:logic>
>
> <xsp:page>
> <xsp:expr>noder()</xsp:expr>
> </xsp:page>
>
> The node should appear as node in the resulting xml from the logicsheet,
> so a stylesheet would be able to transform it later in the pipeline. I
> expected the reply from the logicsheet in the browser to look like:
>
> <xml>
> <test>testvalue</test>
>
> But what happens is that the thing returns things like:
>
> <xml>
> &lt;test&gt;testvalue&lt;/test&gt;
>
> Can anyone help?
>
> Thanks....
>
> Michael
>
>
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org




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


xsp: returning nodes

Posted by Michael Hohmann <mi...@gmx.de>.
Hi all,

I want an xml-structure that is returned by a function as String to be
maintained as xml and not to be treated as text.
I tried it like this:

<xsp:logic>
String noder(void)
{Return("<test>testvalue</test>");}
</xsp:logic>

<xsp:page>
<xsp:expr>noder()</xsp:expr>
</xsp:page>

The node should appear as node in the resulting xml from the logicsheet,
so a stylesheet would be able to transform it later in the pipeline.
I expected the reply from the logicsheet in the browser to look like:

<xml>
<test>testvalue</test>

But what happens is that the thing returns things like:

<xml>
&lt;test&gt;testvalue&lt;/test&gt;

Can anyone help?

Thanks....

Michael


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


Re: NullPointerException in JTidy or HTMLGenerator

Posted by Upayavira <uv...@upaya.co.uk>.
Lars Huttar wrote:

>Thanks for taking a look at the problem.
>
>I'm downloading 2.1 now to see if it works better for me.
>  
>
Good luck.

>I have just started using Eclipse, but had not thought to try
>debugging Cocoon with it. If I do find anything I'll let you know,
>but I know so little about the inner workings of Cocoon (or even
>the outer workings) that it seems unlikely.
>  
>
With a bit of guidance, it isn't that hard!

Regards, Upayavira

>Lars
>
>
>  
>
>>-----Original Message-----
>>From: Upayavira [mailto:uv@upaya.co.uk]
>>Sent: Saturday, October 11, 2003 12:38 AM
>>To: users@cocoon.apache.org
>>Subject: Re: NullPointerException in JTidy or HTMLGenerator
>>
>>
>>Lars,
>>
>>It seems that it is failing at the point where it tries to find if 
>>you've got an href attribute present in your site. Although I 
>>cannot see 
>>why it should do that.
>>
>>If you're able, switch to 2.1, as it has a lot more 
>>functionality. For 
>>example, changing one option can double the speed of CLI generation. 
>>Also, I'll be more in a position to support its use, as I know it far 
>>better.
>>
>>Try it, and see whether you can get your site to work.
>>
>>If you're unable, are you comfortable working in a debugger? 
>>Try loading 
>>Cocoon in an IDE such as Eclipse and set a breakpoint at line 81 in 
>>ExtendedXLinkPipe, and see if you can work out what is going 
>>on there. 
>>If you do find a bug, I'll happily commit a patch.
>>
>>HTH.
>>
>>Regards, Upayavira
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>



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


RE: NullPointerException in JTidy or HTMLGenerator

Posted by Lars Huttar <la...@sil.org>.
Thanks for taking a look at the problem.

I'm downloading 2.1 now to see if it works better for me.

I have just started using Eclipse, but had not thought to try
debugging Cocoon with it. If I do find anything I'll let you know,
but I know so little about the inner workings of Cocoon (or even
the outer workings) that it seems unlikely.

Lars


> -----Original Message-----
> From: Upayavira [mailto:uv@upaya.co.uk]
> Sent: Saturday, October 11, 2003 12:38 AM
> To: users@cocoon.apache.org
> Subject: Re: NullPointerException in JTidy or HTMLGenerator
> 
> 
> Lars,
> 
> It seems that it is failing at the point where it tries to find if 
> you've got an href attribute present in your site. Although I 
> cannot see 
> why it should do that.
> 
> If you're able, switch to 2.1, as it has a lot more 
> functionality. For 
> example, changing one option can double the speed of CLI generation. 
> Also, I'll be more in a position to support its use, as I know it far 
> better.
> 
> Try it, and see whether you can get your site to work.
> 
> If you're unable, are you comfortable working in a debugger? 
> Try loading 
> Cocoon in an IDE such as Eclipse and set a breakpoint at line 81 in 
> ExtendedXLinkPipe, and see if you can work out what is going 
> on there. 
> If you do find a bug, I'll happily commit a patch.
> 
> HTH.
> 
> Regards, Upayavira


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


Re: NullPointerException in JTidy or HTMLGenerator

Posted by Upayavira <uv...@upaya.co.uk>.
Lars,

It seems that it is failing at the point where it tries to find if 
you've got an href attribute present in your site. Although I cannot see 
why it should do that.

If you're able, switch to 2.1, as it has a lot more functionality. For 
example, changing one option can double the speed of CLI generation. 
Also, I'll be more in a position to support its use, as I know it far 
better.

Try it, and see whether you can get your site to work.

If you're unable, are you comfortable working in a debugger? Try loading 
Cocoon in an IDE such as Eclipse and set a breakpoint at line 81 in 
ExtendedXLinkPipe, and see if you can work out what is going on there. 
If you do find a bug, I'll happily commit a patch.

HTH.

Regards, Upayavira

Lars Huttar wrote:

>Dear Cocooners,
>
>I'm trying to get the CLI working to generate static web sites.
>We're using Cocoon v. 2.0.5-dev (mistake?).
>Things seem to fail in HTMLGenerator and/or jtidy; no static
>content gets generated. Anybody know of a fix?
>
>I've got a batch file running, run.bat, to start the CLI.
>
>My command line is:
>$ ./run.bat -c . -C WEB-INF/cocoon.xconf -d tmp -f urlfile.txt > CLI-out.txt
>
>I get a java.sql.SQLException saying the database is already in use by
>another process, but I assume I can ignore that since I'm not using any
>database.
>
>urlfile.txt contains one URL, "mount/gem/workbench/About/Home", which
>works fine when I use it from a browser to connect to Cocoon.
>
>Looking at the debug output in CLI.txt, it seems that the URL is getting
>interpreted right by the sitemap, but at some point the process crashes
>with a NullPointerException in org.apache.xml.utils.AttList.getValue(AttList.java:247)
>which is being called by HTMLGenerator.  Here's the error message in context
>(for the entire debug output, see http://www.huttar.net/lars-kathy/tmp/CLI-out.txt
>[0.5MB]).
>
>========================= excerpt from CLI-out.txt =======================
>...
>DEBUG   2003-10-10 19:29:08.472 [core.sou] (): Resolving 'about/Home.htm' in context
>'file:/c:/Program Files/Apache Group/Tomcat 4.1/webapps/cocoon/mount/gem/'
>DEBUG   2003-10-10 19:29:08.472 [core.sou] (): Resolved to 'file:/c:/Program Files/Apache
>Group/Tomcat 4.1/webapps/cocoon/mount/gem/about/Home.htm'
>DEBUG   2003-10-10 19:29:08.472 [        ] (): Resolved to 'cocoon://mount/gem/About/Home'
>DEBUG   2003-10-10 19:29:08.472 [core.sto] (): NOT Found key: PK_G-html--1160095671642672732_
>DEBUG   2003-10-10 19:29:08.472 [core.sto] (): NOT Found file: PK_G-html--1160095671642672732_
>DEBUG   2003-10-10 19:29:08.472 [core.eve] (): Caching content for further requests of
>'About/Home'.
>DEBUG   2003-10-10 19:29:08.472 [manager ] (): Got a
>org.apache.cocoon.components.sax.XMLByteStreamCompiler from the pool.
>WARN    2003-10-10 19:29:08.713 [sitemap ] ():
>Tidy (vers 4th August 2000) Parsing "InputStream"
>line 2 column 1 - Warning: inserting missing 'title' element
>
>InputStream: Document content looks like HTML 2.0
>1 warnings/errors were found!
>
>***********vvvv********** Here it is **********vvvv*******
>ERROR   2003-10-10 19:29:08.723 [sitemap ] (): Could not setup jtidy
>java.lang.NullPointerException
>	at org.apache.xml.utils.AttList.getValue(AttList.java:247)
>	at org.apache.cocoon.xml.xlink.ExtendedXLinkPipe.startElement(ExtendedXLinkPipe.java:81)
>	at org.apache.cocoon.components.sax.XMLTeePipe.startElement(XMLTeePipe.java:118)
>	at
>org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1017
>)
>	at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:346)
>[...snip...]
>	at org.apache.cocoon.xml.dom.DOMStreamer.stream(DOMStreamer.java:176)
>	at org.apache.cocoon.generation.HTMLGenerator.generate(HTMLGenerator.java:284)
>	at
>org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:262)
>[...snip...]
>	at org.apache.cocoon.Main.processURI(Main.java:690)
>	at org.apache.cocoon.Main.process(Main.java:566)
>	at org.apache.cocoon.Main.main(Main.java:384)
>DEBUG   2003-10-10 19:29:08.733 [manager ] (): Put a
>org.apache.cocoon.components.sax.XMLByteStreamCompiler back into the pool.
>DEBUG   2003-10-10 19:29:08.733 [core.eve] (): Recycling of CachingEventPipeline
>...
>============================== end of excerpt =========================
>
>
>I checked the destination directory, ./tmp, and it was empty.
>Nothing got generated.
>Any ideas?
>
>Surely the whole process isn't crashing just because my HTML lacks
>a <title> element? (No, actually I went back just now and added a title
>element to that web page, and got rid of the title element warning,
>but still have the same jtidy error and NullPointerException.)
>
>The relevant sitemap, mount/gem/sitemap.xmap, can be perused at
>http://www.huttar.net/lars-kathy/tmp/sitemap.xmap
>The HTML file being accessed, Home.htm, is in the same directory.
>
>Thanks for any help!
>
>Lars
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>



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