You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Steven Kurzman <st...@stevenkurzman.com> on 2003/07/17 11:53:30 UTC

Command Line Interface

Hello,
I'm having problems using the command line interface and hope somebody can
help me out.  I don't know Java and am very new to Cocoon, using 2.1m3 and
Tomcat 4.1.24 on Mac OS 10.2.

I read the instructions at wiki.cocoondev.org/Wiki.jsp?page=CommandLine and,
from my /Cocoon/build/webapp directory containing both a cocoon.xconf and
sitemap.xmap, did

./cocoon.sh cli -x cocoon.xconf

It loads all the .jar files from WEB-INF/lib but then gives me

-------------------- Executing -----------------
Main Class: org.apache.cocoon.Main
ERROR: Unknown element: sitemap
------------------------------------------------------------------------
cocoon 2.1m3
Copyright (c) 1999-2003 Apache Software Foundation. All rights reserved.
------------------------------------------------------------------------


Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at Loader.invokeMain(Unknown Source)
        at Loader.run(Unknown Source)
        at Loader.main(Unknown Source)
Caused by: java.lang.NullPointerException
        at org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:178)
        at org.apache.cocoon.Main.main(Main.java:374)
        ... 7 more

I've tried variations on the ./cocoon.sh command, editing the cli.xconf
file, etc., but always get this exception.

What does this mean?  What am I doing wrong?  How can I do it correctly?
Thank you very much for any help!

Steve Kurzman


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


Re: Command Line Interface

Posted by Joerg Heinicke <jo...@gmx.de>.
Upayavira wrote:

>>./cocoon.sh cli -x cli.xconf build/webapp/welcome.xml
>>
>>I got "ERROR: Unexpected children of <logging> node" 
> 
> That one's strange. That is triggered if the <logging> node has children
> (other than attributes).

Not only :) You logged NODE_LOGGING where you need NODE_BROKEN_LINKS or 
NODE_URI. I have fixed it.

The problem is NODE_URI, i.e. <uri/>. In the Main.java there is a test 
whether this node has child nodes, it must not have any. So the old 
behaviour is invalid now: <uri>documents/index.html</uri>.

Remains the question if this change was wanted or not.

Joerg


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


Re: Command Line Interface

Posted by Steven Kurzman <st...@stevenkurzman.com>.
On 7/20/03 2:24 AM, "Conal Tuohy" <co...@paradise.net.nz> wrote:

> Do you realise that Cocoon can cache these PDFs? It may take a minute to
> render a very large PDF, but only the first time. On subsequent requests the
> PDF can be served from the cache, rather than regenerated. If necessary you
> can "prime" the cache by crawling your site regularly with a web-crawler. So
> you may not need to use the CLI at all.

I had, ahem, skipped over this section of the userdocs.  Just went back and
read it as well as some relevant posts to the list archives.  Thanks!


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


RE: Command Line Interface

Posted by Conal Tuohy <co...@paradise.net.nz>.
Steve Kurzman wrote:

<snip/>

> About my hopeful usage, I'm the webmaster for a non-profit web-zine on
> international disability news, policy issues, etc.  We want
> to provide our
> content as text and PDF, as well as HTML, so visitors can
> read it offline if
> they like.  Hence, my foray into XML.  But I want to serve
> static content
> because we don't really need to dynamically generate anything
> and many of
> our visitors come from non-profit organization offices and/or
> developing
> countries and have bandwidth and time constraints, i.e. I
> don't want to make
> users with pay per hour connections and slow modems in Brazil
> or India wait
> for Cocoon to generate a large PDF on the fly before downloading it.

Do you realise that Cocoon can cache these PDFs? It may take a minute to
render a very large PDF, but only the first time. On subsequent requests the
PDF can be served from the cache, rather than regenerated. If necessary you
can "prime" the cache by crawling your site regularly with a web-crawler. So
you may not need to use the CLI at all.

Users on a slow connection will spend much longer downloading the PDF than
it takes to generate it in any case.

Cheers

Con


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


Re: Command Line Interface

Posted by Steven Kurzman <st...@stevenkurzman.com>.
Joerg, thanks for the fixes.  Glad my fumbling around can help.

Upayavira, thanks for the pointer on the URL.  I tried again using this (and
other variations) in my cli.xconf file:

<uri type="replace" src-prefix="/samples/hello-world/" src="hello.html"
dest="build/webapp/done/hello.html"/>

