0

I've defined an @Stateful @StatefulTimeout(value = 2, unit = TimeUnit.HOURS) rest bean so that it can hold a private MyContext userContext; (basically a List<String> holding all previous values passed to the rest bean).

I've launched my webapp in a wildfly 8.1 container on openshift.

Unfortunatly my bean is not working properly.

It seems that the bean is re-created on each call as if the container was unable to relates two calls to the same session. This seems to be confirmed by the fact that there is no cookie nor session id param on the client side.

What could be missing in my app / conf ? Why isn't wildfly automatically creating a user session ?


Edit : sample code : https://github.com/GrmpCerber/testStatefulRest

Cerber
  • 2,649
  • 3
  • 23
  • 40
  • PS. if you don't have a clue because wildfly should deal with it automatically just "+1" this comment or leave your own so that I this is not a normal behavior from wildfly – Cerber Aug 30 '14 at 18:24
  • A code sample could help. Have you tested that bean/sample on other servers such as Glassfish? – Alexander Langer Aug 30 '14 at 18:25
  • @AlexanderLanger I've uploaded a sample : https://github.com/GrmpCerber/testStatefulRest – Cerber Aug 30 '14 at 20:06

1 Answers1

1

Looking at your code sample, it seems you are missing a @SessionScoped annotation, as explained in this answer.

Community
  • 1
  • 1
Alexander Langer
  • 2,743
  • 14
  • 17