You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Benson Margulies <bi...@basistech.com> on 2007/10/18 18:39:26 UTC

Current snapshot still won't shut down jetty

I picked up the 2.0.3 most recent snapshot (20071017) and I still have
Jetty refusing to go away.

Before I try to create a test case for this in systests, can anyone
offer some diagnostic strategy that might narrow down the problem?

Here's my Spring config for the Jetty handlers. I add some servlets via
API to the webapp context in my code. I can't see any way to remove
them.

<httpj:engine-factory bus="cxf">
  <httpj:engine port="8808">
   <httpj:handlers>
    <bean class="org.mortbay.jetty.handler.RequestLogHandler">
      <property name="requestLog">
        <bean class="org.mortbay.jetty.NCSARequestLog">
         <property name="filename" value="jetty.log"/>
        </bean>
      </property>
    </bean>
    <bean class="org.mortbay.jetty.webapp.WebAppContext">
      <constructor-arg value="${jsunitPathname}"/>
      <constructor-arg value="/jsunit"/>
    </bean>
    <bean class="org.mortbay.jetty.handler.ContextHandler">
     <property name="contextPath" value="/${staticResourceBase}" />
     <property name="handler">
      <bean class="org.mortbay.jetty.handler.ResourceHandler">
       <property name="baseResource">
        <bean class="org.mortbay.resource.FileResource">
         <constructor-arg value="${staticResourceURL}" />
        </bean>
        </property>
      </bean>
     </property>
    </bean>
   </httpj:handlers>
  </httpj:engine>
 </httpj:engine-fa

RE: Current snapshot still won't shut down jetty

Posted by Benson Margulies <bi...@basistech.com>.
Oh, what fun. The NCSARequestLog in jetty creates a non-daemon timer.

> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Friday, October 19, 2007 12:38 PM
> To: cxf-dev@incubator.apache.org
> Cc: Benson Margulies
> Subject: Re: Current snapshot still won't shut down jetty
> 
> 
> Hmm...  a Timer that is created without specifying that it is a daemon
> would definitely cause an issue.   I just grepped through our code and
> the only place (outside of the tests) that we create a Timer is in the
> RMManager, and that is set to daemon properly.
> 
> If you can, you might want to put a breakpoint on the Timer
constructors
> to see where the first timer is created.   Timer-0 would be the very
> first one created in the JVM.
> 
> Dan
> 
> 
> On Thursday 18 October 2007, Benson Margulies wrote:
> > Current state, the process doesn't exit. The only threads are a
> > Timer-0 thread and a DestroyJavaVM thread. The rest of the jetty
> > threads are gone. This might not have anything to do with CXF /
jetty.
> >
> > > -----Original Message-----
> > > From: Willem2 [mailto:ning.jiang@iona.com]
> > > Sent: Thursday, October 18, 2007 7:30 PM
> > > To: cxf-dev@incubator.apache.org
> > > Subject: RE: Current snapshot still won't shut down jetty
> > >
> > >
> > > Hi Benson,
> > >
> > > Do you call the bus.shutdown in your application?
> > > If your client is not in the same JVM with the JettyServer , it
> > > should work.
> > > It is on my to do list to search for the SO_REUSEADDR solution.
> > >
> > > Willem.
> > >
> > > bmargulies wrote:
> > > > My own application.
> > > >
> > > > For your problem, isn't this just our old friend SO_REUSEADDR,
and
> >
> > isn't
> >
> > > > there a way to turn that on from Java?
> > > >
> > > >> -----Original Message-----
> > > >> From: Daniel Kulp [mailto:dkulp@apache.org]
> > > >> Sent: Thursday, October 18, 2007 12:49 PM
> > > >> To: cxf-dev@incubator.apache.org
> > > >> Cc: Benson Margulies
> > > >> Subject: Re: Current snapshot still won't shut down jetty
> > > >>
> > > >>
> > > >> Is this in the system/unit tests or in your own application?
> > > >>
> > > >> If it's in the sys/unit tests, it won't.   I explicitely
disabled
> >
> > it
> >
> > > >> cause on Linux, if you try to shutdown a Jetty instance that
has
> > > >> keep-alives open to connections in the same VM, it doesn't
close
> >
> > them
> >
> > > >> and it blocks the port from being re-opened.
> > > >>
> > > >> Dan
> > > >>
> > > >> On Thursday 18 October 2007, Benson Margulies wrote:
> > > >> > I picked up the 2.0.3 most recent snapshot (20071017) and I
> > > >> > still
> > > >
> > > > have
> > > >
> > > >> > Jetty refusing to go away.
> > > >> >
> > > >> > Before I try to create a test case for this in systests, can
> >
> > anyone
> >
> > > >> > offer some diagnostic strategy that might narrow down the
> >
> > problem?
> >
> > > >> > Here's my Spring config for the Jetty handlers. I add some
> >
> > servlets
> >
> > > >> > via API to the webapp context in my code. I can't see any way
> > > >> > to remove them.
> > > >> >
> > > >> > <httpj:engine-factory bus="cxf">
> > > >> >   <httpj:engine port="8808">
> > > >> >    <httpj:handlers>
> > > >> >     <bean
class="org.mortbay.jetty.handler.RequestLogHandler">
> > > >> >       <property name="requestLog">
> > > >> >         <bean class="org.mortbay.jetty.NCSARequestLog">
> > > >> >          <property name="filename" value="jetty.log"/>
> > > >> >         </bean>
> > > >> >       </property>
> > > >> >     </bean>
> > > >> >     <bean class="org.mortbay.jetty.webapp.WebAppContext">
> > > >> >       <constructor-arg value="${jsunitPathname}"/>
> > > >> >       <constructor-arg value="/jsunit"/>
> > > >> >     </bean>
> > > >> >     <bean class="org.mortbay.jetty.handler.ContextHandler">
> > > >> >      <property name="contextPath"
> > > >> > value="/${staticResourceBase}"
> >
> > />
> >
> > > >> >      <property name="handler">
> > > >> >       <bean
class="org.mortbay.jetty.handler.ResourceHandler">
> > > >> >        <property name="baseResource">
> > > >> >         <bean class="org.mortbay.resource.FileResource">
> > > >> >          <constructor-arg value="${staticResourceURL}" />
> > > >> >         </bean>
> > > >> >         </property>
> > > >> >       </bean>
> > > >> >      </property>
> > > >> >     </bean>
> > > >> >    </httpj:handlers>
> > > >> >   </httpj:engine>
> > > >> >  </httpj:engine-fa
> > > >>
> > > >> --
> > > >> J. Daniel Kulp
> > > >> Principal Engineer
> > > >> IONA
> > > >> P: 781-902-8727    C: 508-380-7194
> > > >> daniel.kulp@iona.com
> > > >> http://www.dankulp.com/blog
> > >
> > > --
> > > View this message in context:
> > > http://www.nabble.com/Current-snapshot-
> > > still-won%27t-shut-down-jetty-tf4648231.html#a13285693
> > > Sent from the cxf-dev mailing list archive at Nabble.com.
> 
> 
> 
> --
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog

Re: Current snapshot still won't shut down jetty

Posted by Daniel Kulp <dk...@apache.org>.
Hmm...  a Timer that is created without specifying that it is a daemon 
would definitely cause an issue.   I just grepped through our code and 
the only place (outside of the tests) that we create a Timer is in the 
RMManager, and that is set to daemon properly. 

If you can, you might want to put a breakpoint on the Timer constructors 
to see where the first timer is created.   Timer-0 would be the very 
first one created in the JVM.

Dan


