Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No SecurityManager in jobs (nasty exception) #85

Open
kdybicz opened this issue Mar 20, 2017 · 0 comments
Open

No SecurityManager in jobs (nasty exception) #85

kdybicz opened this issue Mar 20, 2017 · 0 comments

Comments

@kdybicz
Copy link

kdybicz commented Mar 20, 2017

Hi,

I'm getting bellow error while trying to use SecurityUtils.subject?.principal in code:

No SecurityManager accessible to the calling code, either bound to the org.apache.shiro.util.ThreadContext or as a vm static singleton.  This is an invalid application configuration.
org.apache.shiro.SecurityUtils in getSecurityManager at line 123
org.apache.shiro.subject.Subject$Builder in <init> at line 627
org.apache.shiro.SecurityUtils in getSubject at line 56

(The code is common for jobs and user iterface.)

I have found possible workaround: http://grails.1312388.n4.nabble.com/Shiro-subject-on-quartz-job-td2280109.html but I would like to have something out of the box, something that will work for all of my jobs.

Does any of you know an sensible way of injectingSecurityManager orSubject in the thread context of all jobs?

Environment:
Grails 2.5.4
Quartz 1.0.2
Tomcat 7
JDK 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant