Well, this question is hard to answer, but i try to give you some options...
You error is from upfront checking... so, i assume your application did not even start, right? Then you are very likely using Production stage or there is some binding eagerly created and that object refers to another in Session
scope, which is problem. So, now you should change all your SessionScope
direct injection to Providers injection as in this example:
Could you change
@Inject
public UserService users;
to
@Inject
public Provider<UserService> userProvider; //and call userProvider.get() when you will need it?
Why so?
SessionScoped
objects are accessible only whitinGuiceFilter.doFilter()
so if you mixing scopes it could end up in some runtime exceptions. Especially, when you changeStage
toProduction
or set some Singletons to eagerly loaded. You can learn more here. It is good practice to useProviders
when mixingScopes
The problem could be that the
Subject
is bind only insideShiroFilter.doFilter()
check my post. Then, if you are outside let sayGuiceFilter
the could be noSubject
bound at that time. Again, try to useProviders
.
Hope, will help a little.