views:

172

answers:

1

Hi, i'm using the Apache Shiro as the framework for athetication of my application. I was following the reference at http://www.grails.org/plugin/shiro and my application throws the exception:

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.

java.lang.IllegalStateException: 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. at org.apache.shiro.SecurityUtils.getSecurityManager(SecurityUtils.java:115) at org.apache.shiro.SecurityUtils.getSubject(SecurityUtils.java:57) at br.netsoft.ShiroDbRealmTests.testAutenticarComDadosCorretos(ShiroDbRealmTests.groovy:58) at junit.framework.Test$run.call(Unknown Source)

What i can do?

A: 

This seems to be a known issue - see http://jira.codehaus.org/browse/GRAILSPLUGINS-1980, there are a few suggested workarounds there. Also, this thread sheds some light on potential cause.

Jean Barmash