On Thursday 18 October 2007, Benson Margulies wrote:
> Current state, the process doesn't exit. The only threads are a
> Timer-0 thread and a DestroyJavaVM thread. The rest of the jetty
> threads are gone. This might not have anything to do with CXF / jetty.
>
> > -----Original Message-----
> > From: Willem2 [mailto:ning.jiang@iona.com]
> > Sent: Thursday, October 18, 2007 7:30 PM
> > To: cxf-dev@incubator.apache.org
> > Subject: RE: Current snapshot still won't shut down jetty
> >
> >
> > Hi Benson,
> >
> > Do you call the bus.shutdown in your application?
> > If your client is not in the same JVM with the JettyServer , it
> > should work.
> > It is on my to do list to search for the SO_REUSEADDR solution.
> >
> > Willem.
> >
> > bmargulies wrote:
> > > My own application.
> > >
> > > For your problem, isn't this just our old friend SO_REUSEADDR, and
>
> isn't
>
> > > there a way to turn that on from Java?
> > >
> > >> -----Original Message-----
> > >> From: Daniel Kulp [mailto:dkulp@apache.org]
> > >> Sent: Thursday, October 18, 2007 12:49 PM
> > >> To: cxf-dev@incubator.apache.org
> > >> Cc: Benson Margulies
> > >> Subject: Re: Current snapshot still won't shut down jetty
> > >>
> > >>
> > >> Is this in the system/unit tests or in your own application?
> > >>
> > >> If it's in the sys/unit tests, it won't.   I explicitely disabled
>
> it
>
> > >> cause on Linux, if you try to shutdown a Jetty instance that has
> > >> keep-alives open to connections in the same VM, it doesn't close
>
> them
>
> > >> and it blocks the port from being re-opened.
> > >>
> > >> Dan
> > >>
> > >> On Thursday 18 October 2007, Benson Margulies wrote:
> > >> > I picked up the 2.0.3 most recent snapshot (20071017) and I
> > >> > still
> > >
> > > have
> > >
> > >> > Jetty refusing to go away.
> > >> >
> > >> > Before I try to create a test case for this in systests, can
>
> anyone
>
> > >> > offer some diagnostic strategy that might narrow down the
>
> problem?
>
> > >> > Here's my Spring config for the Jetty handlers. I add some
>
> servlets
>
> > >> > via API to the webapp context in my code. I can't see any way
> > >> > to remove them.
> > >> >
> > >> > <httpj:engine-factory bus="cxf">
> > >> >   <httpj:engine port="8808">
> > >> >    <httpj:handlers>
> > >> >     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
> > >> >       <property name="requestLog">
> > >> >         <bean class="org.mortbay.jetty.NCSARequestLog">
> > >> >          <property name="filename" value="jetty.log"/>
> > >> >         </bean>
> > >> >       </property>
> > >> >     </bean>
> > >> >     <bean class="org.mortbay.jetty.webapp.WebAppContext">
> > >> >       <constructor-arg value="${jsunitPathname}"/>
> > >> >       <constructor-arg value="/jsunit"/>
> > >> >     </bean>
> > >> >     <bean class="org.mortbay.jetty.handler.ContextHandler">
> > >> >      <property name="contextPath"
> > >> > value="/${staticResourceBase}"
>
> />
>
> > >> >      <property name="handler">
> > >> >       <bean class="org.mortbay.jetty.handler.ResourceHandler">
> > >> >        <property name="baseResource">
> > >> >         <bean class="org.mortbay.resource.FileResource">
> > >> >          <constructor-arg value="${staticResourceURL}" />
> > >> >         </bean>
> > >> >         </property>
> > >> >       </bean>
> > >> >      </property>
> > >> >     </bean>
> > >> >    </httpj:handlers>
> > >> >   </httpj:engine>
> > >> >  </httpj:engine-fa
> > >>
> > >> --
> > >> J. Daniel Kulp
> > >> Principal Engineer
> > >> IONA
> > >> P: 781-902-8727    C: 508-380-7194
> > >> daniel.kulp@iona.com
> > >> http://www.dankulp.com/blog
> >
> > --
> > View this message in context:
> > http://www.nabble.com/Current-snapshot-
> > still-won%27t-shut-down-jetty-tf4648231.html#a13285693
> > Sent from the cxf-dev mailing list archive at Nabble.com.



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: Current snapshot still won't shut down jetty

Posted by Willem Jiang <ni...@iona.com>.
OK, if you get it, just rang the bell.
I am always like to put the Jetty's fire out :).

Willem.

Benson Margulies wrote:
> Just to be clear, I can't yet produce an isolated test case that fails
> to exit.
>
>   
>> -----Original Message-----
>> From: Willem Jiang [mailto:ning.jiang@iona.com]
>> Sent: Thursday, October 18, 2007 9:32 PM
>> To: cxf-dev@incubator.apache.org
>> Subject: Re: Current snapshot still won't shut down jetty
>>
>> Hi Benson,
>>
>> I will look at this issue.
>>
>> Willem.
>>
>> Benson Margulies wrote:
>>     
>>> Willem,
>>>
>>> Should the process refuse to exit even if I haven't called
>>>       
> bus.shutdown?
>   
>>> Anyway, I just entered CXF-1120 in the neighborhood, which is a
>>> variation in which the server tries to start a second time and gets
>>>       
> a
>   
>>> bind error.
>>>
>>> I'll go try an explicit shutdown.
>>>
>>> --benson
>>>
>>>
>>>
>>>       
>>>> -----Original Message-----
>>>> From: Willem2 [mailto:ning.jiang@iona.com]
>>>> Sent: Thursday, October 18, 2007 7:30 PM
>>>> To: cxf-dev@incubator.apache.org
>>>> Subject: RE: Current snapshot still won't shut down jetty
>>>>
>>>>
>>>> Hi Benson,
>>>>
>>>> Do you call the bus.shutdown in your application?
>>>> If your client is not in the same JVM with the JettyServer , it
>>>>         
> should
>   
>>>> work.
>>>> It is on my to do list to search for the SO_REUSEADDR solution.
>>>>
>>>> Willem.
>>>>
>>>> bmargulies wrote:
>>>>
>>>>         
>>>>> My own application.
>>>>>
>>>>> For your problem, isn't this just our old friend SO_REUSEADDR, and
>>>>>
>>>>>           
>>> isn't
>>>
>>>       
>>>>> there a way to turn that on from Java?
>>>>>
>>>>>
>>>>>           
>>>>>> -----Original Message-----
>>>>>> From: Daniel Kulp [mailto:dkulp@apache.org]
>>>>>> Sent: Thursday, October 18, 2007 12:49 PM
>>>>>> To: cxf-dev@incubator.apache.org
>>>>>> Cc: Benson Margulies
>>>>>> Subject: Re: Current snapshot still won't shut down jetty
>>>>>>
>>>>>>
>>>>>> Is this in the system/unit tests or in your own application?
>>>>>>
>>>>>> If it's in the sys/unit tests, it won't.   I explicitely disabled
>>>>>>
>>>>>>             
>>> it
>>>
>>>       
>>>>>> cause on Linux, if you try to shutdown a Jetty instance that has
>>>>>> keep-alives open to connections in the same VM, it doesn't close
>>>>>>
>>>>>>             
>>> them
>>>
>>>       
>>>>>> and it blocks the port from being re-opened.
>>>>>>
>>>>>> Dan
>>>>>>
>>>>>> On Thursday 18 October 2007, Benson Margulies wrote:
>>>>>>
>>>>>>             
>>>>>>> I picked up the 2.0.3 most recent snapshot (20071017) and I
>>>>>>>               
> still
>   
>>>>> have
>>>>>
>>>>>           
>>>>>>> Jetty refusing to go away.
>>>>>>>
>>>>>>> Before I try to create a test case for this in systests, can
>>>>>>>
>>>>>>>               
>>> anyone
>>>
>>>       
>>>>>>> offer some diagnostic strategy that might narrow down the
>>>>>>>
>>>>>>>               
>>> problem?
>>>
>>>       
>>>>>>> Here's my Spring config for the Jetty handlers. I add some
>>>>>>>
>>>>>>>               
>>> servlets
>>>
>>>       
>>>>>>> via API to the webapp context in my code. I can't see any way to
>>>>>>> remove them.
>>>>>>>
>>>>>>> <httpj:engine-factory bus="cxf">
>>>>>>>   <httpj:engine port="8808">
>>>>>>>    <httpj:handlers>
>>>>>>>     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
>>>>>>>       <property name="requestLog">
>>>>>>>         <bean class="org.mortbay.jetty.NCSARequestLog">
>>>>>>>          <property name="filename" value="jetty.log"/>
>>>>>>>         </bean>
>>>>>>>       </property>
>>>>>>>     </bean>
>>>>>>>     <bean class="org.mortbay.jetty.webapp.WebAppContext">
>>>>>>>       <constructor-arg value="${jsunitPathname}"/>
>>>>>>>       <constructor-arg value="/jsunit"/>
>>>>>>>     </bean>
>>>>>>>     <bean class="org.mortbay.jetty.handler.ContextHandler">
>>>>>>>      <property name="contextPath" value="/${staticResourceBase}"
>>>>>>>
>>>>>>>               
>>> />
>>>
>>>       
>>>>>>>      <property name="handler">
>>>>>>>       <bean class="org.mortbay.jetty.handler.ResourceHandler">
>>>>>>>        <property name="baseResource">
>>>>>>>         <bean class="org.mortbay.resource.FileResource">
>>>>>>>          <constructor-arg value="${staticResourceURL}" />
>>>>>>>         </bean>
>>>>>>>         </property>
>>>>>>>       </bean>
>>>>>>>      </property>
>>>>>>>     </bean>
>>>>>>>    </httpj:handlers>
>>>>>>>   </httpj:engine>
>>>>>>>  </httpj:engine-fa
>>>>>>>
>>>>>>>               
>>>>>> --
>>>>>> J. Daniel Kulp
>>>>>> Principal Engineer
>>>>>> IONA
>>>>>> P: 781-902-8727    C: 508-380-7194
>>>>>> daniel.kulp@iona.com
>>>>>> http://www.dankulp.com/blog
>>>>>>
>>>>>>             
>>>> --
>>>> View this message in context:
>>>>         
> http://www.nabble.com/Current-snapshot-
>   
>>>> still-won%27t-shut-down-jetty-tf4648231.html#a13285693
>>>> Sent from the cxf-dev mailing list archive at Nabble.com.
>>>>
>>>>         
>>>       
>
>   

