SessionGuard

Hi Henrik,
We redeployed a version with the recompiled wigetset and it does not work for us. We still have the red “Session Expired” box after 30 minutes of inactivity.

We use Tomcat 6, and Vaadin 6.5.4.

You can check at BlackBeltFactory.com

Any idea how to debug this?
Many thanks.
John.

I have no direct hunch as to why it shouldn’t work. I developed this with Tomcat 6 (changing this, I feel, should be the only reason why it would break) but with an earlier version of Vaadin.

Just a sanity check: Is the component ‘visible’ at all times? Since this is a client-side component, you need to have the component present in all views you have. So, it doesn’t suffice to have it added to a layout once, and then be done with it.

I’ll look into this tomorrow (Friday) and I’ll report back as soon as I get something out of this. Sorry for your troubles :frowning:

Running on the Tomcat and Vaadin versions you named, my test application doesn’t fail :confused:

One thing you could check is to make sure that the following code (try it from your Application’s init()-method) results to the equal to the timeout in minutes you have configured for Tomcat:

((WebApplicationContext) getContext()).getHttpSession().getMaxInactiveInterval() / 60

If it does, I’m stumped. If it doesn’t, however, that’s a possible problem. If you have not defined the servlet’s timeout in the web.xml, you should try to do that, by adding the following lines underneath the closing tag :

<session-config>
  <session-timeout>5</session-timeout>
</session-config>

How do you check that?

Yes, it does.

Well, the most reliable way is to go to the view where the session guarding fails, and check the DOM structure in the browser for an element having a sessionguard class name. FireBug works perfectly for this, but Chrome has something similar built-in.

But basically what you want to do is that you make sure that the layout you add the SessionGuard into is never removed from the component tree. The way I do it is to add the SessionGuard directly to the main window, and make sure that view changes don’t change the main window’s layout, but another layout that’s a sibling to the SessionGuard.

If you’ve ever used a globally functioning UriFragmentUtility, the idea is exactly the same.

The sessionguard was not there.

In the Application, I did add SessionGuard to the main Window.
But later, Navigator7 called Window.setContent() which removed the layout containing the session guard.
The right place for me is to instantiate the SessionGuard in my descendant of NavigableApplicationWindow.createComponent() method.

Now sessionguard is there, and it seems to work.

Thank you Henrik!

No problem John! I’m just glad that you got the thing sorted out.

Would be great if the add-on allowed custom handling of the timeout. For me, displaying just the notification is not enough. I would like to be able to set a listener to the SessionGuard component which would notify me when the time runs out and I could perform any arbitrary action.

But anyway it’s a great add-on, keep up the good work!

Hi,

I was using SessionGuard together with some other add-ons and it worked as expected. Now I’m also using
ICEPush
and since then the SessionGuard Warning message shows up and is counting down but when the timeout is over, the warning message vanishes and the red message box (saying the session timed out) is
not
displayed any more! In addition, I can still work in my application.
To give more details: in the above scenario I have never
pushed

Is it possible to get these two add-ons working together or are they fighting against each other?

Regards

Andreas

Just another question regarding this problem:

Is it maybe possible, that SessionGuard is terminating the session, when the countdown ended? If yes, how can I achieve this (my knowledge about client components is very limited)? I would be glad if someone could point me to the right place (source code) to do that.

Have a nice weekend

Andreas

Hi Paul,

I am having the same problem. But I am using Eclipse IDE. I am not using any widget set. I am using sessionguard in a maven project. I have added the dependency in the pom.xml. But now I get the same error as Mourid SMIDA.

Please suggest me a solution.

Thanks
Ayesha

WidgetSet fails to compile with 0.0.6.7. If I exclude SessionGuard from the WidgetSet, it compiles without problems.


[INFO]
    Validating units:
[INFO]
       [ERROR]
 Errors in 'jar:file:/C:/Users/aleksandr.tarutin/.m2/repository/org/vaadin/addons/sessionguard/0.0.6.7/sessionguard-0.0.6.7.jar!/com/github/wolfie/sessionguard/client/SessionGuardConnector.java'
[INFO]
          [ERROR]
 Line 6: The import com.vaadin.terminal.gwt.client.communication cannot be resolved
[INFO]
          [ERROR]
 Line 7: The import com.vaadin.terminal.gwt.client.communication cannot be resolved
[INFO]
          [ERROR]
 Line 8: The import com.vaadin.terminal.gwt.client.communication cannot be resolved
[INFO]
          [ERROR]
 Line 9: The import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector cannot be resolved
[INFO]
          [ERROR]
 Line 10: The import com.vaadin.terminal.gwt.client.ui.Connect cannot be resolved
[INFO]
          [ERROR]
 Line 12: Connect cannot be resolved to a type
[INFO]
          [ERROR]
 Line 12: The attribute value is undefined for the annotation type Connect
[INFO]
          [ERROR]
 Line 13: AbstractComponentConnector cannot be resolved to a type
[INFO]
          [ERROR]
 Line 16: ClientRpc cannot be resolved to a type
