You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by sameer nanda <sa...@rediffmail.com> on 2004/05/07 20:54:01 UTC

Problem rebuilding Cocoon 2.1.2

Hello Everybody,

I am not sure how can I restart Cocoon2.1.2 (or rebuild coccon), after I add a new database or want to create a new table using the already existing HSQL script "cocoondb.script".

I am trying to run the application from the book Cocoon: Building XML Application, chapter 7, which tell you how to add a new database or connect to the existing HSQL database.

I have configured my Cocoon2.1.2 from source distribution, as shown below:

-> downloaded the latest source version and installed using
 1) build cocoon using "build"
 2) run cocoon using  "./cocoon.sh cli"
 3) http://ip-add:8888  points to the welcome page of cocoon

I add the follwing lines to the cocoondb.script file :

CREATE TABLE PORTALUSER_TABLE(ID VARCHAR,PASSWORD VARCHAR,COLOR VARCHAR,UNIQUE(ID))
CREATE TABLE MOREOVER_TABLE(ID INTEGER,NAME VARCHAR,NEWSFEED VARCHAR,UNIQUE(ID))

INSERT INTO PORTALUSER_TABLE VALUES('cocoon','magic','white')
INSERT INTO PORTALUSER_TABLE VALUES('matthew','wizard','yellow')
INSERT INTO MOREOVER_TABLE VALUES(1,'matthew','banking')
INSERT INTO MOREOVER_TABLE VALUES(2,'cocoon','usa')
INSERT INTO MOREOVER_TABLE VALUES(3,'cocoon','banking')

=========================================================

Now since I am trying to add a new table and insert some values into it, I have to restart my cocoon, this is how I try to restart cocoon using:

shell> ./coccon.sh cli

but get an error msg at the end ....


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


ERROR   2004-05-07 14:44:35.412 [        ] (): Could not find the configuration file.
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.io.FileNotFoundException: The configuration file could not be found.
        at org.apache.cocoon.bean.CocoonWrapper.getConfigurationFile(CocoonWrapper.java:235)
        at org.apache.cocoon.bean.CocoonWrapper.initialize(CocoonWrapper.java:142)
        at org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:119)
        at org.apache.cocoon.Main.main(Main.java:400)
        ... 7 more

=====================================================================



Now question is that is this the proper way to restart cocoon in my case, or their is something else i need to do . I even tried with:

shell> ./cocoon.sh servlet

and this time I get BindException, which is true bcos its already bound to the port 8888. This is how the msg looks like:

./cocoon.sh: using ./build/webapp as the webapp directory
-------------------- Loading --------------------
Processing repository: ./tools/jetty/lib
Adding jar: ./tools/jetty/lib/jetty-4.2.9.jar
Adding jar: ./tools/jetty/lib/servlet-2.3.jar
Processing repository: ./lib/endorsed
Adding jar: ./lib/endorsed/xalan-2.5.1.jar
Adding jar: ./lib/endorsed/xercesImpl-2.5.0.jar
Adding jar: ./lib/endorsed/xml-apis.jar
-------------------- Executing -----------------
Main Class: org.mortbay.jetty.Server
14:47:54.865 EVENT  Starting Jetty/4.2.9
14:47:55.846 EVENT  Started WebApplicationContext[/,./build/webapp]
server.properties not found, using command line or default properties
Opening database: /home/g_snanda/cocoon-2.1.2/build/webapp/WEB-INF/db/cocoondb
HSQLDB server 1.7.1 is running
Use SHUTDOWN to close normally. Use [Ctrl]+[C] to abort abruptly
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:321)
        at java.net.ServerSocket.bind(ServerSocket.java:308)
        at java.net.ServerSocket.bind(ServerSocket.java:266)
        at java.net.ServerSocket.<init>(ServerSocket.java:182)
        at java.net.ServerSocket.<init>(ServerSocket.java:94)
        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:536)
 INFO [main] (DirectSchedulerFactory.java:295) - Quartz scheduler 'Cocoon
 INFO [main] (DirectSchedulerFactory.java:298) - Quartz scheduler version: 1.2.3
 INFO [main] (QuartzScheduler.java:327) - Scheduler Cocoon_$_Fri_May_07_14:48:09_EDT_2004 started.