RE: Current snapshot still won't shut down jetty

Posted by Benson Margulies <bi...@basistech.com>.
Just to be clear, I can't yet produce an isolated test case that fails
to exit.

> -----Original Message-----
> From: Willem Jiang [mailto:ning.jiang@iona.com]
> Sent: Thursday, October 18, 2007 9:32 PM
> To: cxf-dev@incubator.apache.org
> Subject: Re: Current snapshot still won't shut down jetty
> 
> Hi Benson,
> 
> I will look at this issue.
> 
> Willem.
> 
> Benson Margulies wrote:
> > Willem,
> >
> > Should the process refuse to exit even if I haven't called
bus.shutdown?
> >
> > Anyway, I just entered CXF-1120 in the neighborhood, which is a
> > variation in which the server tries to start a second time and gets
a
> > bind error.
> >
> > I'll go try an explicit shutdown.
> >
> > --benson
> >
> >
> >
> >> -----Original Message-----
> >> From: Willem2 [mailto:ning.jiang@iona.com]
> >> Sent: Thursday, October 18, 2007 7:30 PM
> >> To: cxf-dev@incubator.apache.org
> >> Subject: RE: Current snapshot still won't shut down jetty
> >>
> >>
> >> Hi Benson,
> >>
> >> Do you call the bus.shutdown in your application?
> >> If your client is not in the same JVM with the JettyServer , it
should
> >> work.
> >> It is on my to do list to search for the SO_REUSEADDR solution.
> >>
> >> Willem.
> >>
> >> bmargulies wrote:
> >>
> >>> My own application.
> >>>
> >>> For your problem, isn't this just our old friend SO_REUSEADDR, and
> >>>
> > isn't
> >
> >>> there a way to turn that on from Java?
> >>>
> >>>
> >>>> -----Original Message-----
> >>>> From: Daniel Kulp [mailto:dkulp@apache.org]
> >>>> Sent: Thursday, October 18, 2007 12:49 PM
> >>>> To: cxf-dev@incubator.apache.org
> >>>> Cc: Benson Margulies
> >>>> Subject: Re: Current snapshot still won't shut down jetty
> >>>>
> >>>>
> >>>> Is this in the system/unit tests or in your own application?
> >>>>
> >>>> If it's in the sys/unit tests, it won't.   I explicitely disabled
> >>>>
> > it
> >
> >>>> cause on Linux, if you try to shutdown a Jetty instance that has
> >>>> keep-alives open to connections in the same VM, it doesn't close
> >>>>
> > them
> >
> >>>> and it blocks the port from being re-opened.
> >>>>
> >>>> Dan
> >>>>
> >>>> On Thursday 18 October 2007, Benson Margulies wrote:
> >>>>
> >>>>> I picked up the 2.0.3 most recent snapshot (20071017) and I
still
> >>>>>
> >>> have
> >>>
> >>>>> Jetty refusing to go away.
> >>>>>
> >>>>> Before I try to create a test case for this in systests, can
> >>>>>
> > anyone
> >
> >>>>> offer some diagnostic strategy that might narrow down the
> >>>>>
> > problem?
> >
> >>>>> Here's my Spring config for the Jetty handlers. I add some
> >>>>>
> > servlets
> >
> >>>>> via API to the webapp context in my code. I can't see any way to
> >>>>> remove them.
> >>>>>
> >>>>> <httpj:engine-factory bus="cxf">
> >>>>>   <httpj:engine port="8808">
> >>>>>    <httpj:handlers>
> >>>>>     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
> >>>>>       <property name="requestLog">
> >>>>>         <bean class="org.mortbay.jetty.NCSARequestLog">
> >>>>>          <property name="filename" value="jetty.log"/>
> >>>>>         </bean>
> >>>>>       </property>
> >>>>>     </bean>
> >>>>>     <bean class="org.mortbay.jetty.webapp.WebAppContext">
> >>>>>       <constructor-arg value="${jsunitPathname}"/>
> >>>>>       <constructor-arg value="/jsunit"/>
> >>>>>     </bean>
> >>>>>     <bean class="org.mortbay.jetty.handler.ContextHandler">
> >>>>>      <property name="contextPath" value="/${staticResourceBase}"
> >>>>>
> > />
> >
> >>>>>      <property name="handler">
> >>>>>       <bean class="org.mortbay.jetty.handler.ResourceHandler">
> >>>>>        <property name="baseResource">
> >>>>>         <bean class="org.mortbay.resource.FileResource">
> >>>>>          <constructor-arg value="${staticResourceURL}" />
> >>>>>         </bean>
> >>>>>         </property>
> >>>>>       </bean>
> >>>>>      </property>
> >>>>>     </bean>
> >>>>>    </httpj:handlers>
> >>>>>   </httpj:engine>
> >>>>>  </httpj:engine-fa
> >>>>>
> >>>>
> >>>> --
> >>>> J. Daniel Kulp
> >>>> Principal Engineer
> >>>> IONA
> >>>> P: 781-902-8727    C: 508-380-7194
> >>>> daniel.kulp@iona.com
> >>>> http://www.dankulp.com/blog
> >>>>
> >>>
> >> --
> >> View this message in context:
http://www.nabble.com/Current-snapshot-
> >> still-won%27t-shut-down-jetty-tf4648231.html#a13285693
> >> Sent from the cxf-dev mailing list archive at Nabble.com.
> >>
> >
> >

Re: Current snapshot still won't shut down jetty

Posted by Willem Jiang <ni...@iona.com>.
Hi Benson,

I will look at this issue.

Willem.

Benson Margulies wrote:
> Willem,
>
> Should the process refuse to exit even if I haven't called bus.shutdown?
>
> Anyway, I just entered CXF-1120 in the neighborhood, which is a
> variation in which the server tries to start a second time and gets a
> bind error.
>
> I'll go try an explicit shutdown.
>
> --benson
>
>
>   
>> -----Original Message-----
>> From: Willem2 [mailto:ning.jiang@iona.com]
>> Sent: Thursday, October 18, 2007 7:30 PM
>> To: cxf-dev@incubator.apache.org
>> Subject: RE: Current snapshot still won't shut down jetty
>>
>>
>> Hi Benson,
>>
>> Do you call the bus.shutdown in your application?
>> If your client is not in the same JVM with the JettyServer , it should
>> work.
>> It is on my to do list to search for the SO_REUSEADDR solution.
>>
>> Willem.
>>
>> bmargulies wrote:
>>     
>>> My own application.
>>>
>>> For your problem, isn't this just our old friend SO_REUSEADDR, and
>>>       
> isn't
>   
>>> there a way to turn that on from Java?
>>>
>>>       
>>>> -----Original Message-----
>>>> From: Daniel Kulp [mailto:dkulp@apache.org]
>>>> Sent: Thursday, October 18, 2007 12:49 PM
>>>> To: cxf-dev@incubator.apache.org
>>>> Cc: Benson Margulies
>>>> Subject: Re: Current snapshot still won't shut down jetty
>>>>
>>>>
>>>> Is this in the system/unit tests or in your own application?
>>>>
>>>> If it's in the sys/unit tests, it won't.   I explicitely disabled
>>>>         
> it
>   
>>>> cause on Linux, if you try to shutdown a Jetty instance that has
>>>> keep-alives open to connections in the same VM, it doesn't close
>>>>         
> them
>   
>>>> and it blocks the port from being re-opened.
>>>>
>>>> Dan
>>>>
>>>> On Thursday 18 October 2007, Benson Margulies wrote:
>>>>         
>>>>> I picked up the 2.0.3 most recent snapshot (20071017) and I still
>>>>>           
>>> have
>>>       
>>>>> Jetty refusing to go away.
>>>>>
>>>>> Before I try to create a test case for this in systests, can
>>>>>           
> anyone
>   
>>>>> offer some diagnostic strategy that might narrow down the
>>>>>           
> problem?
>   
>>>>> Here's my Spring config for the Jetty handlers. I add some
>>>>>           
> servlets
>   
>>>>> via API to the webapp context in my code. I can't see any way to
>>>>> remove them.
>>>>>
>>>>> <httpj:engine-factory bus="cxf">
>>>>>   <httpj:engine port="8808">
>>>>>    <httpj:handlers>
>>>>>     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
>>>>>       <property name="requestLog">
>>>>>         <bean class="org.mortbay.jetty.NCSARequestLog">
>>>>>          <property name="filename" value="jetty.log"/>
>>>>>         </bean>
>>>>>       </property>
>>>>>     </bean>
>>>>>     <bean class="org.mortbay.jetty.webapp.WebAppContext">
>>>>>       <constructor-arg value="${jsunitPathname}"/>
>>>>>       <constructor-arg value="/jsunit"/>
>>>>>     </bean>
>>>>>     <bean class="org.mortbay.jetty.handler.ContextHandler">
>>>>>      <property name="contextPath" value="/${staticResourceBase}"
>>>>>           
> />
>   
>>>>>      <property name="handler">
>>>>>       <bean class="org.mortbay.jetty.handler.ResourceHandler">
>>>>>        <property name="baseResource">
>>>>>         <bean class="org.mortbay.resource.FileResource">
>>>>>          <constructor-arg value="${staticResourceURL}" />
>>>>>         </bean>
>>>>>         </property>
>>>>>       </bean>
>>>>>      </property>
>>>>>     </bean>
>>>>>    </httpj:handlers>
>>>>>   </httpj:engine>
>>>>>  </httpj:engine-fa
>>>>>           
>>>>
>>>> --
>>>> J. Daniel Kulp
>>>> Principal Engineer
>>>> IONA
>>>> P: 781-902-8727    C: 508-380-7194
>>>> daniel.kulp@iona.com
>>>> http://www.dankulp.com/blog
>>>>         
>>>       
>> --
>> View this message in context: http://www.nabble.com/Current-snapshot-
>> still-won%27t-shut-down-jetty-tf4648231.html#a13285693
>> Sent from the cxf-dev mailing list archive at Nabble.com.
>>     
>
>   