[INFO]
          [ERROR]
 Line 23: The method init() of type SessionGuardConnector must override or implement a supertype method
[INFO]
          [ERROR]
 Line 24: AbstractComponentConnector cannot be resolved to a type
[INFO]
          [ERROR]
 Line 26: The method registerRpc(Class<SessionGuardConnector.SessionGuardClientRpc>, new SessionGuardConnector.SessionGuardClientRpc(){}) is undefined for the type SessionGuardConnector
[INFO]
          [ERROR]
 Line 38: The method createWidget() of type SessionGuardConnector must override or implement a supertype method
[INFO]
          [ERROR]
 Line 57: MethodInvocation cannot be resolved to a type
[INFO]
          [ERROR]
 Line 57: MethodInvocation cannot be resolved to a type
[INFO]
          [ERROR]
 Line 58: The method getConnectorId() is undefined for the type SessionGuardConnector
[INFO]
          [ERROR]
 Line 61: The method getConnection() is undefined for the type SessionGuardConnector
[INFO]
          [ERROR]
 Line 63: The method getConnection() is undefined for the type SessionGuardConnector
[INFO]
          [ERROR]
 Line 69: The method getWidget() of type SessionGuardConnector must override or implement a supertype method
[INFO]
          [ERROR]
 Line 70: AbstractComponentConnector cannot be resolved to a type
[INFO]
          [ERROR]
 Line 74: The method getState() of type SessionGuardConnector must override or implement a supertype method
[INFO]
          [ERROR]
 Line 75: AbstractComponentConnector cannot be resolved to a type
[INFO]
          [ERROR]
 Line 79: The method onStateChanged(StateChangeEvent) of type SessionGuardConnector must override or implement a supertype method
[INFO]
          [ERROR]
 Line 79: StateChangeEvent cannot be resolved to a type
[INFO]
       [ERROR]
 Errors in 'jar:file:/C:/Users/aleksandr.tarutin/.m2/repository/org/vaadin/addons/sessionguard/0.0.6.7/sessionguard-0.0.6.7.jar!/com/github/wolfie/sessionguard/client/SessionGuardServerRpc.java'
[INFO]
          [ERROR]
 Line 3: The import com.vaadin.terminal.gwt.client.communication cannot be resolved
[INFO]
          [ERROR]
 Line 5: ServerRpc cannot be resolved to a type
[INFO]
       [ERROR]
 Errors in 'jar:file:/C:/Users/aleksandr.tarutin/.m2/repository/org/vaadin/addons/sessionguard/0.0.6.7/sessionguard-0.0.6.7.jar!/com/github/wolfie/sessionguard/client/SessionGuardState.java'
[INFO]
          [ERROR]
 Line 3: The import com.vaadin.terminal.gwt.client.ComponentState cannot be resolved
[INFO]
          [ERROR]
 Line 5: ComponentState cannot be resolved to a type
[INFO]
       [ERROR]
 Errors in 'jar:file:/C:/Users/aleksandr.tarutin/.m2/repository/org/vaadin/addons/sessionguard/0.0.6.7/sessionguard-0.0.6.7.jar!/com/github/wolfie/sessionguard/client/ui/VSessionGuard.java'
[INFO]
          [ERROR]
 Line 21: The import com.vaadin.terminal.gwt.client.ui.notification cannot be resolved
[INFO]
          [ERROR]
 Line 55: VNotification cannot be resolved to a type
[INFO]
          [ERROR]
 Line 55: VNotification cannot be resolved
[INFO]
          [ERROR]
 Line 102: VNotification cannot be resolved to a type
[INFO]
          [ERROR]
 Line 105: VNotification cannot be resolved
[INFO]
    [ERROR]
 Aborting compile due to errors in some input files
[INFO]
 ------------------------------------------------------------------------
[INFO]
 BUILD FAILURE
[INFO]
 ------------------------------------------------------------------------

Any clues?

Thank you,

AT.

Seems that this addon has only been updated to an alpha/beta version of vaadin 7, and is not compatible with the final vaadin 7 version.

Seems so… Any idea if work is underway?

AT.

Has anybody idea how to run this add ons with vaadin 7.0.3 ? Please help me !

The SessionGuard isn’t ported to nor supported for Vaadin 7, since the built-in heartbeat functionality does essentially the same thing.

We used SessionGuard to display a message to the user some time before the session expires. Any pointers on implementing this with heartbeat feature?

Thank you,

AT.

I don’t think the heartbeat has any hooks to attach to. But the idea of the heartbeat is to never invalidate the session - as long as the browser tab is kept open, the session should never expire (unless i’ve understood something wrong). If you want to actively kill the session after a timeout, I think you need to roll out your own solution.

Thanks.

I couldn’t find anything to hook into with regards to heartbeat. What can be leveraged to implement the kind of functionality that I seek?

AT.

Henrik,

We have many users that are unhappy with the timeout of the application and we feel we have set it to the greatest amount of time we can allow. I see that this is someday going to be integrated into Vaadin. But that has been planned for a long time and now it is on the backlog. Any chance this can be ported to v7? It would be great for us.

Thanks.