Project

General

Profile

Bug #9567

AppServer: NPE on server shutdown prevents server shutdown

Added by Vladimir Tsichevski over 1 year ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
15654
version_resolved:
reviewer:
production:
No
env_name:
topics:

History

#1 Updated by Vladimir Tsichevski over 1 year ago

  • version_reported set to 15654
  • Priority changed from Low to Normal
  • Subject changed from AppServer: NPE on server shutdown to AppServer: NPE on server shutdown prevents server shutdown

I was shutting down a customer application, which runs application server instances.
I used the -k option passed to server.sh.
The application was started from Eclipse in Debug mode, so I was able to intercept unexpected exceptions.
I've got a NPE here:

Daemon Thread [queueStopper] (Suspended (exception NullPointerException))    
    owns: HashMap<K,V>  (id=275)    
    owns: LinkedList<E>  (id=276)    
    SecurityManager$SessionSecurityManager.getSessionId() line: 6801    
    AppServerManager$2.terminate(Session) line: 908    
    DirectSession(BaseSession).sendTerminationEvent() line: 523    
    RouterSessionManager(SessionManager).endSession(BaseSession, boolean, boolean) line: 1385    
    SessionManager$Stopper.run() line: 1924    
    Thread.run() line: 750    

The code at that point is:

      public Integer getSessionId()
      {
         // Pick up the generation of security cache
         SecurityContextStack ctxs = SecurityContextStack.getContext(); // this returns null!
         SecurityContext ctx = ctxs.getEffectiveContext();

         return (ctx != null) ? ctx.getSessionId() : null;
      }

In the server output I see:

Exception: java.lang.NullPointerException thrown from the UncaughtExceptionHandler in thread "queueStopper" 

And the server was not shut down.

#2 Updated by Vladimir Tsichevski over 1 year ago

UPD: this issue happens only if a client is connected (I tested with WEB client).
If the server is shut down right after it was started, it is closed with no issues.

Also available in: Atom PDF