NPE in ThreadedServer

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

NPE in ThreadedServer

Tony Thompson
I am using Jetty 5.1.6 and this is coming up on occasion.  After looking
at the code, I am not sure how this would happen.  Is there some weird
threading thing going on?

java.lang.NullPointerException
        at
org.mortbay.util.ThreadedServer$Acceptor.run(ThreadedServer.java:661)

Tony


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: NPE in ThreadedServer

Martin Roos
If stop() is called by another thread in the which the 'current' thread is between 659 && 664, the
acceptor can be nullified since there is no synchronization in the stop method where _acceptor is
nullified (finally statement in stop() is out of a syncronization block)

there's always some weird threading thing going on if you use threads (and jetty does use a lot of
threads ....) , don't ask questions like this :)

martin


Tony Thompson wrote:

> I am using Jetty 5.1.6 and this is coming up on occasion.  After looking
> at the code, I am not sure how this would happen.  Is there some weird
> threading thing going on?
>
> java.lang.NullPointerException
>         at
> org.mortbay.util.ThreadedServer$Acceptor.run(ThreadedServer.java:661)
>
> Tony
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: NPE in ThreadedServer

Martin Roos
brrr .... i shouldn't write emails so early in the morning ... my clauses seem quite
"unsynchronized" too ... (too many threads for 1 sleepy head)

anyway, the unsynchronized stop() method a few lines above is nulling the _acceptor which gives you
the NPE. can't see any other way this could happen.

the end.

Martin


martin wrote:

> If stop() is called by another thread in the which the 'current' thread
> is between 659 && 664, the acceptor can be nullified since there is no
> synchronization in the stop method where _acceptor is nullified (finally
> statement in stop() is out of a syncronization block)
>
> there's always some weird threading thing going on if you use threads
> (and jetty does use a lot of threads ....) , don't ask questions like
> this :)
>
> martin
>
>
> Tony Thompson wrote:
>
>> I am using Jetty 5.1.6 and this is coming up on occasion.  After looking
>> at the code, I am not sure how this would happen.  Is there some weird
>> threading thing going on?
>>
>> java.lang.NullPointerException
>>         at
>> org.mortbay.util.ThreadedServer$Acceptor.run(ThreadedServer.java:661)
>>
>> Tony
>>
>>
>> -------------------------------------------------------
>> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
>> files
>> for problems?  Stop!  Download the new AJAX search engine that makes
>> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
>> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
>> _______________________________________________
>> Jetty-support mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/jetty-support
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: NPE in ThreadedServer

Greg Wilkins-5
In reply to this post by Tony Thompson

patch in CVS


Tony Thompson wrote:

> I am using Jetty 5.1.6 and this is coming up on occasion.  After looking
> at the code, I am not sure how this would happen.  Is there some weird
> threading thing going on?
>
> java.lang.NullPointerException
>         at
> org.mortbay.util.ThreadedServer$Acceptor.run(ThreadedServer.java:661)
>
> Tony
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support