i have a sesscion scoped bean in 2 Rest-Services, but the bean isn't SessionScoped. With JSF all works fine, but if i use RestEasy i get 2 different instances in the Services. The SessionScoped doesn't work =(.
Example:
Client
publicclassRestClient{privatestaticfinalStringuri="http://localhost:8080/xxRest";publicstaticvoidmain(String[]args){// this initialization only needs to be done once per VMRegisterBuiltin.register(ResteasyProviderFactory.getInstance());CookieHandler.setDefault(newCookieManager(null,CookiePolicy.ACCEPT_ALL));Service1service1=ProxyFactory.create(Service1.class,uri);Service2service2=ProxyFactory.create(Service2.class,uri);service1.putName("Hello World");System.out.println(service1.getName());System.out.println(service2.getName());}}
Could you please raise a JIRA issue in the official RESTEasy issue tracker? https://issues.jboss.org/browse/RESTEASY
I will take a look. Also, If you could attach the java project there, it would be awesome.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
i have a sesscion scoped bean in 2 Rest-Services, but the bean isn't SessionScoped. With JSF all works fine, but if i use RestEasy i get 2 different instances in the Services. The SessionScoped doesn't work =(.
Example:
Client
On server side:
Bean
Service 1
Service 2
The log output is
Hello World
null -> =(
if it helps, i can send the java project.
I think the magic is in the FacesServlet, because with JSF it works fantasticly.
Thanks for help =)
Could you please raise a JIRA issue in the official RESTEasy issue tracker? https://issues.jboss.org/browse/RESTEASY
I will take a look. Also, If you could attach the java project there, it would be awesome.