1

i'm currently fighting with TomEE, JSF and CDI (i think).

Is there any example out there which has "@javax.enterprise.context.SessionScoped" annotation using TomEE 1.5.1 (or current snapshot)?

I DONT want to use @ManagedBean or something else from javax.faces, just plain CDI.

My problem is: when i change some @SessionScoped user session instance i end up in having a new sessionID (session fixation problem?!?).

My Use-Case: I want to have a login on one page and have the possability to login from anywhere, the user comes from a JPA-layer which scope i don't know exactly if have to choose.

Is there another way to archieve this?!

I already got this pages, but didn't helped me out:

http://openejb.979440.n4.nabble.com/Guest-user-td4655258i20.html

https://issues.apache.org/jira/browse/TOMEE-734

https://issues.apache.org/jira/browse/TOMEE-745

Thanks for any help!

FibreFoX
  • 2,858
  • 1
  • 19
  • 41

2 Answers2

1

After a lot of time i created my own "proof-of-concept"-example working with cdi-beans:

https://github.com/FibreFoX/cdi-sessionscoped-login

I hope it will help others, like it helped me while developing that piece of awesome :)

FibreFoX
  • 2,858
  • 1
  • 19
  • 41
  • i updated my github, now its with cdi-producer and with surefire and failsafe tests configured for sonar-report via jacoco – FibreFoX Feb 19 '13 at 22:06
  • Hi - I am facing the same problem. How did you resolve it ? Was it the producer ? See here: http://stackoverflow.com/questions/38661685/sessionscoped-cdi-bean-is-a-different-instance-when-injected – Tim Aug 03 '16 at 10:56
0

I Use TomEE but I don't understand your problem. Do you use the web-profile?

Did you setup beans.xml correctly?

The bugs you linked are unrelated probably your setup. Impossible to say since I don't have anything to go on. Link a sample project I can try or at least paste your bean and tell were you put beans.xml

Karl Kildén
  • 2,415
  • 22
  • 34
  • I didn't asked for any help for my existing project, i wanted to see some working examples. Nevertheless i helped myself (with some sources from deep inside the internet), i will upload it later, because i think that examples are missed (IMHO) – FibreFoX Jan 30 '13 at 08:55
  • There's plenty of it for CDI with Tomcat. tomEE is that but simpler – Karl Kildén Jan 30 '13 at 09:06