14:48:10.138 WARN!! Failed to start: SocketListener@0.0.0.0:8888
14:48:10.142 WARN!!
org.mortbay.util.MultiException[java.net.BindException: Address already in use]
        at org.mortbay.http.HttpServer.start(HttpServer.java:624)
        at org.mortbay.jetty.Server.main(Server.java:429)
        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)
[0]=java.net.BindException: Address already in use
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:321)
        at java.net.ServerSocket.bind(ServerSocket.java:308)
        at java.net.ServerSocket.bind(ServerSocket.java:266)
        at java.net.ServerSocket.<init>(ServerSocket.java:182)
        at org.mortbay.util.ThreadedServer.newServerSocket(ThreadedServer.java:317)
        at org.mortbay.util.ThreadedServer.start(ThreadedServer.java:389)
        at org.mortbay.http.SocketListener.start(SocketListener.java:153)
        at org.mortbay.http.HttpServer.start(HttpServer.java:655)
        at org.mortbay.jetty.Server.main(Server.java:429)
        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)
===================================================================

Could anybody let me know what is the proper way of restarting cocoon in my case... I am trying this for the last 3days ...

Eagerly waiting for responses, all responses and suggestions accepted.

Thanks in advance.

Regards
Sam

Re: Problem rebuilding Cocoon 2.1.2

Posted by Geoff Howard <co...@leverageweb.com>.
Actually, from the stack trace, it looks like the bind exception is happening 
during HSQL startup which is historically the leading cause of this in cocoon 
startups.  Make sure that previous runs of Cocoon are shut down before 
restarting.  If you have otherwise ensured that Cocoon shut down (or were using 
the cli the first run through) then it would seem that hsql did not shut down 
cleanly, which was a bug at some point(s) in the past.