RE: Current snapshot still won't shut down jetty

Posted by Benson Margulies <bi...@basistech.com>.
An NPE setting a socket option? That's entertaining. 

My linux VM is in a somewhat uncooperative state, but I'll work around
that and try this out and see what I see.

> -----Original Message-----
> From: Willem2 [mailto:ning.jiang@iona.com]
> Sent: Friday, October 19, 2007 10:18 AM
> To: cxf-dev@incubator.apache.org
> Subject: RE: Current snapshot still won't shut down jetty
> 
> 
> Hi Benson,
> 
> I tried something about set SO_REUSEADDR in Jetty with the Systest of
> http-jetty.
> I can get the test passed in the windows box , but it is still failed
in
> the
> linux box.
> 
> Here is my changes, may be you can take a look.
> 1. Setting the jetty server's connection to be SocketConnection
> <httpj:engine port="8808">
>    <httpj:connector>
>        <bean class="org.mortbay.jetty.bio.SocketConnector">
>           <property name="port" value="8808"/>
>        </bean>
>    </httpj:connector>
>    <httpj:handlers>
> ....
> 
> 2. Setting the server socket's reuseAddress to be true after the CXF
> service
> Created
>         Bus bus = (Bus)applicationContext.getBean("cxf");
>         ServerRegistry sr = bus.getExtension(ServerRegistry.class);
>         ServerImpl si = (ServerImpl) sr.getServers().get(0);
>         JettyHTTPDestination jhd = (JettyHTTPDestination)
> si.getDestination();
>         JettyHTTPServerEngine e = (JettyHTTPServerEngine)
jhd.getEngine();
> 
> 
>         Connector connector = e.getConnector();
>         ServerSocket socket = (ServerSocket)
connector.getConnection();
>         socket.setReuseAddress(true);
> 
> 3. Calling the bus shutdown after the shutdownService()
>        shutdownService();
>        bus.shutdown(true);
> 4. Do the process 2,3 again in the same test function.
>     In linux box, the NPE is thrown from here.
> 
> The test is failed in the linux with the NPE when trying to call the
> socket.setReuseAddress after the bus.shutdown is called.
> 
> Any thought ?
> 
> BTW
> I will add a unit test for this case in the Jetty Engine some time
this
> weekend.
> 
> Willem.
> 
> 
> bmargulies wrote:
> >
> > Willem,
> >
> > Should the process refuse to exit even if I haven't called
bus.shutdown?
> >
> > Anyway, I just entered CXF-1120 in the neighborhood, which is a
> > variation in which the server tries to start a second time and gets
a
> > bind error.
> >
> > I'll go try an explicit shutdown.
> >
> > --benson
> >
> >
> >> -----Original Message-----
> >> From: Willem2 [mailto:ning.jiang@iona.com]
> >> Sent: Thursday, October 18, 2007 7:30 PM
> >> To: cxf-dev@incubator.apache.org
> >> Subject: RE: Current snapshot still won't shut down jetty
> >>
> >>
> >> Hi Benson,
> >>
> >> Do you call the bus.shutdown in your application?
> >> If your client is not in the same JVM with the JettyServer , it
should
> >> work.
> >> It is on my to do list to search for the SO_REUSEADDR solution.
> >>
> >> Willem.
> >>
> >> bmargulies wrote:
> >> >
> >> > My own application.
> >> >
> >> > For your problem, isn't this just our old friend SO_REUSEADDR,
and
> > isn't
> >> > there a way to turn that on from Java?
> >> >
> >> >> -----Original Message-----
> >> >> From: Daniel Kulp [mailto:dkulp@apache.org]
> >> >> Sent: Thursday, October 18, 2007 12:49 PM
> >> >> To: cxf-dev@incubator.apache.org
> >> >> Cc: Benson Margulies
> >> >> Subject: Re: Current snapshot still won't shut down jetty
> >> >>
> >> >>
> >> >> Is this in the system/unit tests or in your own application?
> >> >>
> >> >> If it's in the sys/unit tests, it won't.   I explicitely
disabled
> > it
> >> >> cause on Linux, if you try to shutdown a Jetty instance that has
> >> >> keep-alives open to connections in the same VM, it doesn't close
> > them
> >> >> and it blocks the port from being re-opened.
> >> >>
> >> >> Dan
> >> >>
> >> >> On Thursday 18 October 2007, Benson Margulies wrote:
> >> >> > I picked up the 2.0.3 most recent snapshot (20071017) and I
still
> >> > have
> >> >> > Jetty refusing to go away.
> >> >> >
> >> >> > Before I try to create a test case for this in systests, can
> > anyone
> >> >> > offer some diagnostic strategy that might narrow down the
> > problem?
> >> >> >
> >> >> > Here's my Spring config for the Jetty handlers. I add some
> > servlets
> >> >> > via API to the webapp context in my code. I can't see any way
to
> >> >> > remove them.
> >> >> >
> >> >> > <httpj:engine-factory bus="cxf">
> >> >> >   <httpj:engine port="8808">
> >> >> >    <httpj:handlers>
> >> >> >     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
> >> >> >       <property name="requestLog">
> >> >> >         <bean class="org.mortbay.jetty.NCSARequestLog">
> >> >> >          <property name="filename" value="jetty.log"/>
> >> >> >         </bean>
> >> >> >       </property>
> >> >> >     </bean>
> >> >> >     <bean class="org.mortbay.jetty.webapp.WebAppContext">
> >> >> >       <constructor-arg value="${jsunitPathname}"/>
> >> >> >       <constructor-arg value="/jsunit"/>
> >> >> >     </bean>
> >> >> >     <bean class="org.mortbay.jetty.handler.ContextHandler">
> >> >> >      <property name="contextPath"
value="/${staticResourceBase}"
> > />
> >> >> >      <property name="handler">
> >> >> >       <bean class="org.mortbay.jetty.handler.ResourceHandler">
> >> >> >        <property name="baseResource">
> >> >> >         <bean class="org.mortbay.resource.FileResource">
> >> >> >          <constructor-arg value="${staticResourceURL}" />
> >> >> >         </bean>
> >> >> >         </property>
> >> >> >       </bean>
> >> >> >      </property>
> >> >> >     </bean>
> >> >> >    </httpj:handlers>
> >> >> >   </httpj:engine>
> >> >> >  </httpj:engine-fa
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> J. Daniel Kulp
> >> >> Principal Engineer
> >> >> IONA
> >> >> P: 781-902-8727    C: 508-380-7194
> >> >> daniel.kulp@iona.com
> >> >> http://www.dankulp.com/blog
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
http://www.nabble.com/Current-snapshot-
> >> still-won%27t-shut-down-jetty-tf4648231.html#a13285693
> >> Sent from the cxf-dev mailing list archive at Nabble.com.
> >
> >
> >
> 
> --
> View this message in context: http://www.nabble.com/Current-snapshot-
> still-won%27t-shut-down-jetty-tf4648231.html#a13295490
> Sent from the cxf-dev mailing list archive at Nabble.com.


RE: Current snapshot still won't shut down jetty

Posted by Benson Margulies <bi...@basistech.com>.
Willem,

I added your recipe to the EngineLifecycleTest, and it passed. So I
committed it. Perhaps you can fiddle with it until it fails and then
pass it back to me with something commented out or @Ignored?

Meanwhile, the test that I @Ignored (which gets the bind errors) is
still out there, just to make a redundant statement.

--benson


