Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Keep the sessions after a redeploy

Please open a bug for this in bugzilla

Cheers
Jesse

On Wednesday, December 15, 2010, Filipe Sousa <natros@xxxxxxxxx> wrote:
> Now I have another problem when I redeploy. Whenever I logout by
> invalidating the session, the CPU is 100% busy.
>
> Here is a thread dump
>
> 2010-12-16 00:07:54
> Full thread dump Java HotSpot(TM) 64-Bit Server VM (17.1-b03 mixed mode):
>
> "RMI TCP Connection(2)-192.168.0.1" daemon prio=10
> tid=0x00007f9250005800 nid=0x277d runnable [0x00007f924befd000]
>    java.lang.Thread.State: RUNNABLE
>         at java.net.SocketInputStream.socketRead0(Native Method)
>         at java.net.SocketInputStream.read(SocketInputStream.java:129)
>         at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
>         at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
>         - locked <0x00007f9319905d08> (a java.io.BufferedInputStream)
>         at java.io.FilterInputStream.read(FilterInputStream.java:66)
>         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:517)
>         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
>         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
>
>    Locked ownable synchronizers:
>         - <0x00007f93198dfba8> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
>
> "JMX server connection timeout 31" daemon prio=10
> tid=0x00007f9244009800 nid=0x2778 in Object.wait()
> [0x00007f924bffe000]
>    java.lang.Thread.State: TIMED_WAITING (on object monitor)
>         at java.lang.Object.wait(Native Method)
>         - waiting on <0x00007f93210ca808> (a [I)
>         at com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout.run(ServerCommunicatorAdmin.java:150)
>         - locked <0x00007f93210ca808> (a [I)
>         at java.lang.Thread.run(Thread.java:662)
>
>    Locked ownable synchronizers:
>         - None
>
> "RMI Scheduler(0)" daemon prio=10 tid=0x00007f9244005800 nid=0x2777
> waiting on condition [0x00007f92c012e000]
>    java.lang.Thread.State: TIMED_WAITING (parking)
>         at sun.misc.Unsafe.park(Native Method)
>         - parking to wait for  <0x00007f9320f1d608> (a
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>         at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
>         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025)
>         at java.util.concurrent.DelayQueue.take(DelayQueue.java:164)
>         at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:609)
>         at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:602)
>         at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>         at java.lang.Thread.run(Thread.java:662)
>
>    Locked ownable synchronizers:
>         - None
>
> "RMI TCP Connection(1)-192.168.0.1" daemon prio=10
> tid=0x00007f9250004000 nid=0x2776 runnable [0x00007f92c0330000]
>    java.lang.Thread.State: RUNNABLE
>         at java.net.SocketInputStream.socketRead0(Native Method)
>         at java.net.SocketInputStream.read(SocketInputStream.java:129)
>         at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
>         at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
>         - locked <0x00007f932111c438> (a java.io.BufferedInputStream)
>         at java.io.FilterInputStream.read(FilterInputStream.java:66)
>         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:517)
>         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
>         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
>
>    Locked ownable synchronizers:
>         - <0x00007f93210c9fb8> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
>
> "RMI TCP Accept-0" daemon prio=10 tid=0x00007f924c01d800 nid=0x2774
> runnable [0x00007f92c0431000]
>    java.lang.Thread.State: RUNNABLE
>         at java.net.PlainSocketImpl.socketAccept(Native Method)
>         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390)
>         - locked <0x00007f93210c99b8> (a java.net.SocksSocketImpl)
>         at java.net.ServerSocket.implAccept(ServerSocket.java:453)
>         at java.net.ServerSocket.accept(ServerSocket.java:421)
>         at sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:34)
>         at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:369)
>         at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:341)
>         at java.lang.Thread.run(Thread.java:662)
>
>    Locked ownable synchronizers:
>         - None
>
> "Attach Listener" daemon prio=10 tid=0x00007f929c001000 nid=0x2772
> waiting on condition [0x0000000000000000]
>    java.lang.Thread.State: RUNNABLE
>
>    Locked ownable synchronizers:
>         - None
>
> "Scanner-2" daemon prio=10 tid=0x00007f9278027000 nid=0x2771 in
> Object.wait() [0x00007f9350a0c000]
>    java.lang.Thread.State: TIMED_WAITING (on object monitor)
>         at java.lang.Object.wait(Native Method)
>         - waiting on <0x00007f9320f798d0> (a java.util.TaskQueue)
>         at java.util.TimerThread.mainLoop(Timer.java:509)
>         - locked <0x00007f9320f798d0> (a java.util.TaskQueue)
>         at java.util.TimerThread.run(Timer.java:462)
>
>    Locked ownable synchronizers:
>         - None
>
> "HashSessionScavenger-1" daemon prio=10 tid=0x00007f9278025800
> nid=0x2770 in Object.wait() [0x00007f935090b000]
>    java.lang.Thread.State: TIMED_WAITING (on object monitor)
>         at java.lang.Object.wait(Native Method)
>         - waiting on <0x00007f9320f7ba88> (a java.util.TaskQueue)
>         at java.util.TimerThread.mainLoop(Timer.java:509)
>         - locked <0x00007f9320f7ba88> (a java.util.TaskQueue)
>         at java.util.TimerThread.run(Timer.java:462)
>
>    Locked ownable synchronizers:
>         - None
>
> "qtp1701700764-24" prio=10 tid=0x00007f934c52c000 nid=0x275f waiting
> on condition [0x00007f92c095c000]
>    java.lang.Thread.State: TIMED_WAITING (parking)
>         at sun.misc.Unsafe.park(Native Method)
>         - parking to wait for  <0x00007f93210829b0> (a
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>         at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
>         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025)
>         at org.eclipse.jetty.util.BlockingArrayQueue.poll(BlockingArrayQueue.java:320)
>         at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:480)
>         at java.lang.Thread.run(Thread.java:662)
>
>    Locked ownable synchronizers:
>         - None
>
> "qtp1701700764-23 - Acceptor0 SelectChannelConnector@0.0.0.0:8080"
> prio=10 tid=0x00007f934c52a000 nid=0x275e runnable
> [0x00007f92c0a5d000]
>    java.lang.Thread.State: RUNNABLE
>         at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
>         at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:210)
>         at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:65)
>         at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
>         - locked <0x00007f9320feb690> (a sun.nio.ch.Util$1)
>         - locked <0x00007f9320feb678> (a java.util.Collections$UnmodifiableSet)
>         - locked <0x00007f9320fd11b8> (a sun.nio.ch.EPollSelectorImpl)
>         at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
>         at org.eclipse.jetty.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:481)
>         at org.eclipse.jetty.io.nio.SelectorManager.doSelect(SelectorManager.java:219)
>         at org.eclipse.jetty.server.nio.SelectChannelConnector.accept(SelectChannelConnector.java:122)
>         at org.eclipse.jetty.server.AbstractConnector$Acceptor.run(AbstractConnector.java:837)
>         at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:451)
>         at java.lang.Thread.run(Thread.java:662)
>
>    Locked ownable synchronizers:
>         - None
>
> "qtp1701700764-22" prio=10 tid=0x00007f934c528000 nid=0x275d waiting
> on condition [0x00007f92c0b5e000]
>    java.lang.Thread.State: TIMED_WAITING (parking)
>         at sun.misc.Unsafe.park(Native Method)
>         - parking to wait for  <0x00007f93210829b0> (a
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>         at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
>         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025)
>         at org.eclipse.jetty.util.BlockingArrayQueue.poll(BlockingArrayQueue.java:320)
>         at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:480)
>         at java.lang.Thread.run(Thread.java:662)
>
>    Locked ownable synchronizers:
>         - None
>
> "qtp1701700764-21" prio=10 tid=0x00007f934c51a000 nid=0x275c waiting
> on condition [0x00007f93501fa000]
>    java.lang.Thread.State: TIMED_WAITING (parking)
>         at sun.misc.Unsafe.park(Native Method)
>         - parking to wait for  <0x00007f93210829b0> (a
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>         at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
>         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025)
>         at org.eclipse.jetty.util.BlockingArrayQueue.poll(BlockingArrayQueue.java:320)
>         at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:480)
>         at java.lang.Thread.run(Thread.java:662)
>
>    Locked ownable synchronizers:
>         - None
>
> "qtp1701700764-20" prio=10 tid=0x00007f934c519000 nid=0x275b waiting
> on condition [0x00007f93502fb000]
>    java.lang.Thread.State: TIMED_WAITING (parking)
>         at sun.misc.Unsafe.park(Native Method)
>         - parking to wait for  <0x00007f93210829b0> (a
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>         at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
>         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025)
>         at org.eclipse.jetty.util.BlockingArrayQueue.poll(BlockingArrayQueue.java:320)
>         at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:480)
>         at java.lang.Thread.run(Thread.java:662)
>
>    Locked ownable synchronizers:
>         - None
>
> "qtp1701700764-19" prio=10 tid=0x00007f934c518800 nid=0x275a waiting
> on condition [0x00007f93503fc000]
>    java.lang.Thread.State: TIMED_WAITING (parking)
>         at sun.misc.Unsafe.park(Native Method)
>         - parking to wait for  <0x00007f93210829b0> (a
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>         at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
>         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025)
>         at org.eclipse.jetty.util.BlockingArrayQueue.poll(BlockingArrayQueue.java:320)
>         at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:480)
>         at java.lang.Thread.run(Thread.java:662)
>
>    Locked ownable synchronizers:
>         - None
>
> "qtp1701700764-18" prio=10 tid=0x00007f934c518000 nid=0x2759 runnable
> [0x00007f93504fa000]
>    java.lang.Thread.State: RUNNABLE
>         at org.eclipse.jetty.util.MultiMap.containsKey(MultiMap.java:316)
>         at org.eclipse.jetty.server.session.HashSessionIdManager.invalidateAll(HashSessionIdManager.java:132)
>         at org.eclipse.jetty.server.session.AbstractSessionManager.removeSession(AbstractSessionManager.java:687)
>         at org.eclipse.jetty.server.session.AbstractSessionManager$Session.invalidate(AbstractSessionManager.java:1048)
>         at org.eclipse.jetty.server.session.HashSessionManager$HashedSession.invalidate(HashSessionManager.java:630)
>         at pt.ipb.ects.server.AuthServiceImpl.logout(AuthServiceImpl.java:40)
>         at pt.ipb.ects.server.AuthServiceImpl$$EnhancerByGuice$$738b5b4d.CGLIB$logout$1(<generated>)
>         at pt.ipb.ects.server.AuthServiceImpl$$EnhancerByGuice$$738b5b4d$$FastClassByGuice$$27af16f.invoke(<generated>)
>         at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228)
>         at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
>         at pt.ipb.ects.server.guice.GwtMethodInterceptor.invoke(GwtMethodInterceptor.java:42)
>         at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
>         at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:44)
>         at pt.ipb.ects.server.AuthServiceImpl$$EnhancerByGuice$$738b5b4d.logout(<generated>)
>         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:597)
>         at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
>         at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:207)
>         at pt.ip
>
>
> On Wed, Dec 15, 2010 at 11:28 PM, Filipe Sousa <natros@xxxxxxxxx> wrote:
>> After much digging I finally managed to solve the problem. For those
>> interested, here's the solution:
>> <Set name="lazyLoad">true</Set>
>> Apparently, version 6 does not require this parameter
>> On Wed, Dec 15, 2010 at 4:53 PM, Filipe Sousa <natros@xxxxxxxxx> wrote:
>>>
>>> Hi,
>>> I'm using embedded jetty 7.2.2 in a project and I need to redeploy without
>>> losing sessions.
>>> I'm using the following contents on file WEB-INF/jetty-web.xml. I am also
>>> using a realm for application security.
>>>
>>> <Set name="sessionHandler">
>>> <New class="org.eclipse.jetty.server.session.SessionHandler">
>>> <Arg>
>>> <New class="org.eclipse.jetty.server.session.HashSessionManager">
>>> <Set name="storeDirectory">/tmp/jetty</Set>
>>> </New>
>>> </Arg>
>>> </New>
>>> </Set>
>>> The redeploy is triggered when I touch a xml file in /contexts folder:
>>> <?xml version="1.0"?>
>>> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
>>> "http://www.eclipse.org/jetty/configure.dtd";>
>>> <Configure class="org.eclipse.jetty.webapp.WebAppContext">
>>> <Set name="contextPath">/guia-ects</Set>
>>> <Set name="resourceBase"><SystemProperty name="jetty.home" default="."
>>> />/WebContent</Set>
>>> </Configure>
>>> After doing a redeploy, I got a NullPointerException when accessing a
>>> protected URL. After tracing the error, I detected that the parameter user
>>> is null
>>> MappedLoginService.class:
>>>  public boolean validate(UserIdentity user)
>>>     {
>>>         if (_users.containsKey(user.getUserPrincipal().getName()))
>>>             return true;
>>>
>>>         if (loadUser(user.getUserPrincipal().getName())!=null)
>>>             return true;
>>>
>>>         return false;
>>>     }
>>> This is the code for running jetty7:
>>> public class JettyServer {
>>> private final String PATH = System.getProperty("user.dir");
>>> private Server server;
>>> private final ContextHandlerCollection handlers = new
>>> ContextHandlerCollection();
>>> private DeploymentManager deploymentManager;
>>> public JettyServer() {
>>> System.setProperty("jetty.home", PATH);
>>> System.setProperty("javax.net.ssl.trustStore", PATH +
>>> "/etc/keystore.jks");
>>> System.setProperty("javax.net.ssl.trustStorePassword", "password");
>>> createServer();
>>> createDeploymentManager();
>>> createContextProvider();
>>> }
>>> private void createContextProvider() {
>>> ContextProvider provider = new ContextProvider();
>>> p--
> Filipe Sousa
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>

-- 
--
jesse mcconnell
jesse.mcconnell@xxxxxxxxx


Back to the top