At GT, Jeremy offered to test the CLI with databases. So here's going public with his explorations (hope you don't mind, Jeremy!)

Jeremy Quinn wrote:

Ah, okay. Are you able to recompile a more minimal Cocoon - just the blocks you need (e.g. exclude the session-fw block). I think that's the problem you're having.

At some point, we'll have to make all blocks compatible with the CLI - i.e. being more careful about what services they expect from their environment on startup.

Regards, Upayavira

OK, I thought I would try it first using the standard cli.xconf.

I went:

[tintin:~/Checkouts/Secure/cocoon-2.1] jermq% ./cocoon.sh cli -x cli.xconf
./cocoon.sh: using /Users/jermq/Checkouts/Secure/cocoon-2.1/build/webapp as the webapp directory
-------------------- Loading --------------------
Processing repository: /Users/jermq/Checkouts/Secure/cocoon-2.1/build/webapp/WEB-INF/lib
Adding jar:


<snip wot="adding jars"/>

-------------------- Executing -----------------
Main Class: org.apache.cocoon.Main
------------------------------------------------------------------------
cocoon 2.1.3-dev
Copyright (c) 1999-2003 Apache Software Foundation. All rights reserved.
------------------------------------------------------------------------


Cannot find CatalogManager.properties
server.properties not found, using command line or default properties
Opening database: /Users/jermq/Checkouts/Secure/cocoon-2.1/build/webapp/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.jav a:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.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.configu re(ExcaliburComponentSelector.java:404)
at org.apache.avalon.framework.container.ContainerUtil.configure(ContainerU til.java:239)
at org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstanc e(DefaultComponentFactory.java:315)
at org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initial ize(ThreadSafeComponentHandler.java:141)
at org.apache.avalon.excalibur.component.ExcaliburComponentManager.initiali ze(ExcaliburComponentManager.java:554)
at org.apache.cocoon.components.CocoonComponentManager.initialize(CocoonCom ponentManager.java:530)
at org.apache.avalon.framework.container.ContainerUtil.initialize(Container Util.java:282)
at org.apache.cocoon.Cocoon.initialize(Cocoon.java:327)
at org.apache.avalon.framework.container.ContainerUtil.initialize(Container Util.java:282)
at org.apache.cocoon.bean.CocoonWrapper.initialize(CocoonWrapper.java:185)
at org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:133)
at org.apache.cocoon.Main.main(Main.java:401)
... 7 more
Server.run/init: java.net.BindException: Address already in use
java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
at java.net.ServerSocket.bind(ServerSocket.java:309)
at java.net.ServerSocket.<init>(ServerSocket.java:183)
at java.net.ServerSocket.<init>(ServerSocket.java:95)
at org.hsqldb.Server.run(Unknown Source)
at org.hsqldb.Server.main(Unknown Source)
at org.apache.cocoon.components.hsqldb.ServerImpl.run(ServerImpl.java:199)
at java.lang.Thread.run(Thread.java:554)



When I run './cocoon.sh servlet', Jetty runs fine (but still mentions the ' java.net.BindException: Address already in use' problem).


My CVS is a week old, should I update it first?

regards Jeremy


On Monday, October 13, 2003, at 11:26 AM, Upayavira wrote:


Jeremy Quinn wrote:


On Friday, October 10, 2003, at 06:29 PM, Upayavira wrote:


Jeremy Quinn wrote:

Hi Upayavira

On Thursday, October 9, 2003, at 01:38 PM, Upayavira wrote:

Jeremy Quinn wrote:

Hi Upayavira

I can possibly help you hook up a database to Cocoon.


regards Jeremy



Are you willing to just try it? Run the CLI and have it generate a single page with content from a DB. Doesn't need to do more than one page, or to crawl. If you manage to successfully get a single page out, then I'm happy.

Note the <load-class> entry in the cli.xconf. You may need it.



My database is set up as a <datasource/> in cocoon.xconf, would I still need the <load-class/> ?


On the publishing side, I use SQLTransformer.
I would expect this to just work ....


I would like to see both types tested - I'm particularly curious to see if <load-class/> works. But both with and without should be fine.


On the editing side ( OK, so I would not statically publish the editor :) ) I have Hibernate to contend with. I need to open and close Hibernate sessions around each Request. I do this with a TomCat Filter. I imagine this type of access would be much more complicated .....


Ah. I can't see that working - but that's not really the sort of thing I'm looking for - I'm looking more specifically for tests on simple publication sites.

Just edit COCOON/cli.xconf so that a <uri> node points to the URI of your page.

Then do:
cocoon cli -x cli.xconf


would that be:
./cocoon.sh cli -x cli.xconf


Yup.

ie. on Unix

I ought to be able to do a single page relatively easily .....


Great.

Thanks for this.

Next, you can try out my new Ant task, and automate the whole process ;-)

Regards, Upayavira








Reply via email to