You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Tim Larson <ti...@keow.org> on 2004/02/04 20:13:28 UTC
Cocoon/Jetty BindException
I did a "cvs up -d" in cocoon-2.1 on January 28, followed by a
"build clean" and "build". When I tried to run this with a full
installation of Jetty (4.2.11) it produced "Address already in use"
errors. It had been working fine for several months before this.
After an upgrade to Jetty 4.2.17 the error remains the same. This is
really puzzling because using the bundled Jetty with "cocoon servlet"
does not produce any errors, and running the full Jetty without Cocoon
also does not produce errors.
Any clues?
--Tim Larson
Re: Cocoon/Jetty BindException
Posted by Tim Larson <ti...@keow.org>.
On Thu, Feb 05, 2004 at 09:02:01AM -0500, Geoff Howard wrote:
> Tim Larson wrote:
> >On Thu, Feb 05, 2004 at 09:46:02AM +0100, Reinhard Poetz wrote:
> >
> >>Are you sure that you have only started one Jetty instance which is
> >>bound to the same port? I've just tried to start Jetty twice and get the
> >>same error.
> >>
> >>Call netstat -a on command line to find out more about your bound ports.
> >
> >
> >Thanks for responding. There is only one instance; I had already checked
> >this with netstat -a. I am going to try another full "cvs up -d, build
> >clean, build" today just to make sure this is a current problem, and I
> >will also try excluding the xindice block just to see if it is involved.
> >I will let you know what happens.
>
> What did you look for with netstat -a? Check out the hsql port and
> xindice port to see if one of them has remained running, or if you
> happen to have another service running on one of their ports, etc. The
> port are IIRC configured in cocoon.xconf
I could not find the xindice port in cocoon.xconf, or anywhere else for
that matter, except via Google. In any case, I disabled xindice and hsqldb
in cocoon.xconf, but the "already bound" behaviour remained.
If I use "cocoon servlet" to start Jetty and Cocoon, wait for it to
finish starting, hit "Control C", wait for it to shutdown, and then
start it back up again with "cocoon servlet" it works fine.
However, if I request a page from Cocoon while it is up (tried
separately with IE5 and with telnet), and then take cocoon down with
"Control C" and start it back up then I get the "already bound" error.
Waiting several minutes before starting it back up solves the problem,
but that is not nice for development.
I suppose I could hack setReuseAddress into Jetty, but could this
problem be indicating that Cocoon is not closing connections properly?
Testing with Windows telnet I send "GET / HTTP/1.0" and get back the
main page followed by "Connection to host lost.", which I think is what
I should get, so I am confused what is happening.
--Tim Larson
Re: Cocoon/Jetty BindException
Posted by Geoff Howard <co...@leverageweb.com>.
Tim Larson wrote:
> On Thu, Feb 05, 2004 at 09:46:02AM +0100, Reinhard Poetz wrote:
>
>>Are you sure that you have only started one Jetty instance which is
>>bound to the same port? I've just tried to start Jetty twice and get the
>>same error.
>>
>>Call netstat -a on command line to find out more about your bound ports.
>
>
> Thanks for responding. There is only one instance; I had already checked
> this with netstat -a. I am going to try another full "cvs up -d, build
> clean, build" today just to make sure this is a current problem, and I
> will also try excluding the xindice block just to see if it is involved.
> I will let you know what happens.
What did you look for with netstat -a? Check out the hsql port and
xindice port to see if one of them has remained running, or if you
happen to have another service running on one of their ports, etc. The
port are IIRC configured in cocoon.xconf
Geoff
Re: Cocoon/Jetty BindException
Posted by Tim Larson <ti...@keow.org>.
On Thu, Feb 05, 2004 at 09:46:02AM +0100, Reinhard Poetz wrote:
> Are you sure that you have only started one Jetty instance which is
> bound to the same port? I've just tried to start Jetty twice and get the
> same error.
>
> Call netstat -a on command line to find out more about your bound ports.
Thanks for responding. There is only one instance; I had already checked
this with netstat -a. I am going to try another full "cvs up -d, build
clean, build" today just to make sure this is a current problem, and I
will also try excluding the xindice block just to see if it is involved.
I will let you know what happens.
--Tim Larson
RE: Cocoon/Jetty BindException
Posted by Reinhard Poetz <re...@apache.org>.
Are you sure that you have only started one Jetty instance which is
bound to the same port? I've just tried to start Jetty twice and get the
same error.
Call netstat -a on command line to find out more about your bound ports.
--
Reinhard
> -----Original Message-----
> From: Tim Larson [mailto:tim@keow.org]
> Sent: Wednesday, February 04, 2004 8:58 PM
> To: dev@cocoon.apache.org
> Subject: Re: Cocoon/Jetty BindException
>
>
> On Wed, Feb 04, 2004 at 02:45:01PM -0500, Geoff Howard wrote:
> > Tim Larson wrote:
> > >I did a "cvs up -d" in cocoon-2.1 on January 28, followed
> by a "build
> > >clean" and "build". When I tried to run this with a full
> > >installation of Jetty (4.2.11) it produced "Address
> already in use"
> > >errors. It had been working fine for several months before this.
> > >
> > >After an upgrade to Jetty 4.2.17 the error remains the
> same. This is
> > >really puzzling because using the bundled Jetty with
> "cocoon servlet"
> > >does not produce any errors, and running the full Jetty without
> > >Cocoon also does not produce errors.
> >
> > That is usually the error you get from the hsql block when
> you try to
> > start up two instances of Cocoon with hsql running in both (on its
> > default port). Maybe now that xindice embedded is also
> running there's
> > an issue there.
> >
> > Can you post the full startup messages here?
>
> Console and Jetty log messages follow:
>
> ==== Begin Console messages ====
> C:\tdl\live\admin>build run-jetty
> Buildfile: build.xml
>
> init:
> [echo] Load properties file from xrs.properties
> [echo] c:/j2sdk1.4.2_03
>
> run-jetty:
>
> run:
> [java] 11:19:52.814 EVENT Checking Resource aliases
> [java] - No configuration file specified, going with the
> default configuration
> [java] - The database configuration file is not
> specified and there was no xindice.db.home property set, so
> Xindice was unable to determine a database location. Database
> will be created relative to the current directory.
> [java] - Database points to C:\tdl\live\prog\jetty\4.2.17\db
> [java] - No configuration file specified, going with the
> default configuration
> [java] - The database configuration file is not
> specified and there was no xindice.db.home property set, so
> Xindice was unable to determine a database location. Database
> will be created relative to the current directory.
> [java] server.properties not found, using command line
> or default properties
> [java] Opening database:
> C:\tdl\live\prog\cocoon\2.1_20031201111307\cocoon.war\WEB-INF\
> db\cocoondb
> [java] HSQLDB server 1.7.1 is running
> [java] Use SHUTDOWN to close normally. Use [Ctrl]+[C] to
> abort abruptly
> [java] Wed Feb 04 11:20:15 EST 2004 Listening for connections ...
> [java] context:
> C:\tdl\live\prog\cocoon\2.1_20031201111307\cocoon.war
> [java] - Quartz scheduler 'Cocoon
> [java] - Quartz scheduler version: 1.2.3
> [java] - Scheduler Cocoon_$_Wed_Feb_04_11:20:21_EST_2004
> started. Terminate batch job (Y/N)? n Press any key to continue . . .
>
> C:\tdl\live\admin>
> ==== End Console messages ====
>
> ==== Begin Jetty log messages ====
> 19:01:18.101 EVENT
> [main]org.mortbay.http.HttpServer.start(HttpServer.java:639)09
> > Starting Jetty/4.2.17 19:01:18.111 EVENT
> [main]org.mortbay.http.HttpServer.start(HttpServer.java:654)09
> > Started org.mortbay.http.NCSARequestLog@b0bad7
> 19:01:18.562 EVENT
> [main]org.mortbay.http.HttpContext.start(HttpContext.java:1901
> )11> Started
> WebApplicationContext[/xrs,c:/tdl/live/repo/cocoon/cocoon-2.1/
build/webapp]
> 19:01:19.063 WARN!!
> [main]org.mortbay.http.HttpContext.getTempDirectory(HttpContex
> t.java:1255)17> Delete existing temp dir C:\Documents and
> Settings\tdlarson\Local Settings\Temp\Jetty__8080__xrs for
> WebApplicationContext[/xrs,c:/tdl/live/repo/cocoon/cocoon-2.1/
build/webapp]
> 19:01:43.848 WARN!!
> [main]org.mortbay.util.ThreadedServer.start(ThreadedServer.jav
> a:430)11> Failed to start: SocketListener@0.0.0.0:8080
> 19:01:43.858 EVENT
> [main]org.mortbay.http.SunJsseListener.createFactory(SunJsseLi
> stener.java:168)14>
> jetty.ssl.keystore=c:/tdl/live/conf/jetty/jetty-demokeystore
> 19:01:43.858 EVENT
> [main]org.mortbay.http.SunJsseListener.createFactory(SunJsseLi
> stener.java:172)14> jetty.ssl.password=******** 19:01:43.858
> EVENT
> [main]org.mortbay.http.SunJsseListener.createFactory(SunJsseLi
> stener.java:178)14> jetty.ssl.keypassword=****** 19:01:43.858
> EVENT
> [main]org.mortbay.http.SunJsseListener.createFactory(SunJsseLi
> stener.java:183)14> jetty.ssl.keystore.type=jks 19:01:43.858
> EVENT
> [main]org.mortbay.http.SunJsseListener.createFactory(SunJsseLi
> stener.java:208)14> jetty.ssl.keystore.provider.name=[DEFAULT]
> 19:01:43.988 EVENT
> [main]org.mortbay.http.SunJsseListener.createFactory(SunJsseLi
> stener.java:231)14>
> SSLServerSocketFactory=com.sun.net.ssl.internal.ssl.SSLServerS
> ocketFactoryImpl@82c23d
> 19:01:44.028 EVENT
> [main]org.mortbay.http.JsseListener.newServerSocket(JsseListen
> er.java:187)13> JsseListener.needClientAuth=false
> 19:01:44.049 EVENT
> [main]org.mortbay.http.SocketListener.start(SocketListener.jav
> a:155)10> Started SocketListener on 0.0.0.0:8443 19:01:44.049
> WARN!! [main]org.mortbay.jetty.Server.main(Server.java:434)08>
> org.mortbay.util.MultiException[java.net.BindException:
> Address already in use: JVM_Bind]
> at org.mortbay.http.HttpServer.start(HttpServer.java:640)
> at org.mortbay.jetty.Server.main(Server.java:429)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
odAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at org.mortbay.start.Main.invokeMain(Main.java:153)
> at org.mortbay.start.Main.start(Main.java:483)
> at org.mortbay.start.Main.main(Main.java:91)
> [0]=java.net.BindException: Address already in use: JVM_Bind
> at java.net.PlainSocketImpl.socketBind(Native Method)
> at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
> at java.net.ServerSocket.bind(ServerSocket.java:318)
> at java.net.ServerSocket.<init>(ServerSocket.java:185)
> at
> org.mortbay.util.ThreadedServer.newServerSocket(ThreadedServer
> .java:317)
> at org.mortbay.util.ThreadedServer.open(ThreadedServer.java:390)
> at
> org.mortbay.util.ThreadedServer.start(ThreadedServer.java:419)
> at
> org.mortbay.http.SocketListener.start(SocketListener.java:154)
> at org.mortbay.http.HttpServer.start(HttpServer.java:671)
> at org.mortbay.jetty.Server.main(Server.java:429)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> orImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
odAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at org.mortbay.start.Main.invokeMain(Main.java:153)
> at org.mortbay.start.Main.start(Main.java:483)
> at org.mortbay.start.Main.main(Main.java:91)
>
> 19:03:56.910 EVENT
> [Shutdown]org.mortbay.jetty.Server$1.run(Server.java:451)01>
> Shutdown hook executing 19:03:56.910 EVENT [Acceptor [SSL:
> ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8443]]]org.
mortbay.util.ThreadedServer$Acceptor.run> (ThreadedServer.java:557)01>
Stopping Acceptor [SSL:
> ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8443]]
> 19:03:56.910 EVENT
> [Shutdown]org.mortbay.http.SocketListener.stop(SocketListener.
> java:163)04> Stopped SocketListener on 0.0.0.0:8443
> 19:03:57.070 EVENT
> [Shutdown]org.mortbay.http.HttpContext.stop(HttpContext.java:1
> 994)07> Stopped
> WebApplicationContext[/xrs,c:/tdl/live/repo/cocoon/cocoon-2.1/
build/webapp]
> 19:03:57.070 EVENT
> [Shutdown]org.mortbay.http.HttpServer.stop(HttpServer.java:745
> )03> Stopped org.mortbay.http.NCSARequestLog@b0bad7
> 19:03:57.070 EVENT
> [Shutdown]org.mortbay.http.HttpServer.stop(HttpServer.java:748
> )03> Stopped org.mortbay.jetty.Server@147c5fc ==== End Jetty
> log messages ====
>
> --Tim Larson
>
Re: Cocoon/Jetty BindException
Posted by Tim Larson <ti...@keow.org>.
On Wed, Feb 04, 2004 at 02:45:01PM -0500, Geoff Howard wrote:
> Tim Larson wrote:
> >I did a "cvs up -d" in cocoon-2.1 on January 28, followed by a
> >"build clean" and "build". When I tried to run this with a full
> >installation of Jetty (4.2.11) it produced "Address already in use"
> >errors. It had been working fine for several months before this.
> >
> >After an upgrade to Jetty 4.2.17 the error remains the same. This is
> >really puzzling because using the bundled Jetty with "cocoon servlet"
> >does not produce any errors, and running the full Jetty without Cocoon
> >also does not produce errors.
>
> That is usually the error you get from the hsql block when you try to
> start up two instances of Cocoon with hsql running in both (on its
> default port). Maybe now that xindice embedded is also running there's
> an issue there.
>
> Can you post the full startup messages here?
Console and Jetty log messages follow:
==== Begin Console messages ====
C:\tdl\live\admin>build run-jetty
Buildfile: build.xml
init:
[echo] Load properties file from xrs.properties
[echo] c:/j2sdk1.4.2_03
run-jetty:
run:
[java] 11:19:52.814 EVENT Checking Resource aliases
[java] - No configuration file specified, going with the default configuration
[java] - The database configuration file is not specified and there was no xindice.db.home property set, so Xindice was
unable to determine a database location. Database will be created relative to the current directory.
[java] - Database points to C:\tdl\live\prog\jetty\4.2.17\db
[java] - No configuration file specified, going with the default configuration
[java] - The database configuration file is not specified and there was no xindice.db.home property set, so Xindice was
unable to determine a database location. Database will be created relative to the current directory.
[java] server.properties not found, using command line or default properties
[java] Opening database: C:\tdl\live\prog\cocoon\2.1_20031201111307\cocoon.war\WEB-INF\db\cocoondb
[java] HSQLDB server 1.7.1 is running
[java] Use SHUTDOWN to close normally. Use [Ctrl]+[C] to abort abruptly
[java] Wed Feb 04 11:20:15 EST 2004 Listening for connections ...
[java] context: C:\tdl\live\prog\cocoon\2.1_20031201111307\cocoon.war
[java] - Quartz scheduler 'Cocoon
[java] - Quartz scheduler version: 1.2.3
[java] - Scheduler Cocoon_$_Wed_Feb_04_11:20:21_EST_2004 started.
Terminate batch job (Y/N)? n
Press any key to continue . . .
C:\tdl\live\admin>
==== End Console messages ====
==== Begin Jetty log messages ====
19:01:18.101 EVENT [main]org.mortbay.http.HttpServer.start(HttpServer.java:639)09> Starting Jetty/4.2.17
19:01:18.111 EVENT [main]org.mortbay.http.HttpServer.start(HttpServer.java:654)09> Started org.mortbay.http.NCSARequestLog@b0bad7
19:01:18.562 EVENT [main]org.mortbay.http.HttpContext.start(HttpContext.java:1901)11> Started WebApplicationContext[/xrs,c:/tdl/live/repo/cocoon/cocoon-2.1/build/webapp]
19:01:19.063 WARN!! [main]org.mortbay.http.HttpContext.getTempDirectory(HttpContext.java:1255)17> Delete existing temp dir C:\Documents and Settings\tdlarson\Local Settings\Temp\Jetty__8080__xrs for WebApplicationContext[/xrs,c:/tdl/live/repo/cocoon/cocoon-2.1/build/webapp]
19:01:43.848 WARN!! [main]org.mortbay.util.ThreadedServer.start(ThreadedServer.java:430)11> Failed to start: SocketListener@0.0.0.0:8080
19:01:43.858 EVENT [main]org.mortbay.http.SunJsseListener.createFactory(SunJsseListener.java:168)14> jetty.ssl.keystore=c:/tdl/live/conf/jetty/jetty-demokeystore
19:01:43.858 EVENT [main]org.mortbay.http.SunJsseListener.createFactory(SunJsseListener.java:172)14> jetty.ssl.password=********
19:01:43.858 EVENT [main]org.mortbay.http.SunJsseListener.createFactory(SunJsseListener.java:178)14> jetty.ssl.keypassword=******
19:01:43.858 EVENT [main]org.mortbay.http.SunJsseListener.createFactory(SunJsseListener.java:183)14> jetty.ssl.keystore.type=jks
19:01:43.858 EVENT [main]org.mortbay.http.SunJsseListener.createFactory(SunJsseListener.java:208)14> jetty.ssl.keystore.provider.name=[DEFAULT]
19:01:43.988 EVENT [main]org.mortbay.http.SunJsseListener.createFactory(SunJsseListener.java:231)14> SSLServerSocketFactory=com.sun.net.ssl.internal.ssl.SSLServerSocketFactoryImpl@82c23d
19:01:44.028 EVENT [main]org.mortbay.http.JsseListener.newServerSocket(JsseListener.java:187)13> JsseListener.needClientAuth=false
19:01:44.049 EVENT [main]org.mortbay.http.SocketListener.start(SocketListener.java:155)10> Started SocketListener on 0.0.0.0:8443
19:01:44.049 WARN!! [main]org.mortbay.jetty.Server.main(Server.java:434)08>
org.mortbay.util.MultiException[java.net.BindException: Address already in use: JVM_Bind]
at org.mortbay.http.HttpServer.start(HttpServer.java:640)
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 org.mortbay.start.Main.invokeMain(Main.java:153)
at org.mortbay.start.Main.start(Main.java:483)
at org.mortbay.start.Main.main(Main.java:91)
[0]=java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
at java.net.ServerSocket.bind(ServerSocket.java:318)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at org.mortbay.util.ThreadedServer.newServerSocket(ThreadedServer.java:317)
at org.mortbay.util.ThreadedServer.open(ThreadedServer.java:390)
at org.mortbay.util.ThreadedServer.start(ThreadedServer.java:419)
at org.mortbay.http.SocketListener.start(SocketListener.java:154)
at org.mortbay.http.HttpServer.start(HttpServer.java:671)
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 org.mortbay.start.Main.invokeMain(Main.java:153)
at org.mortbay.start.Main.start(Main.java:483)
at org.mortbay.start.Main.main(Main.java:91)
19:03:56.910 EVENT [Shutdown]org.mortbay.jetty.Server$1.run(Server.java:451)01> Shutdown hook executing
19:03:56.910 EVENT [Acceptor [SSL: ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8443]]]org.mortbay.util.ThreadedServer$Acceptor.run(ThreadedServer.java:557)01> Stopping Acceptor [SSL: ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8443]]
19:03:56.910 EVENT [Shutdown]org.mortbay.http.SocketListener.stop(SocketListener.java:163)04> Stopped SocketListener on 0.0.0.0:8443
19:03:57.070 EVENT [Shutdown]org.mortbay.http.HttpContext.stop(HttpContext.java:1994)07> Stopped WebApplicationContext[/xrs,c:/tdl/live/repo/cocoon/cocoon-2.1/build/webapp]
19:03:57.070 EVENT [Shutdown]org.mortbay.http.HttpServer.stop(HttpServer.java:745)03> Stopped org.mortbay.http.NCSARequestLog@b0bad7
19:03:57.070 EVENT [Shutdown]org.mortbay.http.HttpServer.stop(HttpServer.java:748)03> Stopped org.mortbay.jetty.Server@147c5fc
==== End Jetty log messages ====
--Tim Larson
Re: Cocoon/Jetty BindException
Posted by Geoff Howard <co...@leverageweb.com>.
Tim Larson wrote:
> I did a "cvs up -d" in cocoon-2.1 on January 28, followed by a
> "build clean" and "build". When I tried to run this with a full
> installation of Jetty (4.2.11) it produced "Address already in use"
> errors. It had been working fine for several months before this.
>
> After an upgrade to Jetty 4.2.17 the error remains the same. This is
> really puzzling because using the bundled Jetty with "cocoon servlet"
> does not produce any errors, and running the full Jetty without Cocoon
> also does not produce errors.
That is usually the error you get from the hsql block when you try to
start up two instances of Cocoon with hsql running in both (on its
default port). Maybe now that xindice embedded is also running there's
an issue there.
Can you post the full startup messages here?
Geoff