hi all,

yes, I call the logout method for every session that I have created and the problem remains...

eventually the tomcat shuts down itself after some timeout (or for any other reason that I don't know) but only after at least 15 minutes.

with the jconsole I can see that after the shutdown script it's called there are still 17 or 19 threads running but only 15 or 17 are daemon threads,
the other ones I don't know what they are.

I suspect that the problem is related with this 2 threads that only after they desapear the tomcat will die.

does anyone knows something about this?


thank you all in advance.

cheers,

bruno coelho



On Sep 22, 2009, at 10:11 AM, Nigel Sim wrote:

I get that same issue when I try to download content from jackrabbit via a servlet. No idea why, as the logout is in the "final" clause, and I can assure you that the downloads actually work and close. I bring this up,
because I don't get these straight away, only periodically (on garbage
collection I expect), and on tomcat shutdown. Do you do anything similar?

ObjectContentManager s = null;
InputStream in = null;
try {
   s = getSession();
   Node node = s.getSession().getNodeByUUID(id);

   // Return a blank response
   resp.setStatus(200);
   resp.setContentType("application/octet-stream");
   in = node.getProperty(data).getStream();
   IOUtils.copy(in, out);
   in.close();
   in = null;

   out.close();
} catch (org.apache.jackrabbit.ocm.exception.RepositoryException e) {
       if (e.getCause() instanceof ItemNotFoundException) {
               resp.setStatus(404);
       } else {
               logger.error(e, e);
       }
} catch (RepositoryException e) {
   logger.error(e, e); //e.printStackTrace();
} catch (MalformedURLException e) {
   logger.error(e, e); //e.printStackTrace();
} catch (IOException e) {
   logger.error(e, e); //e.printStackTrace();
} finally {
       if (in != null)
               IOUtils.closeQuietly(in);
   s.logout();
}


2009/9/22 Bruno Coelho <[email protected]>

hi all,

I'm having a problem shutting down the tomcat where the jackrabbit web-app
is deployed.

I have scripted a set of tests to run before and after every change in the
code.

in the script I start tomcat with the startup.sh command.
then I wait until the tomcat finishs loading and then I run the test using
junit.
after that I try to shutdown tomcat using the shutdown.sh script.

in the catalina.out log I can only see some unclosed session and nothing
else:

21.09.2009 15:16:26 *WARN * SessionImpl: Unclosed session detected. The
session was opened here:  (SessionImpl.java, line 1579)
java.lang.Exception: Stack Trace
      at
org.apache.jackrabbit.core.SessionImpl.<init>(SessionImpl.java:239)
      at
org.apache.jackrabbit.core.SessionImpl.<init>(SessionImpl.java:255)
      at
org.apache.jackrabbit.core.XASessionImpl.<init>(XASessionImpl.java: 98)
      at
org .apache .jackrabbit .core.RepositoryImpl.createSessionInstance(RepositoryImpl.java:1456)
      at
org .apache .jackrabbit.core.RepositoryImpl.createSession(RepositoryImpl.java: 943)
      at
org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java: 1358)
      at
org .apache .jackrabbit.rmi.server.ServerRepository.login(ServerRepository.java: 104)
      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:592)
      at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
      at sun.rmi.transport.Transport$1.run(Transport.java:153)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
      at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java: 466)
      at
sun.rmi.transport.tcp.TCPTransport $ConnectionHandler.run(TCPTransport.java:707)
      at java.lang.Thread.run(Thread.java:613)

...
...
...

21.09.2009 15:16:26 *INFO * SearchIndex: Index closed:
/Users/bmcoelho/opt/jackrabbit-repository-test/workspaces/default/ index
(SearchIndex.java, line 678)
21.09.2009 15:16:26 *INFO * DerbyPersistenceManager: Database
'/Users/bmcoelho/opt/jackrabbit-repository-test/workspaces/default/ db'
shutdown. (DerbyPersistenceManager.java, line 330)
21.09.2009 15:16:26 *INFO * RepositoryImpl: workspace 'default' has been
shutdown (RepositoryImpl.java, line 1989)
21.09.2009 15:16:26 *INFO * RepositoryImpl: shutting down workspace
'security'... (RepositoryImpl.java, line 1983)
21.09.2009 15:16:26 *INFO * ObservationDispatcher: Notification of
EventListeners stopped. (ObservationDispatcher.java, line 106)
21.09.2009 15:16:26 *DEBUG* IndexMerger: dispose IndexMerger
(IndexMerger.java, line 218)
21.09.2009 15:16:26 *DEBUG* IndexMerger: quit sent (IndexMerger.java, line
232)
21.09.2009 15:16:26 *INFO * IndexMerger: IndexMerger terminated
(IndexMerger.java, line 347)
21.09.2009 15:16:26 *DEBUG* IndexMerger: IndexMerger thread stopped
(IndexMerger.java, line 245)
21.09.2009 15:16:26 *DEBUG* IndexMerger: merge queue size: 0
(IndexMerger.java, line 247)
21.09.2009 15:16:26 *INFO * SearchIndex: Index closed:
/Users/bmcoelho/opt/jackrabbit-repository-test/workspaces/security/ index
(SearchIndex.java, line 678)
21.09.2009 15:16:26 *INFO * DerbyPersistenceManager: Database
'/Users/bmcoelho/opt/jackrabbit-repository-test/workspaces/security/ db'
shutdown. (DerbyPersistenceManager.java, line 330)
21.09.2009 15:16:26 *INFO * RepositoryImpl: workspace 'security' has been
shutdown (RepositoryImpl.java, line 1989)
21.09.2009 15:16:26 *INFO * DerbyPersistenceManager: Database
'/Users/bmcoelho/opt/jackrabbit-repository-test/version/db' shutdown.
(DerbyPersistenceManager.java, line 330)
21.09.2009 15:16:26 *INFO * RepositoryImpl: Repository has been shutdown
(RepositoryImpl.java, line 1149)
21.09.2009 15:16:26 *INFO * RepositoryStartupServlet:
RepositoryStartupServlet shut down. (RepositoryStartupServlet.java, line
261)
Sep 21, 2009 3:16:26 PM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8180

the last entry looks that the tomcat ended just fine but if I look at the
running process tomcat is still there...

can you help me in the problem?
do you have any idea why this happens?


thank you all in advance.


cheers,
bruno coelho




--
JCU eResearch Centre
School Of Business (IT)
James Cook University

Reply via email to