> -----Original Message-----
> From: Willem2 [mailto:ning.jiang@iona.com]
> Sent: Friday, October 19, 2007 10:18 AM
> To: cxf-dev@incubator.apache.org
> Subject: RE: Current snapshot still won't shut down jetty
> 
> 
> Hi Benson,
> 
> I tried something about set SO_REUSEADDR in Jetty with the Systest of
> http-jetty.
> I can get the test passed in the windows box , but it is still failed
in
> the
> linux box.
> 
> Here is my changes, may be you can take a look.
> 1. Setting the jetty server's connection to be SocketConnection
> <httpj:engine port="8808">
>    <httpj:connector>
>        <bean class="org.mortbay.jetty.bio.SocketConnector">
>           <property name="port" value="8808"/>
>        </bean>
>    </httpj:connector>
>    <httpj:handlers>
> ....
> 
> 2. Setting the server socket's reuseAddress to be true after the CXF
> service
> Created
>         Bus bus = (Bus)applicationContext.getBean("cxf");
>         ServerRegistry sr = bus.getExtension(ServerRegistry.class);
>         ServerImpl si = (ServerImpl) sr.getServers().get(0);
>         JettyHTTPDestination jhd = (JettyHTTPDestination)
> si.getDestination();
>         JettyHTTPServerEngine e = (JettyHTTPServerEngine)
jhd.getEngine();
> 
> 
>         Connector connector = e.getConnector();
>         ServerSocket socket = (ServerSocket)
connector.getConnection();
>         socket.setReuseAddress(true);
> 
> 3. Calling the bus shutdown after the shutdownService()
>        shutdownService();
>        bus.shutdown(true);
> 4. Do the process 2,3 again in the same test function.
>     In linux box, the NPE is thrown from here.
> 
> The test is failed in the linux with the NPE when trying to call the
> socket.setReuseAddress after the bus.shutdown is called.
> 
> Any thought ?
> 
> BTW
> I will add a unit test for this case in the Jetty Engine some time
this
> weekend.
> 
> Willem.
> 
> 
> bmargulies wrote:
> >
> > Willem,
> >
> > Should the process refuse to exit even if I haven't called
bus.shutdown?
> >
> > Anyway, I just entered CXF-1120 in the neighborhood, which is a
> > variation in which the server tries to start a second time and gets
a
> > bind error.
> >
> > I'll go try an explicit shutdown.
> >
> > --benson
> >
> >
> >> -----Original Message-----
> >> From: Willem2 [mailto:ning.jiang@iona.com]
> >> Sent: Thursday, October 18, 2007 7:30 PM
> >> To: cxf-dev@incubator.apache.org
> >> Subject: RE: Current snapshot still won't shut down jetty
> >>
> >>
> >> Hi Benson,
> >>
> >> Do you call the bus.shutdown in your application?
> >> If your client is not in the same JVM with the JettyServer , it
should
> >> work.
> >> It is on my to do list to search for the SO_REUSEADDR solution.
> >>
> >> Willem.
> >>
> >> bmargulies wrote:
> >> >
> >> > My own application.
> >> >
> >> > For your problem, isn't this just our old friend SO_REUSEADDR,
and
> > isn't
> >> > there a way to turn that on from Java?
> >> >
> >> >> -----Original Message-----
> >> >> From: Daniel Kulp [mailto:dkulp@apache.org]
> >> >> Sent: Thursday, October 18, 2007 12:49 PM
> >> >> To: cxf-dev@incubator.apache.org
> >> >> Cc: Benson Margulies
> >> >> Subject: Re: Current snapshot still won't shut down jetty
> >> >>
> >> >>
> >> >> Is this in the system/unit tests or in your own application?
> >> >>
> >> >> If it's in the sys/unit tests, it won't.   I explicitely
disabled
> > it
> >> >> cause on Linux, if you try to shutdown a Jetty instance that has
> >> >> keep-alives open to connections in the same VM, it doesn't close
> > them
> >> >> and it blocks the port from being re-opened.
> >> >>
> >> >> Dan
> >> >>
> >> >> On Thursday 18 October 2007, Benson Margulies wrote:
> >> >> > I picked up the 2.0.3 most recent snapshot (20071017) and I
still
> >> > have
> >> >> > Jetty refusing to go away.
> >> >> >
> >> >> > Before I try to create a test case for this in systests, can
> > anyone
> >> >> > offer some diagnostic strategy that might narrow down the
> > problem?
> >> >> >
> >> >> > Here's my Spring config for the Jetty handlers. I add some
> > servlets
> >> >> > via API to the webapp context in my code. I can't see any way
to
> >> >> > remove them.
> >> >> >
> >> >> > <httpj:engine-factory bus="cxf">
> >> >> >   <httpj:engine port="8808">
> >> >> >    <httpj:handlers>
> >> >> >     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
> >> >> >       <property name="requestLog">
> >> >> >         <bean class="org.mortbay.jetty.NCSARequestLog">
> >> >> >          <property name="filename" value="jetty.log"/>
> >> >> >         </bean>
> >> >> >       </property>
> >> >> >     </bean>
> >> >> >     <bean class="org.mortbay.jetty.webapp.WebAppContext">
> >> >> >       <constructor-arg value="${jsunitPathname}"/>
> >> >> >       <constructor-arg value="/jsunit"/>
> >> >> >     </bean>
> >> >> >     <bean class="org.mortbay.jetty.handler.ContextHandler">
> >> >> >      <property name="contextPath"
value="/${staticResourceBase}"
> > />
> >> >> >      <property name="handler">
> >> >> >       <bean class="org.mortbay.jetty.handler.ResourceHandler">
> >> >> >        <property name="baseResource">
> >> >> >         <bean class="org.mortbay.resource.FileResource">
> >> >> >          <constructor-arg value="${staticResourceURL}" />
> >> >> >         </bean>
> >> >> >         </property>
> >> >> >       </bean>
> >> >> >      </property>
> >> >> >     </bean>
> >> >> >    </httpj:handlers>
> >> >> >   </httpj:engine>
> >> >> >  </httpj:engine-fa
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> J. Daniel Kulp
> >> >> Principal Engineer
> >> >> IONA
> >> >> P: 781-902-8727    C: 508-380-7194
> >> >> daniel.kulp@iona.com
> >> >> http://www.dankulp.com/blog
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
http://www.nabble.com/Current-snapshot-
> >> still-won%27t-shut-down-jetty-tf4648231.html#a13285693
> >> Sent from the cxf-dev mailing list archive at Nabble.com.
> >
> >
> >
> 
> --
> View this message in context: http://www.nabble.com/Current-snapshot-
> still-won%27t-shut-down-jetty-tf4648231.html#a13295490
> Sent from the cxf-dev mailing list archive at Nabble.com.


RE: Current snapshot still won't shut down jetty

Posted by Willem2 <ni...@iona.com>.
Hi Benson,

I tried something about set SO_REUSEADDR in Jetty with the Systest of
http-jetty.
I can get the test passed in the windows box , but it is still failed in the
linux box.

Here is my changes, may be you can take a look.
1. Setting the jetty server's connection to be SocketConnection
<httpj:engine port="8808">
   <httpj:connector>
       <bean class="org.mortbay.jetty.bio.SocketConnector">
          <property name="port" value="8808"/>
       </bean>
   </httpj:connector>      
   <httpj:handlers>
....

2. Setting the server socket's reuseAddress to be true after the CXF service
Created
        Bus bus = (Bus)applicationContext.getBean("cxf");
        ServerRegistry sr = bus.getExtension(ServerRegistry.class);
        ServerImpl si = (ServerImpl) sr.getServers().get(0);
        JettyHTTPDestination jhd = (JettyHTTPDestination)
si.getDestination();
        JettyHTTPServerEngine e = (JettyHTTPServerEngine) jhd.getEngine();
        
        
        Connector connector = e.getConnector();
        ServerSocket socket = (ServerSocket) connector.getConnection();
        socket.setReuseAddress(true);

3. Calling the bus shutdown after the shutdownService()
       shutdownService();
       bus.shutdown(true);
4. Do the process 2,3 again in the same test function.
    In linux box, the NPE is thrown from here.

The test is failed in the linux with the NPE when trying to call the
socket.setReuseAddress after the bus.shutdown is called.

Any thought ?

BTW
I will add a unit test for this case in the Jetty Engine some time this
weekend.

Willem.