But, regardless of what URL I use, it still stops after building the working
directory and giving me the same error in the brokenlinks.xml file:

<link message="UnnamedSelector: ComponentSelector could not find the
component for hint [request] (key
[request])">/samples/hello-world/hello.html</link>

I'm not sure what to do differently, so hopefully one of you knows what this
means...


About my hopeful usage, I'm the webmaster for a non-profit web-zine on
international disability news, policy issues, etc.  We want to provide our
content as text and PDF, as well as HTML, so visitors can read it offline if
they like.  Hence, my foray into XML.  But I want to serve static content
because we don't really need to dynamically generate anything and many of
our visitors come from non-profit organization offices and/or developing
countries and have bandwidth and time constraints, i.e. I don't want to make
users with pay per hour connections and slow modems in Brazil or India wait
for Cocoon to generate a large PDF on the fly before downloading it.

Forrest would work fine to dynamically generate/statically serve, except I
also need users to be able to email articles off the site.  I use some
annoyingly unstable CGI for this now and would love to find a better
solution, like Cocoon's sendmail action or logicsheet.

So I'm hoping to use the CLI to generate static HTML, rtf, and PDF content,
AND use the Cocoon web app to deal with sendmail.  If I can get the CLI to
work, I'll probably have a whole new series of newbie questions about
sendmail in the future.  If not, maybe I'll just use Forrest or Xalan with
FOP to generate the static content.  This is all still in the planning
stages, so I'm open to suggestions.

Thanks,
Steve


On 7/19/03 3:00 AM, "Upayavira" <uv...@upaya.co.uk> wrote:

>> The brokenlinks.xml file contained "<link message="UnnamedSelector:
>> ComponentSelector could not find the component for hint [request] (key
>> [request])">build/webapp/welcome.xml</link>".  Does this refer to
>> webapp/sitemap.xmap?
> 
> Okay, I don't immediately understand why you're getting the
> UnnamedSelector error, but the one thing I do spot is the URL you are
> requesting is wrong. You need to use just the bit that is given to
> Cocoon. So if your URL to access Cocoon when running as a servlet is
> http://localhost:8080/cocoon/foo/bar.html, then the URL you pass to the
> CLI is just /foo/bar.html.
> 
> Try that and see how that does.
> 
> Have you considered using the <uri> node in the xconf file to specify
> your destination? You can do a lot more with it than if you specify the
> URL on the command line.
> 
>> Here is my cli.xconf file below.  Thank you for any corrections you (or
>> anyone experienced with the CLI) can offer.
> 
> Are you willing to say a bit about what you intend to use the CLI for? I
> don't tend to hear much about people's planned usage of it.
> 
> Regards, Upayavira


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


Re: Command Line Interface

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

> I think I'm getting closer ;).  As you suggested, I downloaded Cocoon
> from
> CVS.  I figured I'd start just by seeing if I could generate the
> webapp/welcome.xml page so I did
> 
> ./cocoon.sh cli -x cli.xconf build/webapp/welcome.xml
> 
> I got "ERROR: Unexpected children of <logging> node" 

That one's strange. That is triggered if the <logging> node has children
(other than attributes). And the <logging> node in your xconf doesn't
have any child nodes. Strange. My HDD crashed last week, so I'm using a
borrowed computer at present. I'm downloading everything I need to debug
Cocoon, so if I can get that working, I'll see if I can fix this one.

> and then "Cannot find
> CatalogManager.properties", though it did seem to load
> WEB-INF/entities/catalog.

I often get that, but it hasn't caused me any problems.

> The brokenlinks.xml file contained "<link message="UnnamedSelector:
> ComponentSelector could not find the component for hint [request] (key
> [request])">build/webapp/welcome.xml</link>".  Does this refer to
> webapp/sitemap.xmap?

Okay, I don't immediately understand why you're getting the
UnnamedSelector error, but the one thing I do spot is the URL you are
requesting is wrong. You need to use just the bit that is given to
Cocoon. So if your URL to access Cocoon when running as a servlet is
http://localhost:8080/cocoon/foo/bar.html, then the URL you pass to the
CLI is just /foo/bar.html.

Try that and see how that does.

Have you considered using the <uri> node in the xconf file to specify
your destination? You can do a lot more with it than if you specify the
URL on the command line.

> Here is my cli.xconf file below.  Thank you for any corrections you (or
> anyone experienced with the CLI) can offer.

