Hi Dirk,

You're not doing anything wrong.  Shiro's resource resolution
algorithm (to resolve shiro.ini if it exists) attempts to use the
System ClassLoader as a fallback mechanism if it can't find it in the
current thread context ClassLoader or the current ClassLoader.
Apparently GAE does not allow access to the System ClassLoader.

Please open a Jira[1] issue and we can get it fixed ASAP - it won't be
hard to resolve.

Thanks,

Les

[1] https://issues.apache.org/jira/browse/Shiro

On Tue, Feb 2, 2010 at 10:10 PM, Dirk Jaeckel <[email protected]> wrote:
> Hi!
>
> I was doing the following:
>
> ---- SNIP ------
>
> export CLASSPATH=""
> grails create-app MyApp
> cd MyApp
> grails install-plugin app-engine
> (choosing jdo)
> grails uninstall-plugin tomcat
> grails create-domain-class com.jaeckel.rr.Party
> grails app-engine
> grails set-version 1
> grails install-plugin shiro
> grails quick-start
> grails app-engine package
> $APPENGINE_SDK/bin/appcfg.sh update target/war
> cp ~/shiro-all-1.0-incubating-SNAPSHOT.jar ./lib
>
> ---- SNIP ------
>
> I use the following Version:
> grails 1.2.0
> app-engine plugin 0.8.8
> shiro plugin 1.0.1
> appengine java SDK 1.3.0
>
> Running "grails app-engine" (the development server) gives the following 
> exception and stacktrace:
>
> ---- SNIP ------
> Unable to start Filter: [The configured security manager is not an instance 
> of WebSecurityManager,
> so it can not be used with the Shiro servlet filter.].
>     [java] org.apache.shiro.config.ConfigurationException: The configured 
> security manager is not
> an instance of WebSecurityManager, so it can not be used with the Shiro 
> servlet filter.
>     [java]     at 
> org.apache.shiro.web.servlet.ShiroFilter.ensureSecurityManager(ShiroFilter.java:315)
>     [java]     at 
> org.apache.shiro.web.servlet.ShiroFilter.onFilterConfigSet(ShiroFilter.java:295)
>     [java]     at 
> org.apache.shiro.web.servlet.AbstractFilter.init(AbstractFilter.java:94)
>     [java]     at 
> org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:99)
>     [java]     at 
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
> ---- SNIP ------
>
> Checking the app engine Logs gives me the following exception and stacktrace:
>
> ---- SNIP ------
> javax.servlet.ServletContext log: Initializing Spring root 
> WebApplicationContext
> [Runtime Network Thread] ERROR servlet.AbstractFilter  - Unable to start 
> Filter: [access denied
> (java.lang.RuntimePermission getClassLoader)].
> java.security.AccessControlException: access denied 
> (java.lang.RuntimePermission getClassLoader)
>        at 
> java.security.AccessControlContext.checkPermission(AccessControlContext.java:355)
>        at 
> java.security.AccessController.checkPermission(AccessController.java:567)
>        at java.lang.SecurityManager.checkPermission(Unknown Source)
>        at
> com.google.apphosting.runtime.security.CustomSecurityManager.checkPermission(CustomSecurityManager.java:45)
>        at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)
>        at 
> org.apache.shiro.util.ClassUtils.getResourceAsStream(ClassUtils.java:73)
>        at 
> org.apache.shiro.io.ResourceUtils.loadFromClassPath(ResourceUtils.java:158)
>        at 
> org.apache.shiro.io.ResourceUtils.getInputStreamForPath(ResourceUtils.java:122)
>        at 
> org.apache.shiro.io.ResourceUtils.resourceExists(ResourceUtils.java:92)
>        at 
> org.apache.shiro.config.IniConfiguration.init(IniConfiguration.java:101)
>        at 
> org.apache.shiro.spring.SpringIniWebConfiguration.init(SpringIniWebConfiguration.java:96)
>        at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:47)
>        at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:41)
>        at 
> org.apache.shiro.web.servlet.ShiroFilter.configure(ShiroFilter.java:353)
>        at 
> org.apache.shiro.web.servlet.ShiroFilter.onFilterConfigSet(ShiroFilter.java:287)
>        at 
> org.apache.shiro.web.servlet.AbstractFilter.init(AbstractFilter.java:94)
>        at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:99)
>        at 
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
>        at 
> org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:589)
> ---- SNIP ------
>
> After putting
>
> debug  'org.apache.shiro.io'
>
> into the log-section of Config.groovy I get the additional log line:
>
> [Runtime Network Thread] DEBUG io.ResourceUtils  - Opening resource from 
> class path [shiro.ini]
>
> just before the error.
>
> What am I doing wrong?
>
>
> Best Regards,
> Dirk Jaeckel
>

Reply via email to