Fred,
I am forwarding your bug report to the Jetty support list where it
will receive more attention.
regards,
Jan
-------- Original Message --------
Subject: [JBoss-dev] Jetty addListener/removeListener exception
Date: Tue, 21 Jan 2003 12:12:33 -0500
From: Fred Hartman <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: Jboss-Development (E-mail) <[EMAIL PROTECTED]>
Using JBoss/Jetty 3.0.3. I have an MBean that dynamically adds and removes
SocketListeners from Jetty HttpServer.
It looks like there is a problem in
main/org/mortbay/http/SocketListener.java:
public void setHttpServer(HttpServer server)
{
Code.assertTrue(_server==null || _server==server,
"Cannot share listeners");
_server=server;
}
Should be
public void setHttpServer(HttpServer server)
{
Code.assertTrue(server==null || _server==null || _server==server,
"Cannot share listeners _server:"+_server+"
server:"+server);
_server=server;
}
because in main/org/mortbay/http/HttpServer.java addListener sets to a
non-null value, then removeListener sets to null, therefore do addListener
and then removeListener would always cause the assert to fail,
generating an
exception.
public HttpListener addListener(HttpListener listener)
throws IllegalArgumentException
{
listener.setHttpServer(this); //<<<--sets to non-null
_listeners.add(listener);
addComponent(listener);
return listener;
}
public void removeListener(HttpListener listener)
{
[clip]
_listeners.remove(l);
removeComponent(listener);
if (listener.isStarted())
try{listener.stop();}catch(InterruptedException
e){Code.warning(e);}
listener.setHttpServer(null); //<<<--sets back to null
[clip]
}
The same issue can be found in AJP13Listener.java.
Cheers,
Fred
-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development
-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development