Are you willing to say a bit about what you intend to use the CLI for? I
don't tend to hear much about people's planned usage of it.

Regards, Upayavira

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


Re: Command Line Interface

Posted by Steven Kurzman <st...@stevenkurzman.com>.
Upayavira,
I think I'm getting closer ;).  As you suggested, I downloaded Cocoon from
CVS.  I figured I'd start just by seeing if I could generate the
webapp/welcome.xml page so I did

./cocoon.sh cli -x cli.xconf build/webapp/welcome.xml

I got "ERROR: Unexpected children of <logging> node" and then "Cannot find
CatalogManager.properties", though it did seem to load
WEB-INF/entities/catalog.

The brokenlinks.xml file contained "<link message="UnnamedSelector:
ComponentSelector could not find the component for hint [request] (key
[request])">build/webapp/welcome.xml</link>".  Does this refer to
webapp/sitemap.xmap?

Here is my cli.xconf file below.  Thank you for any corrections you (or
anyone experienced with the CLI) can offer.

Steve

<?xml version="1.0"?>

<!--+
    |  This is the Apache Cocoon command line configuration file.
    |  Here you give the command line interface details of where
    |  to find various aspects of your Cocoon installation.
    |
    |  If you wish, you can also use this file to specify the URIs
    |  that you wish to generate.
    |
    |  The current configuration information in this file is for
    |  building the Cocoon documentation. Therefore, all links here
    |  are relative to the build context dir, which, in the build.xml
    |  file, is set to ${build.context}
    |
    |  Options:
    |    verbose:            increase amount of information presented
    |                        to standard output (default: false)
    |    follow-links:       whether linked pages should also be
    |                        generated (default: true)
    |    precompile-only:    precompile sitemaps and XSP pages, but
    |                        do not generate any pages (default: false)
    |    confirm-extensions: check the mime type for the generated page
    |                        and adjust filename and links extensions
    |                        to match the mime type
    |                        (e.g. text/html->.html)
    |
    | CVS: $Id: cli.xconf,v 1.3 2003/06/07 23:13:35 vgritsenko Exp $
    +-->
    
<cocoon verbose="true"
        follow-links="true"
        precompile-only="false"
        confirm-extensions="false">

   <!--+
       | Broken link reporting options:
       |   Report into a text file, one link per line:
       |     <broken-links type="text" report="filename"/>
       |   Report into an XML file:
       |     <broken-links type="xml" report="filename"/>
       |   Ignore broken links (default):
       |     <broken-links type="none"/>
       |   When a page includes an error, should a page be generated?
       |     
       |   Two attributes to this node specify whether a page should
       |   be generated when an error occured. 'generate' specifies
       |   whether a page should be generated (default: true) and
       |   extension specifies an extension that should be appended
       |   to the generated page's filename (default: none)
       |     <broken-links generate="true" extension=".error.txt"/>
       |
       +-->
   <broken-links type="xml"
                 file="build/webapp/temp/brokenlinks.xml"
                 generate="false"
                 extension=".error"/>
   
   <!--+
       |  Load classes at startup. This is necessary for generating
       |  from sites that use SQL databases and JDBC.
       |  The <load-class> element can be repeated if multiple classes
       |  are needed.
       +-->
   <!--
   <load-class>org.firebirdsql.jdbc.Driver</load-class>
   -->

   <!--+
       |
       +-->
   <logging log-kit="build/webapp/WEB-INF/logkit.xconf" logger="cli"