bmargulies wrote:
> 
> Willem,
> 
> Should the process refuse to exit even if I haven't called bus.shutdown?
> 
> Anyway, I just entered CXF-1120 in the neighborhood, which is a
> variation in which the server tries to start a second time and gets a
> bind error.
> 
> I'll go try an explicit shutdown.
> 
> --benson
> 
> 
>> -----Original Message-----
>> From: Willem2 [mailto:ning.jiang@iona.com]
>> Sent: Thursday, October 18, 2007 7:30 PM
>> To: cxf-dev@incubator.apache.org
>> Subject: RE: Current snapshot still won't shut down jetty
>> 
>> 
>> Hi Benson,
>> 
>> Do you call the bus.shutdown in your application?
>> If your client is not in the same JVM with the JettyServer , it should
>> work.
>> It is on my to do list to search for the SO_REUSEADDR solution.
>> 
>> Willem.
>> 
>> bmargulies wrote:
>> >
>> > My own application.
>> >
>> > For your problem, isn't this just our old friend SO_REUSEADDR, and
> isn't
>> > there a way to turn that on from Java?
>> >
>> >> -----Original Message-----
>> >> From: Daniel Kulp [mailto:dkulp@apache.org]
>> >> Sent: Thursday, October 18, 2007 12:49 PM
>> >> To: cxf-dev@incubator.apache.org
>> >> Cc: Benson Margulies
>> >> Subject: Re: Current snapshot still won't shut down jetty
>> >>
>> >>
>> >> Is this in the system/unit tests or in your own application?
>> >>
>> >> If it's in the sys/unit tests, it won't.   I explicitely disabled
> it
>> >> cause on Linux, if you try to shutdown a Jetty instance that has
>> >> keep-alives open to connections in the same VM, it doesn't close
> them
>> >> and it blocks the port from being re-opened.
>> >>
>> >> Dan
>> >>
>> >> On Thursday 18 October 2007, Benson Margulies wrote:
>> >> > I picked up the 2.0.3 most recent snapshot (20071017) and I still
>> > have
>> >> > Jetty refusing to go away.
>> >> >
>> >> > Before I try to create a test case for this in systests, can
> anyone
>> >> > offer some diagnostic strategy that might narrow down the
> problem?
>> >> >
>> >> > Here's my Spring config for the Jetty handlers. I add some
> servlets
>> >> > via API to the webapp context in my code. I can't see any way to
>> >> > remove them.
>> >> >
>> >> > <httpj:engine-factory bus="cxf">
>> >> >   <httpj:engine port="8808">
>> >> >    <httpj:handlers>
>> >> >     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
>> >> >       <property name="requestLog">
>> >> >         <bean class="org.mortbay.jetty.NCSARequestLog">
>> >> >          <property name="filename" value="jetty.log"/>
>> >> >         </bean>
>> >> >       </property>
>> >> >     </bean>
>> >> >     <bean class="org.mortbay.jetty.webapp.WebAppContext">
>> >> >       <constructor-arg value="${jsunitPathname}"/>
>> >> >       <constructor-arg value="/jsunit"/>
>> >> >     </bean>
>> >> >     <bean class="org.mortbay.jetty.handler.ContextHandler">
>> >> >      <property name="contextPath" value="/${staticResourceBase}"
> />
>> >> >      <property name="handler">
>> >> >       <bean class="org.mortbay.jetty.handler.ResourceHandler">
>> >> >        <property name="baseResource">
>> >> >         <bean class="org.mortbay.resource.FileResource">
>> >> >          <constructor-arg value="${staticResourceURL}" />
>> >> >         </bean>
>> >> >         </property>
>> >> >       </bean>
>> >> >      </property>
>> >> >     </bean>
>> >> >    </httpj:handlers>
>> >> >   </httpj:engine>
>> >> >  </httpj:engine-fa
>> >>
>> >>
>> >>
>> >> --
>> >> J. Daniel Kulp
>> >> Principal Engineer
>> >> IONA
>> >> P: 781-902-8727    C: 508-380-7194
>> >> daniel.kulp@iona.com
>> >> http://www.dankulp.com/blog
>> >
>> >
>> 
>> --
>> View this message in context: http://www.nabble.com/Current-snapshot-
>> still-won%27t-shut-down-jetty-tf4648231.html#a13285693
>> Sent from the cxf-dev mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Current-snapshot-still-won%27t-shut-down-jetty-tf4648231.html#a13295490
Sent from the cxf-dev mailing list archive at Nabble.com.


RE: Current snapshot still won't shut down jetty

Posted by Benson Margulies <bi...@basistech.com>.
Willem,

Should the process refuse to exit even if I haven't called bus.shutdown?

Anyway, I just entered CXF-1120 in the neighborhood, which is a
variation in which the server tries to start a second time and gets a
bind error.

I'll go try an explicit shutdown.

--benson


> -----Original Message-----
> From: Willem2 [mailto:ning.jiang@iona.com]
> Sent: Thursday, October 18, 2007 7:30 PM
> To: cxf-dev@incubator.apache.org
> Subject: RE: Current snapshot still won't shut down jetty
> 
> 
> Hi Benson,
> 
> Do you call the bus.shutdown in your application?
> If your client is not in the same JVM with the JettyServer , it should
> work.
> It is on my to do list to search for the SO_REUSEADDR solution.
> 
> Willem.
> 
> bmargulies wrote:
> >
> > My own application.
> >
> > For your problem, isn't this just our old friend SO_REUSEADDR, and
isn't
> > there a way to turn that on from Java?
> >
> >> -----Original Message-----
> >> From: Daniel Kulp [mailto:dkulp@apache.org]
> >> Sent: Thursday, October 18, 2007 12:49 PM
> >> To: cxf-dev@incubator.apache.org
> >> Cc: Benson Margulies
> >> Subject: Re: Current snapshot still won't shut down jetty
> >>
> >>
> >> Is this in the system/unit tests or in your own application?
> >>
> >> If it's in the sys/unit tests, it won't.   I explicitely disabled
it
> >> cause on Linux, if you try to shutdown a Jetty instance that has
> >> keep-alives open to connections in the same VM, it doesn't close
them
> >> and it blocks the port from being re-opened.
> >>
> >> Dan
> >>
> >> On Thursday 18 October 2007, Benson Margulies wrote:
> >> > I picked up the 2.0.3 most recent snapshot (20071017) and I still
> > have
> >> > Jetty refusing to go away.
> >> >
> >> > Before I try to create a test case for this in systests, can
anyone
> >> > offer some diagnostic strategy that might narrow down the
problem?
> >> >
> >> > Here's my Spring config for the Jetty handlers. I add some
servlets
> >> > via API to the webapp context in my code. I can't see any way to
> >> > remove them.
> >> >
> >> > <httpj:engine-factory bus="cxf">
> >> >   <httpj:engine port="8808">
> >> >    <httpj:handlers>
> >> >     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
> >> >       <property name="requestLog">
> >> >         <bean class="org.mortbay.jetty.NCSARequestLog">
> >> >          <property name="filename" value="jetty.log"/>
> >> >         </bean>
> >> >       </property>
> >> >     </bean>
> >> >     <bean class="org.mortbay.jetty.webapp.WebAppContext">
> >> >       <constructor-arg value="${jsunitPathname}"/>
> >> >       <constructor-arg value="/jsunit"/>
> >> >     </bean>
> >> >     <bean class="org.mortbay.jetty.handler.ContextHandler">
> >> >      <property name="contextPath" value="/${staticResourceBase}"
/>
> >> >      <property name="handler">
> >> >       <bean class="org.mortbay.jetty.handler.ResourceHandler">
> >> >        <property name="baseResource">
> >> >         <bean class="org.mortbay.resource.FileResource">
> >> >          <constructor-arg value="${staticResourceURL}" />
> >> >         </bean>
> >> >         </property>
> >> >       </bean>
> >> >      </property>
> >> >     </bean>
> >> >    </httpj:handlers>
> >> >   </httpj:engine>
> >> >  </httpj:engine-fa
> >>
> >>
> >>
> >> --
> >> J. Daniel Kulp
> >> Principal Engineer
> >> IONA
> >> P: 781-902-8727    C: 508-380-7194
> >> daniel.kulp@iona.com
> >> http://www.dankulp.com/blog
> >
> >
> 
> --
> View this message in context: http://www.nabble.com/Current-snapshot-
> still-won%27t-shut-down-jetty-tf4648231.html#a13285693
> Sent from the cxf-dev mailing list archive at Nabble.com.


RE: Current snapshot still won't shut down jetty

Posted by Benson Margulies <bi...@basistech.com>.
Hang on, I wasn't reading carefully. My client isn't in the same JVM,
because my client is a javascript running in firefox running from jsunit
launched from the same process. 