My recommendation is to look into cocoon.xconf, find the hsql port (or search 
the list archives - surely it's there) and see if you have a process attached to 
that port and kill the pid.  Please report back what happens so others can 
benefit from your experience.

Geoff


sameer nanda wrote:

> Hello Everybody,
> 
> I am not sure how can I restart Cocoon2.1.2 (or rebuild coccon), after I add a new database or want to create a new table using the already existing HSQL script "cocoondb.script".
> 
> I am trying to run the application from the book Cocoon: Building XML Application, chapter 7, which tell you how to add a new database or connect to the existing HSQL database.
> 
> I have configured my Cocoon2.1.2 from source distribution, as shown below:
> 
> -> downloaded the latest source version and installed using
>  1) build cocoon using "build"
>  2) run cocoon using  "./cocoon.sh cli"
>  3) http://ip-add:8888  points to the welcome page of cocoon
> 
> I add the follwing lines to the cocoondb.script file :
> 
> CREATE TABLE PORTALUSER_TABLE(ID VARCHAR,PASSWORD VARCHAR,COLOR VARCHAR,UNIQUE(ID))
> CREATE TABLE MOREOVER_TABLE(ID INTEGER,NAME VARCHAR,NEWSFEED VARCHAR,UNIQUE(ID))
> 
> INSERT INTO PORTALUSER_TABLE VALUES('cocoon','magic','white')
> INSERT INTO PORTALUSER_TABLE VALUES('matthew','wizard','yellow')
> INSERT INTO MOREOVER_TABLE VALUES(1,'matthew','banking')
> INSERT INTO MOREOVER_TABLE VALUES(2,'cocoon','usa')
> INSERT INTO MOREOVER_TABLE VALUES(3,'cocoon','banking')
> 
> =========================================================
> 
> Now since I am trying to add a new table and insert some values into it, I have to restart my cocoon, this is how I try to restart cocoon using:
> 
> shell> ./coccon.sh cli
> 
> but get an error msg at the end ....
> 
> 
> -------------------- Executing -----------------
> Main Class: org.apache.cocoon.Main
> ------------------------------------------------------------------------
> cocoon 2.1.2
> Copyright (c) 1999-2003 Apache Software Foundation. All rights reserved.
> ------------------------------------------------------------------------
> 
> 
> ERROR   2004-05-07 14:44:35.412 [        ] (): Could not find the configuration file.
> 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.io.FileNotFoundException: The configuration file could not be found.
>         at org.apache.cocoon.bean.CocoonWrapper.getConfigurationFile(CocoonWrapper.java:235)
>         at org.apache.cocoon.bean.CocoonWrapper.initialize(CocoonWrapper.java:142)
>         at org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:119)
>         at org.apache.cocoon.Main.main(Main.java:400)
>         ... 7 more
> 
> =====================================================================
> 
> 
> 
> Now question is that is this the proper way to restart cocoon in my case, or their is something else i need to do . I even tried with:
> 
> shell> ./cocoon.sh servlet
> 
> and this time I get BindException, which is true bcos its already bound to the port 8888. This is how the msg looks like:
> 
> ./cocoon.sh: using ./build/webapp as the webapp directory
> -------------------- Loading --------------------
> Processing repository: ./tools/jetty/lib
> Adding jar: ./tools/jetty/lib/jetty-4.2.9.jar
> Adding jar: ./tools/jetty/lib/servlet-2.3.jar
> Processing repository: ./lib/endorsed
> Adding jar: ./lib/endorsed/xalan-2.5.1.jar
> Adding jar: ./lib/endorsed/xercesImpl-2.5.0.jar
> Adding jar: ./lib/endorsed/xml-apis.jar
> -------------------- Executing -----------------
> Main Class: org.mortbay.jetty.Server
> 14:47:54.865 EVENT  Starting Jetty/4.2.9
> 14:47:55.846 EVENT  Started WebApplicationContext[/,./build/webapp]
> server.properties not found, using command line or default properties
> Opening database: /home/g_snanda/cocoon-2.1.2/build/webapp/WEB-INF/db/cocoondb
> HSQLDB server 1.7.1 is running
> Use SHUTDOWN to close normally. Use [Ctrl]+[C] to abort abruptly
> 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:321)
>         at java.net.ServerSocket.bind(ServerSocket.java:308)
>         at java.net.ServerSocket.bind(ServerSocket.java:266)
>         at java.net.ServerSocket.<init>(ServerSocket.java:182)
>         at java.net.ServerSocket.<init>(ServerSocket.java:94)
>         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:536)
>  INFO [main] (DirectSchedulerFactory.java:295) - Quartz scheduler 'Cocoon
>  INFO [main] (DirectSchedulerFactory.java:298) - Quartz scheduler version: 1.2.3
>  INFO [main] (QuartzScheduler.java:327) - Scheduler Cocoon_$_Fri_May_07_14:48:09_EDT_2004 started.
> 14:48:10.138 WARN!! Failed to start: SocketListener@0.0.0.0:8888
> 14:48:10.142 WARN!!
> org.mortbay.util.MultiException[java.net.BindException: Address already in use]
>         at org.mortbay.http.HttpServer.start(HttpServer.java:624)
>         at org.mortbay.jetty.Server.main(Server.java:429)
>         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)
> [0]=java.net.BindException: Address already in use
>         at java.net.PlainSocketImpl.socketBind(Native Method)
>         at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:321)
>         at java.net.ServerSocket.bind(ServerSocket.java:308)
>         at java.net.ServerSocket.bind(ServerSocket.java:266)
>         at java.net.ServerSocket.<init>(ServerSocket.java:182)
>         at org.mortbay.util.ThreadedServer.newServerSocket(ThreadedServer.java:317)
>         at org.mortbay.util.ThreadedServer.start(ThreadedServer.java:389)
>         at org.mortbay.http.SocketListener.start(SocketListener.java:153)
>         at org.mortbay.http.HttpServer.start(HttpServer.java:655)
>         at org.mortbay.jetty.Server.main(Server.java:429)
>         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)
> ===================================================================
> 
> Could anybody let me know what is the proper way of restarting cocoon in my case... I am trying this for the last 3days ...
> 
> Eagerly waiting for responses, all responses and suggestions accepted.
> 
> Thanks in advance.
> 
> Regards
> Sam


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