level="ERROR" />

   <!--+
       |  The context directory is usually the webapp directory
       |  containing the sitemap.xmap file.
       |
       |  The config file is the cocoon.xconf file.
       |
       |  The work directory is used by Cocoon to store temporary
       |  files and cache files.
       |  
       |  The destination directory is where generated pages will
       |  be written (assuming the 'simple' mapper is used)
       +-->
   <context-dir>build/webapp</context-dir>
   <config-file>build/webapp/docs/cocoon.xconf</config-file>
   <work-dir>build/webapp/temp</work-dir>
   <dest-dir>build/webapp/done</dest-dir>

   <!--+
       | Specifies the filename to be appended to URIs that
       | refer to a directory (i.e. end with a forward slash).
       +-->
   <default-filename>index.html</default-filename>

   <!--+
       |  Specifies a user agent string to the sitemap when
       |  generating the site.
       +-->
   <!--
   <user-agent>xxx</user-agent>
   -->

   <!--+
       |  Specifies an accept string to the sitemap when generating
       |  the site.
       +-->
   <accept>*/*</accept>
   
   <!--+
       |  Specifies the URIs that should be generated (using <uri>
       |  elements, and (if necessary) what should be done with the
       |  generated pages.
       |
       |  The old behaviour - appends uri to the specified destination
       |  directory (as specified in <dest-dir>):
       |
       |   <uri>documents/index.html</uri>
       |
       |  Append: append the generated page's URI to the end of the
       |  source URI:
       |
       |   <uri type="append" src-prefix="documents/" src="index.html"
       |   dest="build/dest/"/>
       |
       |  Replace: Completely ignore the generated page's URI - just
       |  use the destination URI:
       |
       |   <uri type="replace" src-prefix="documents/" src="index.html"
       |   dest="build/dest/docs.html"/>
       |
       |  Insert: Insert generated page's URI into the destination
       |  URI at the point marked with a * (example uses fictional
       |  zip protocol)
       |
       |   <uri type="insert" src-prefix="documents/" src="index.html"
       |   dest="zip://*.zip/page.html"/>
       |
       +-->
   <uri>build/webapp/welcome.xml</uri>

   <!--+
       |  File containing URIs (plain text, one per
       |  line).
       +-->
   <!--
   <uri-file></uri-file>
   -->
   
</cocoon>




On 7/18/03 11:50 AM, "Upayavira" <uv...@upaya.co.uk> wrote:

> Steven,
> 
>> Hello Joerg,
>> Thank you for your response and help.  I got the
>> cocoon-2.1_20030718045249
>> CVS and built it.  But I am still having problems...
> 
> Hmm. Is that late enough to catch Joerg's fix? (Thanks Joerg, I'd spotted
> that, but didn't know how to fix it).
> 
> Alternatively, download Cocoon direct from CVS. Directions are at:
> 
> http://cocoon.apache.org/community/contrib.html#CVS+Usage+Precis
> 
>> I do ./cocoon.sh cli -x cli.xconf (I had mistyped this as -x cocoon.xconf
>> in my previous email)
>> 
>> Now, after the .jars load, I get this error, "ERROR: Unexpected children
>> of <logging> node", followed by
> 
> Can you post the contents of your cli.xconf file? Then we can have a look
> at what is going on there.
> 
>> FATAL_E 2003-07-18 09:54:59.335 [        ] (): Please, specify at least
>> one
>> starting URI.
> 
> You need to specify a page to start at, using a <uri> node.
> 
> Regards, Upayavira
> 
>> Exception in thread "main" java.lang.reflect.InvocationTargetException
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
>> )
>>         at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
>> .java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:324)
>>         at Loader.invokeMain(Unknown Source)
>>         at Loader.run(Unknown Source)
>>         at Loader.main(Unknown Source)
>> Caused by: org.apache.cocoon.ProcessingException: Please, specify at
>> least
>> one starting URI.
>>         at
>>         org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:179)
>>         at org.apache.cocoon.Main.main(Main.java:374)
>>         ... 7 more
>> 
>> So I try specifying a URI on the command line by doing ./cocoon.sh cli
>> build/webapp/test/samples.xml -x cli.xconf
>> 
>> After the .jars load, I now get this error, "ERROR: Unexpected children
>> of
>> <logging> node" with the following
>> 
>> Cannot find CatalogManager.properties
>> server.properties not found, using command line or default properties
>> Opening database: /Users/steven/Library/Cocoon/WEB-INF/db/cocoondb
>> HSQLDB server 1.7.1 is running
>> Use SHUTDOWN to close normally. Use [Ctrl]+[C] to abort abruptly
>> Exception in thread "main" java.lang.reflect.InvocationTargetException
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
>> )
>>         at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
>> .java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:324)
>>         at Loader.invokeMain(Unknown Source)
>>         at Loader.run(Unknown Source)
>>         at Loader.main(Unknown Source)
>> Caused by: java.lang.NoClassDefFoundError:
>> javax/servlet/http/HttpSessionBindingListener
>>         at java.lang.ClassLoader.defineClass0(Native Method)
>>         at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
>>         at 
>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
>>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
>>         at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
>>         at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
>>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
>>         at java.lang.ClassLoader.defineClass0(Native Method)
>>         at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
>>         at 
>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
>>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
>>         at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
>>         at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
>>         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
>>         at 
>> org.apache.avalon.excalibur.component.ExcaliburComponentSelector.configure(E
>> xcaliburComponentSelector.java:404)
>>         at 
>> org.apache.avalon.framework.container.ContainerUtil.configure(ContainerUtil.
>> java:239)
>>         at 
>> org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(De
>> faultComponentFactory.java:315)
>>         at 
>> org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initialize(
>> ThreadSafeComponentHandler.java:141)
>>         at 
>> org.apache.avalon.excalibur.component.ExcaliburComponentManager.initialize(E
>> xcaliburComponentManager.java:554)
>>         at 
>> org.apache.cocoon.components.CocoonComponentManager.initialize(CocoonCompone
>> ntManager.java:530)
>>         at 
>> org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil
>> .java:282)
>>         at org.apache.cocoon.Cocoon.initialize(Cocoon.java:321)
>>         at 
>> org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil
>> .java:282)
>>         at
>>         org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:237)
>>         at org.apache.cocoon.Main.main(Main.java:374)
>>         ... 7 more
>> Fri Jul 18 09:50:54 PDT 2003 Listening for connections ...
>> 
>> I tend to assume the problem is with me because I am a newbie, but I
>> believe
>> I have the settings correct in my cli.xconf file (perhaps I should post
>> it?).  Any ideas on what could be going wrong?
>> 
>> Thank you,
>> Steve
>> 
>> 
>>  
>> 
>> On 7/17/03 10:03 PM, "Joerg Heinicke" <jo...@gmx.de> wrote:
>> 
>>> Hello Steven,
>>> 
>>> this was a bug in the CocoonBean. The logger was used before it was
>>> initialized. I have fixed it in the CVS.
>>> 
>>> This happened only if you should get an error before initializing the
>>> logger. In your case (line 178) you should have seen this error:
>>> "Please, specify at least one starting URI."
>>> 
>>> If you use current CVS, your won't get the NPE.
>>> 
>>> Thanks for reporting.
>>> 
>>> Joerg
>>> 
>>> Steven Kurzman wrote:
>>>> Hello,
>>>> I'm having problems using the command line interface and hope somebody can
>>>> help me out.  I don't know Java and am very new to Cocoon, using 2.1m3 and
>>>> Tomcat 4.1.24 on Mac OS 10.2.
>>>> 
>>>> I read the instructions at wiki.cocoondev.org/Wiki.jsp?page=CommandLine
>>>> and,
>>>> from my /Cocoon/build/webapp directory containing both a cocoon.xconf and
>>>> sitemap.xmap, did
>>>> 
>>>> ./cocoon.sh cli -x cocoon.xconf
>>>> 
>>>> It loads all the .jar files from WEB-INF/lib but then gives me
>>>> 
>>>> -------------------- Executing -----------------
>>>> Main Class: org.apache.cocoon.Main
>>>> ERROR: Unknown element: sitemap
>>>> ------------------------------------------------------------------------
>>>> cocoon 2.1m3
>>>> Copyright (c) 1999-2003 Apache Software Foundation. All rights reserved.
>>>> ------------------------------------------------------------------------
>>>> 
>>>> 
>>>> Exception in thread "main" java.lang.reflect.InvocationTargetException
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>         at 
>>>> 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3>>>>
9
>>>> )
>>>>         at 
>>>> 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp>>>>
l
>>>> .java:25)
>>>>         at java.lang.reflect.Method.invoke(Method.java:324)
>>>>         at Loader.invokeMain(Unknown Source)
>>>>         at Loader.run(Unknown Source)
>>>>         at Loader.main(Unknown Source)
>>>> Caused by: java.lang.NullPointerException
>>>>         at 
>>>> org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:178)
>>>>         at org.apache.cocoon.Main.main(Main.java:374)
>>>>         ... 7 more
>>>> 
>>>> I've tried variations on the ./cocoon.sh command, editing the cli.xconf
>>>> file, etc., but always get this exception.
>>>> 
>>>> What does this mean?  What am I doing wrong?  How can I do it correctly?
>>>> Thank you very much for any help!
>>>> 
>>>> Steve Kurzman
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> 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
>> 
>> 
> 
> ---------------------------------------------------------------------
> 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: Command Line Interface

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

> Hello Joerg,
> Thank you for your response and help.  I got the
> cocoon-2.1_20030718045249
> CVS and built it.  But I am still having problems...

Hmm. Is that late enough to catch Joerg's fix? (Thanks Joerg, I'd spotted
that, but didn't know how to fix it).

Alternatively, download Cocoon direct from CVS. Directions are at:

http://cocoon.apache.org/community/contrib.html#CVS+Usage+Precis

> I do ./cocoon.sh cli -x cli.xconf (I had mistyped this as -x cocoon.xconf
> in my previous email)
> 
> Now, after the .jars load, I get this error, "ERROR: Unexpected children
> of <logging> node", followed by

Can you post the contents of your cli.xconf file? Then we can have a look
at what is going on there.

> FATAL_E 2003-07-18 09:54:59.335 [        ] (): Please, specify at least
> one
> starting URI.

You need to specify a page to start at, using a <uri> node.

Regards, Upayavira

> Exception in thread "main" java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
> )
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
> .java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at Loader.invokeMain(Unknown Source)
>         at Loader.run(Unknown Source)
>         at Loader.main(Unknown Source)
> Caused by: org.apache.cocoon.ProcessingException: Please, specify at
> least
> one starting URI.
>         at
>         org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:179)
>         at org.apache.cocoon.Main.main(Main.java:374)
>         ... 7 more
> 
> So I try specifying a URI on the command line by doing ./cocoon.sh cli
> build/webapp/test/samples.xml -x cli.xconf
> 
> After the .jars load, I now get this error, "ERROR: Unexpected children
> of
> <logging> node" with the following
> 
> Cannot find CatalogManager.properties
> server.properties not found, using command line or default properties
> Opening database: /Users/steven/Library/Cocoon/WEB-INF/db/cocoondb
> HSQLDB server 1.7.1 is running
> Use SHUTDOWN to close normally. Use [Ctrl]+[C] to abort abruptly
> Exception in thread "main" java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
> )
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
> .java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at Loader.invokeMain(Unknown Source)
>         at Loader.run(Unknown Source)
>         at Loader.main(Unknown Source)
> Caused by: java.lang.NoClassDefFoundError:
> javax/servlet/http/HttpSessionBindingListener
>         at java.lang.ClassLoader.defineClass0(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
>         at 
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
>         at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
>         at java.lang.ClassLoader.defineClass0(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
>         at 
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
>         at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
>         at 
> org.apache.avalon.excalibur.component.ExcaliburComponentSelector.configure(E
> xcaliburComponentSelector.java:404)
>         at 
> org.apache.avalon.framework.container.ContainerUtil.configure(ContainerUtil.
> java:239)
>         at 
> org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(De
> faultComponentFactory.java:315)
>         at 
> org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initialize(
> ThreadSafeComponentHandler.java:141)
>         at 
> org.apache.avalon.excalibur.component.ExcaliburComponentManager.initialize(E
> xcaliburComponentManager.java:554)
>         at 
> org.apache.cocoon.components.CocoonComponentManager.initialize(CocoonCompone
> ntManager.java:530)
>         at 
> org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil
> .java:282)
>         at org.apache.cocoon.Cocoon.initialize(Cocoon.java:321)
>         at 
> org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil
> .java:282)
>         at
>         org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:237)
>         at org.apache.cocoon.Main.main(Main.java:374)
>         ... 7 more
> Fri Jul 18 09:50:54 PDT 2003 Listening for connections ...
> 
> I tend to assume the problem is with me because I am a newbie, but I
> believe
> I have the settings correct in my cli.xconf file (perhaps I should post
> it?).  Any ideas on what could be going wrong?
> 
> Thank you,
> Steve
> 
> 
>  
> 
> On 7/17/03 10:03 PM, "Joerg Heinicke" <jo...@gmx.de> wrote:
> 
> > Hello Steven,
> > 
> > this was a bug in the CocoonBean. The logger was used before it was
> > initialized. I have fixed it in the CVS.
> > 
> > This happened only if you should get an error before initializing the
> > logger. In your case (line 178) you should have seen this error:
> > "Please, specify at least one starting URI."
> > 
> > If you use current CVS, your won't get the NPE.
> > 
> > Thanks for reporting.
> > 
> > Joerg
> > 
> > Steven Kurzman wrote:
> >> Hello,
> >> I'm having problems using the command line interface and hope somebody can
> >> help me out.  I don't know Java and am very new to Cocoon, using 2.1m3 and
> >> Tomcat 4.1.24 on Mac OS 10.2.
> >> 
> >> I read the instructions at wiki.cocoondev.org/Wiki.jsp?page=CommandLine and,
> >> from my /Cocoon/build/webapp directory containing both a cocoon.xconf and
> >> sitemap.xmap, did
> >> 
> >> ./cocoon.sh cli -x cocoon.xconf
> >> 
> >> It loads all the .jar files from WEB-INF/lib but then gives me
> >> 
> >> -------------------- Executing -----------------
> >> Main Class: org.apache.cocoon.Main
> >> ERROR: Unknown element: sitemap
> >> ------------------------------------------------------------------------
> >> cocoon 2.1m3
> >> Copyright (c) 1999-2003 Apache Software Foundation. All rights reserved.
> >> ------------------------------------------------------------------------
> >> 
> >> 
> >> Exception in thread "main" java.lang.reflect.InvocationTargetException
> >>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>         at 
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
> >> )
> >>         at 
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
> >> .java:25)
> >>         at java.lang.reflect.Method.invoke(Method.java:324)
> >>         at Loader.invokeMain(Unknown Source)
> >>         at Loader.run(Unknown Source)
> >>         at Loader.main(Unknown Source)
> >> Caused by: java.lang.NullPointerException
> >>         at org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:178)
> >>         at org.apache.cocoon.Main.main(Main.java:374)
> >>         ... 7 more
> >> 
> >> I've tried variations on the ./cocoon.sh command, editing the cli.xconf
> >> file, etc., but always get this exception.
> >> 
> >> What does this mean?  What am I doing wrong?  How can I do it correctly?
> >> Thank you very much for any help!
> >> 
> >> Steve Kurzman
> > 
> > 
> > ---------------------------------------------------------------------
> > 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
> 
> 

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


Re: Command Line Interface

Posted by Steven Kurzman <st...@stevenkurzman.com>.
Hello Joerg,
Thank you for your response and help.  I got the cocoon-2.1_20030718045249
CVS and built it.  But I am still having problems...

I do ./cocoon.sh cli -x cli.xconf (I had mistyped this as -x cocoon.xconf in
my previous email)

Now, after the .jars load, I get this error, "ERROR: Unexpected children of
<logging> node", followed by

FATAL_E 2003-07-18 09:54:59.335 [        ] (): Please, specify at least one
starting URI.
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at Loader.invokeMain(Unknown Source)
        at Loader.run(Unknown Source)
        at Loader.main(Unknown Source)
Caused by: org.apache.cocoon.ProcessingException: Please, specify at least
one starting URI.
        at org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:179)
        at org.apache.cocoon.Main.main(Main.java:374)
        ... 7 more

So I try specifying a URI on the command line by doing ./cocoon.sh cli
build/webapp/test/samples.xml -x cli.xconf

After the .jars load, I now get this error, "ERROR: Unexpected children of
<logging> node" with the following

Cannot find CatalogManager.properties
server.properties not found, using command line or default properties
Opening database: /Users/steven/Library/Cocoon/WEB-INF/db/cocoondb
HSQLDB server 1.7.1 is running
Use SHUTDOWN to close normally. Use [Ctrl]+[C] to abort abruptly
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at Loader.invokeMain(Unknown Source)
        at Loader.run(Unknown Source)
        at Loader.main(Unknown Source)
Caused by: java.lang.NoClassDefFoundError:
javax/servlet/http/HttpSessionBindingListener
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
        at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
        at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
        at 
org.apache.avalon.excalibur.component.ExcaliburComponentSelector.configure(E
xcaliburComponentSelector.java:404)
        at 
org.apache.avalon.framework.container.ContainerUtil.configure(ContainerUtil.
java:239)
        at 
org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(De
faultComponentFactory.java:315)
        at 
org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initialize(
ThreadSafeComponentHandler.java:141)
        at 
org.apache.avalon.excalibur.component.ExcaliburComponentManager.initialize(E
xcaliburComponentManager.java:554)
        at 
org.apache.cocoon.components.CocoonComponentManager.initialize(CocoonCompone
ntManager.java:530)
        at 
org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil
.java:282)
        at org.apache.cocoon.Cocoon.initialize(Cocoon.java:321)
        at 
org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil
.java:282)
        at org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:237)
        at org.apache.cocoon.Main.main(Main.java:374)
        ... 7 more
Fri Jul 18 09:50:54 PDT 2003 Listening for connections ...

I tend to assume the problem is with me because I am a newbie, but I believe
I have the settings correct in my cli.xconf file (perhaps I should post
it?).  Any ideas on what could be going wrong?

Thank you,
Steve


 

On 7/17/03 10:03 PM, "Joerg Heinicke" <jo...@gmx.de> wrote:

> Hello Steven,
> 
> this was a bug in the CocoonBean. The logger was used before it was
> initialized. I have fixed it in the CVS.
> 
> This happened only if you should get an error before initializing the
> logger. In your case (line 178) you should have seen this error:
> "Please, specify at least one starting URI."
> 
> If you use current CVS, your won't get the NPE.
> 
> Thanks for reporting.
> 
> Joerg
> 
> Steven Kurzman wrote:
>> Hello,
>> I'm having problems using the command line interface and hope somebody can
>> help me out.  I don't know Java and am very new to Cocoon, using 2.1m3 and
>> Tomcat 4.1.24 on Mac OS 10.2.
>> 
>> I read the instructions at wiki.cocoondev.org/Wiki.jsp?page=CommandLine and,
>> from my /Cocoon/build/webapp directory containing both a cocoon.xconf and
>> sitemap.xmap, did
>> 
>> ./cocoon.sh cli -x cocoon.xconf
>> 
>> It loads all the .jar files from WEB-INF/lib but then gives me
>> 
>> -------------------- Executing -----------------
>> Main Class: org.apache.cocoon.Main
>> ERROR: Unknown element: sitemap
>> ------------------------------------------------------------------------
>> cocoon 2.1m3
>> Copyright (c) 1999-2003 Apache Software Foundation. All rights reserved.
>> ------------------------------------------------------------------------
>> 
>> 
>> Exception in thread "main" java.lang.reflect.InvocationTargetException
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
>> )
>>         at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
>> .java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:324)
>>         at Loader.invokeMain(Unknown Source)
>>         at Loader.run(Unknown Source)
>>         at Loader.main(Unknown Source)
>> Caused by: java.lang.NullPointerException
>>         at org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:178)
>>         at org.apache.cocoon.Main.main(Main.java:374)
>>         ... 7 more
>> 
>> I've tried variations on the ./cocoon.sh command, editing the cli.xconf
>> file, etc., but always get this exception.
>> 
>> What does this mean?  What am I doing wrong?  How can I do it correctly?
>> Thank you very much for any help!
>> 
>> Steve Kurzman
> 
> 
> ---------------------------------------------------------------------
> 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: Command Line Interface

Posted by Joerg Heinicke <jo...@gmx.de>.
Hello Steven,

this was a bug in the CocoonBean. The logger was used before it was 
initialized. I have fixed it in the CVS.

This happened only if you should get an error before initializing the 
logger. In your case (line 178) you should have seen this error: 
"Please, specify at least one starting URI."

If you use current CVS, your won't get the NPE.

Thanks for reporting.

Joerg

Steven Kurzman wrote:
> Hello,
> I'm having problems using the command line interface and hope somebody can
> help me out.  I don't know Java and am very new to Cocoon, using 2.1m3 and
> Tomcat 4.1.24 on Mac OS 10.2.
> 
> I read the instructions at wiki.cocoondev.org/Wiki.jsp?page=CommandLine and,
> from my /Cocoon/build/webapp directory containing both a cocoon.xconf and
> sitemap.xmap, did
> 
> ./cocoon.sh cli -x cocoon.xconf
> 
> It loads all the .jar files from WEB-INF/lib but then gives me
> 
> -------------------- Executing -----------------
> Main Class: org.apache.cocoon.Main
> ERROR: Unknown element: sitemap
> ------------------------------------------------------------------------
> cocoon 2.1m3
> Copyright (c) 1999-2003 Apache Software Foundation. All rights reserved.
> ------------------------------------------------------------------------
> 
> 
> Exception in thread "main" java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
> )
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
> .java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at Loader.invokeMain(Unknown Source)
>         at Loader.run(Unknown Source)
>         at Loader.main(Unknown Source)
> Caused by: java.lang.NullPointerException
>         at org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:178)
>         at org.apache.cocoon.Main.main(Main.java:374)
>         ... 7 more
> 
> I've tried variations on the ./cocoon.sh command, editing the cli.xconf
> file, etc., but always get this exception.
> 
> What does this mean?  What am I doing wrong?  How can I do it correctly?
> Thank you very much for any help!
> 
> Steve Kurzman


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