> -----Original Message-----
> From: Benson Margulies [mailto:bim2007@basistech.com]
> Sent: Thursday, October 18, 2007 8:27 PM
> To: cxf-dev@incubator.apache.org
> Subject: RE: Current snapshot still won't shut down jetty
> 
> Current state, the process doesn't exit. The only threads are a
Timer-0
> thread and a DestroyJavaVM thread. The rest of the jetty threads are
> gone. This might not have anything to do with CXF / jetty.
> 
> > -----Original Message-----
> > From: Willem2 [mailto:ning.jiang@iona.com]
> > Sent: Thursday, October 18, 2007 7:30 PM
> > To: cxf-dev@incubator.apache.org
> > Subject: RE: Current snapshot still won't shut down jetty
> >
> >
> > Hi Benson,
> >
> > Do you call the bus.shutdown in your application?
> > If your client is not in the same JVM with the JettyServer , it
should
> > work.
> > It is on my to do list to search for the SO_REUSEADDR solution.
> >
> > Willem.
> >
> > bmargulies wrote:
> > >
> > > My own application.
> > >
> > > For your problem, isn't this just our old friend SO_REUSEADDR, and
> isn't
> > > there a way to turn that on from Java?
> > >
> > >> -----Original Message-----
> > >> From: Daniel Kulp [mailto:dkulp@apache.org]
> > >> Sent: Thursday, October 18, 2007 12:49 PM
> > >> To: cxf-dev@incubator.apache.org
> > >> Cc: Benson Margulies
> > >> Subject: Re: Current snapshot still won't shut down jetty
> > >>
> > >>
> > >> Is this in the system/unit tests or in your own application?
> > >>
> > >> If it's in the sys/unit tests, it won't.   I explicitely disabled
> it
> > >> cause on Linux, if you try to shutdown a Jetty instance that has
> > >> keep-alives open to connections in the same VM, it doesn't close
> them
> > >> and it blocks the port from being re-opened.
> > >>
> > >> Dan
> > >>
> > >> On Thursday 18 October 2007, Benson Margulies wrote:
> > >> > I picked up the 2.0.3 most recent snapshot (20071017) and I
still
> > > have
> > >> > Jetty refusing to go away.
> > >> >
> > >> > Before I try to create a test case for this in systests, can
> anyone
> > >> > offer some diagnostic strategy that might narrow down the
> problem?
> > >> >
> > >> > Here's my Spring config for the Jetty handlers. I add some
> servlets
> > >> > via API to the webapp context in my code. I can't see any way
to
> > >> > remove them.
> > >> >
> > >> > <httpj:engine-factory bus="cxf">
> > >> >   <httpj:engine port="8808">
> > >> >    <httpj:handlers>
> > >> >     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
> > >> >       <property name="requestLog">
> > >> >         <bean class="org.mortbay.jetty.NCSARequestLog">
> > >> >          <property name="filename" value="jetty.log"/>
> > >> >         </bean>
> > >> >       </property>
> > >> >     </bean>
> > >> >     <bean class="org.mortbay.jetty.webapp.WebAppContext">
> > >> >       <constructor-arg value="${jsunitPathname}"/>
> > >> >       <constructor-arg value="/jsunit"/>
> > >> >     </bean>
> > >> >     <bean class="org.mortbay.jetty.handler.ContextHandler">
> > >> >      <property name="contextPath"
value="/${staticResourceBase}"
> />
> > >> >      <property name="handler">
> > >> >       <bean class="org.mortbay.jetty.handler.ResourceHandler">
> > >> >        <property name="baseResource">
> > >> >         <bean class="org.mortbay.resource.FileResource">
> > >> >          <constructor-arg value="${staticResourceURL}" />
> > >> >         </bean>
> > >> >         </property>
> > >> >       </bean>
> > >> >      </property>
> > >> >     </bean>
> > >> >    </httpj:handlers>
> > >> >   </httpj:engine>
> > >> >  </httpj:engine-fa
> > >>
> > >>
> > >>
> > >> --
> > >> J. Daniel Kulp
> > >> Principal Engineer
> > >> IONA
> > >> P: 781-902-8727    C: 508-380-7194
> > >> daniel.kulp@iona.com
> > >> http://www.dankulp.com/blog
> > >
> > >
> >
> > --
> > View this message in context:
http://www.nabble.com/Current-snapshot-
> > still-won%27t-shut-down-jetty-tf4648231.html#a13285693
> > Sent from the cxf-dev mailing list archive at Nabble.com.


RE: Current snapshot still won't shut down jetty

Posted by Benson Margulies <bi...@basistech.com>.
Current state, the process doesn't exit. The only threads are a Timer-0
thread and a DestroyJavaVM thread. The rest of the jetty threads are
gone. This might not have anything to do with CXF / jetty. 

> -----Original Message-----
> From: Willem2 [mailto:ning.jiang@iona.com]
> Sent: Thursday, October 18, 2007 7:30 PM
> To: cxf-dev@incubator.apache.org
> Subject: RE: Current snapshot still won't shut down jetty
> 
> 
> Hi Benson,
> 
> Do you call the bus.shutdown in your application?
> If your client is not in the same JVM with the JettyServer , it should
> work.
> It is on my to do list to search for the SO_REUSEADDR solution.
> 
> Willem.
> 
> bmargulies wrote:
> >
> > My own application.
> >
> > For your problem, isn't this just our old friend SO_REUSEADDR, and
isn't
> > there a way to turn that on from Java?
> >
> >> -----Original Message-----
> >> From: Daniel Kulp [mailto:dkulp@apache.org]
> >> Sent: Thursday, October 18, 2007 12:49 PM
> >> To: cxf-dev@incubator.apache.org
> >> Cc: Benson Margulies
> >> Subject: Re: Current snapshot still won't shut down jetty
> >>
> >>
> >> Is this in the system/unit tests or in your own application?
> >>
> >> If it's in the sys/unit tests, it won't.   I explicitely disabled
it
> >> cause on Linux, if you try to shutdown a Jetty instance that has
> >> keep-alives open to connections in the same VM, it doesn't close
them
> >> and it blocks the port from being re-opened.
> >>
> >> Dan
> >>
> >> On Thursday 18 October 2007, Benson Margulies wrote:
> >> > I picked up the 2.0.3 most recent snapshot (20071017) and I still
> > have
> >> > Jetty refusing to go away.
> >> >
> >> > Before I try to create a test case for this in systests, can
anyone
> >> > offer some diagnostic strategy that might narrow down the
problem?
> >> >
> >> > Here's my Spring config for the Jetty handlers. I add some
servlets
> >> > via API to the webapp context in my code. I can't see any way to
> >> > remove them.
> >> >
> >> > <httpj:engine-factory bus="cxf">
> >> >   <httpj:engine port="8808">
> >> >    <httpj:handlers>
> >> >     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
> >> >       <property name="requestLog">
> >> >         <bean class="org.mortbay.jetty.NCSARequestLog">
> >> >          <property name="filename" value="jetty.log"/>
> >> >         </bean>
> >> >       </property>
> >> >     </bean>
> >> >     <bean class="org.mortbay.jetty.webapp.WebAppContext">
> >> >       <constructor-arg value="${jsunitPathname}"/>
> >> >       <constructor-arg value="/jsunit"/>
> >> >     </bean>
> >> >     <bean class="org.mortbay.jetty.handler.ContextHandler">
> >> >      <property name="contextPath" value="/${staticResourceBase}"
/>
> >> >      <property name="handler">
> >> >       <bean class="org.mortbay.jetty.handler.ResourceHandler">
> >> >        <property name="baseResource">
> >> >         <bean class="org.mortbay.resource.FileResource">
> >> >          <constructor-arg value="${staticResourceURL}" />
> >> >         </bean>
> >> >         </property>
> >> >       </bean>
> >> >      </property>
> >> >     </bean>
> >> >    </httpj:handlers>
> >> >   </httpj:engine>
> >> >  </httpj:engine-fa
> >>
> >>
> >>
> >> --
> >> J. Daniel Kulp
> >> Principal Engineer
> >> IONA
> >> P: 781-902-8727    C: 508-380-7194
> >> daniel.kulp@iona.com
> >> http://www.dankulp.com/blog
> >
> >
> 
> --
> View this message in context: http://www.nabble.com/Current-snapshot-
> still-won%27t-shut-down-jetty-tf4648231.html#a13285693
> Sent from the cxf-dev mailing list archive at Nabble.com.


RE: Current snapshot still won't shut down jetty

Posted by Benson Margulies <bi...@basistech.com>.
I will try that.

> -----Original Message-----
> From: Willem2 [mailto:ning.jiang@iona.com]
> Sent: Thursday, October 18, 2007 7:30 PM
> To: cxf-dev@incubator.apache.org
> Subject: RE: Current snapshot still won't shut down jetty
> 
> 
> Hi Benson,
> 
> Do you call the bus.shutdown in your application?
> If your client is not in the same JVM with the JettyServer , it should
> work.
> It is on my to do list to search for the SO_REUSEADDR solution.
> 
> Willem.
> 
> bmargulies wrote:
> >
> > My own application.
> >
> > For your problem, isn't this just our old friend SO_REUSEADDR, and
isn't
> > there a way to turn that on from Java?
> >
> >> -----Original Message-----
> >> From: Daniel Kulp [mailto:dkulp@apache.org]
> >> Sent: Thursday, October 18, 2007 12:49 PM
> >> To: cxf-dev@incubator.apache.org
> >> Cc: Benson Margulies
> >> Subject: Re: Current snapshot still won't shut down jetty
> >>
> >>
> >> Is this in the system/unit tests or in your own application?
> >>
> >> If it's in the sys/unit tests, it won't.   I explicitely disabled
it
> >> cause on Linux, if you try to shutdown a Jetty instance that has
> >> keep-alives open to connections in the same VM, it doesn't close
them
> >> and it blocks the port from being re-opened.
> >>
> >> Dan
> >>
> >> On Thursday 18 October 2007, Benson Margulies wrote:
> >> > I picked up the 2.0.3 most recent snapshot (20071017) and I still
> > have
> >> > Jetty refusing to go away.
> >> >
> >> > Before I try to create a test case for this in systests, can
anyone
> >> > offer some diagnostic strategy that might narrow down the
problem?
> >> >
> >> > Here's my Spring config for the Jetty handlers. I add some
servlets
> >> > via API to the webapp context in my code. I can't see any way to
> >> > remove them.
> >> >
> >> > <httpj:engine-factory bus="cxf">
> >> >   <httpj:engine port="8808">
> >> >    <httpj:handlers>
> >> >     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
> >> >       <property name="requestLog">
> >> >         <bean class="org.mortbay.jetty.NCSARequestLog">
> >> >          <property name="filename" value="jetty.log"/>
> >> >         </bean>
> >> >       </property>
> >> >     </bean>
> >> >     <bean class="org.mortbay.jetty.webapp.WebAppContext">
> >> >       <constructor-arg value="${jsunitPathname}"/>
> >> >       <constructor-arg value="/jsunit"/>
> >> >     </bean>
> >> >     <bean class="org.mortbay.jetty.handler.ContextHandler">
> >> >      <property name="contextPath" value="/${staticResourceBase}"
/>
> >> >      <property name="handler">
> >> >       <bean class="org.mortbay.jetty.handler.ResourceHandler">
> >> >        <property name="baseResource">
> >> >         <bean class="org.mortbay.resource.FileResource">
> >> >          <constructor-arg value="${staticResourceURL}" />
> >> >         </bean>
> >> >         </property>
> >> >       </bean>
> >> >      </property>
> >> >     </bean>
> >> >    </httpj:handlers>
> >> >   </httpj:engine>
> >> >  </httpj:engine-fa
> >>
> >>
> >>
> >> --
> >> J. Daniel Kulp
> >> Principal Engineer
> >> IONA
> >> P: 781-902-8727    C: 508-380-7194
> >> daniel.kulp@iona.com
> >> http://www.dankulp.com/blog
> >
> >
> 
> --
> View this message in context: http://www.nabble.com/Current-snapshot-
> still-won%27t-shut-down-jetty-tf4648231.html#a13285693
> Sent from the cxf-dev mailing list archive at Nabble.com.


RE: Current snapshot still won't shut down jetty

Posted by Willem2 <ni...@iona.com>.
Hi Benson,

Do you call the bus.shutdown in your application?
If your client is not in the same JVM with the JettyServer , it should work.
It is on my to do list to search for the SO_REUSEADDR solution.

Willem. 

bmargulies wrote:
> 
> My own application.
> 
> For your problem, isn't this just our old friend SO_REUSEADDR, and isn't
> there a way to turn that on from Java?
> 
>> -----Original Message-----
>> From: Daniel Kulp [mailto:dkulp@apache.org]
>> Sent: Thursday, October 18, 2007 12:49 PM
>> To: cxf-dev@incubator.apache.org
>> Cc: Benson Margulies
>> Subject: Re: Current snapshot still won't shut down jetty
>> 
>> 
>> Is this in the system/unit tests or in your own application?
>> 
>> If it's in the sys/unit tests, it won't.   I explicitely disabled it
>> cause on Linux, if you try to shutdown a Jetty instance that has
>> keep-alives open to connections in the same VM, it doesn't close them
>> and it blocks the port from being re-opened.
>> 
>> Dan
>> 
>> On Thursday 18 October 2007, Benson Margulies wrote:
>> > I picked up the 2.0.3 most recent snapshot (20071017) and I still
> have
>> > Jetty refusing to go away.
>> >
>> > Before I try to create a test case for this in systests, can anyone
>> > offer some diagnostic strategy that might narrow down the problem?
>> >
>> > Here's my Spring config for the Jetty handlers. I add some servlets
>> > via API to the webapp context in my code. I can't see any way to
>> > remove them.
>> >
>> > <httpj:engine-factory bus="cxf">
>> >   <httpj:engine port="8808">
>> >    <httpj:handlers>
>> >     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
>> >       <property name="requestLog">
>> >         <bean class="org.mortbay.jetty.NCSARequestLog">
>> >          <property name="filename" value="jetty.log"/>
>> >         </bean>
>> >       </property>
>> >     </bean>
>> >     <bean class="org.mortbay.jetty.webapp.WebAppContext">
>> >       <constructor-arg value="${jsunitPathname}"/>
>> >       <constructor-arg value="/jsunit"/>
>> >     </bean>
>> >     <bean class="org.mortbay.jetty.handler.ContextHandler">
>> >      <property name="contextPath" value="/${staticResourceBase}" />
>> >      <property name="handler">
>> >       <bean class="org.mortbay.jetty.handler.ResourceHandler">
>> >        <property name="baseResource">
>> >         <bean class="org.mortbay.resource.FileResource">
>> >          <constructor-arg value="${staticResourceURL}" />
>> >         </bean>
>> >         </property>
>> >       </bean>
>> >      </property>
>> >     </bean>
>> >    </httpj:handlers>
>> >   </httpj:engine>
>> >  </httpj:engine-fa
>> 
>> 
>> 
>> --
>> J. Daniel Kulp
>> Principal Engineer
>> IONA
>> P: 781-902-8727    C: 508-380-7194
>> daniel.kulp@iona.com
>> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/Current-snapshot-still-won%27t-shut-down-jetty-tf4648231.html#a13285693
Sent from the cxf-dev mailing list archive at Nabble.com.


RE: Current snapshot still won't shut down jetty

Posted by Benson Margulies <bi...@basistech.com>.
My own application.

For your problem, isn't this just our old friend SO_REUSEADDR, and isn't
there a way to turn that on from Java?

> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Thursday, October 18, 2007 12:49 PM
> To: cxf-dev@incubator.apache.org
> Cc: Benson Margulies
> Subject: Re: Current snapshot still won't shut down jetty
> 
> 
> Is this in the system/unit tests or in your own application?
> 
> If it's in the sys/unit tests, it won't.   I explicitely disabled it
> cause on Linux, if you try to shutdown a Jetty instance that has
> keep-alives open to connections in the same VM, it doesn't close them
> and it blocks the port from being re-opened.
> 
> Dan
> 
> On Thursday 18 October 2007, Benson Margulies wrote:
> > I picked up the 2.0.3 most recent snapshot (20071017) and I still
have
> > Jetty refusing to go away.
> >
> > Before I try to create a test case for this in systests, can anyone
> > offer some diagnostic strategy that might narrow down the problem?
> >
> > Here's my Spring config for the Jetty handlers. I add some servlets
> > via API to the webapp context in my code. I can't see any way to
> > remove them.
> >
> > <httpj:engine-factory bus="cxf">
> >   <httpj:engine port="8808">
> >    <httpj:handlers>
> >     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
> >       <property name="requestLog">
> >         <bean class="org.mortbay.jetty.NCSARequestLog">
> >          <property name="filename" value="jetty.log"/>
> >         </bean>
> >       </property>
> >     </bean>
> >     <bean class="org.mortbay.jetty.webapp.WebAppContext">
> >       <constructor-arg value="${jsunitPathname}"/>
> >       <constructor-arg value="/jsunit"/>
> >     </bean>
> >     <bean class="org.mortbay.jetty.handler.ContextHandler">
> >      <property name="contextPath" value="/${staticResourceBase}" />
> >      <property name="handler">
> >       <bean class="org.mortbay.jetty.handler.ResourceHandler">
> >        <property name="baseResource">
> >         <bean class="org.mortbay.resource.FileResource">
> >          <constructor-arg value="${staticResourceURL}" />
> >         </bean>
> >         </property>
> >       </bean>
> >      </property>
> >     </bean>
> >    </httpj:handlers>
> >   </httpj:engine>
> >  </httpj:engine-fa
> 
> 
> 
> --
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog

Re: Current snapshot still won't shut down jetty

Posted by Daniel Kulp <dk...@apache.org>.
Is this in the system/unit tests or in your own application?

If it's in the sys/unit tests, it won't.   I explicitely disabled it 
cause on Linux, if you try to shutdown a Jetty instance that has 
keep-alives open to connections in the same VM, it doesn't close them 
and it blocks the port from being re-opened.   

Dan

On Thursday 18 October 2007, Benson Margulies wrote:
> I picked up the 2.0.3 most recent snapshot (20071017) and I still have
> Jetty refusing to go away.
>
> Before I try to create a test case for this in systests, can anyone
> offer some diagnostic strategy that might narrow down the problem?
>
> Here's my Spring config for the Jetty handlers. I add some servlets
> via API to the webapp context in my code. I can't see any way to
> remove them.
>
> <httpj:engine-factory bus="cxf">
>   <httpj:engine port="8808">
>    <httpj:handlers>
>     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
>       <property name="requestLog">
>         <bean class="org.mortbay.jetty.NCSARequestLog">
>          <property name="filename" value="jetty.log"/>
>         </bean>
>       </property>
>     </bean>
>     <bean class="org.mortbay.jetty.webapp.WebAppContext">
>       <constructor-arg value="${jsunitPathname}"/>
>       <constructor-arg value="/jsunit"/>
>     </bean>
>     <bean class="org.mortbay.jetty.handler.ContextHandler">
>      <property name="contextPath" value="/${staticResourceBase}" />
>      <property name="handler">
>       <bean class="org.mortbay.jetty.handler.ResourceHandler">
>        <property name="baseResource">
>         <bean class="org.mortbay.resource.FileResource">
>          <constructor-arg value="${staticResourceURL}" />
>         </bean>
>         </property>
>       </bean>
>      </property>
>     </bean>
>    </httpj:handlers>
>   </httpj:engine>
>  </httpj:engine-fa



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog