Hi,

I am using Shiro 1.2.0 in an App Engine project, and have run into some
issues with extremely long instance startup times (it frequently reaches the
60 second limit and times out entirely). It looks like it is Shiro-related
from the server logs (excerpt):

D 2012-08-29 13:38:52.691
org.apache.shiro.web.env.IniWebEnvironment getDefaultIni: Discovered
non-empty INI configuration at location '/WEB-INF/shiro.ini'.  Using for
configuration.
D 2012-08-29 13:38:53.596
org.apache.shiro.config.IniFactorySupport createInstance: Creating instance
from Ini [sections=main]
D 2012-08-29 13:39:14.337
org.apache.shiro.web.filter.authc.FormAuthenticationFilter setLoginUrl:
Adding login url to applied paths.
D 2012-08-29 13:39:29.246
org.apache.commons.beanutils.converters.AbstractConverter setDefaultValue:
Setting default value: false

As you can see it takes 20 seconds IniFactorySupport.createInstance to the
next log line. I have two realms in my shiro.ini file:

# =======================
# Shiro INI configuration
# =======================

[main]
# Objects and their properties are defined here, 
# Such as the securityManager, Realms and anything
# else needed to build the SecurityManager

# password hashing specification
sha256Matcher = org.apache.shiro.authc.credential.HashedCredentialsMatcher
sha256Matcher.hashAlgorithmName=SHA-256

dsRealm = com.gebweb.items.server.DatastoreRealm
dsRealm.credentialsMatcher = $sha256Matcher

fbCredentialsMatcher =
com.gebweb.items.server.facebook.FacebookCredentialsMatcher
fbRealm = com.gebweb.items.server.facebook.FBRealm
fbRealm.credentialsMatcher = $fbCredentialsMatcher
securityManager.realms = $dsRealm, $fbRealm

[users]
# The 'users' section is for simple deployments
# when you only need a small number of statically-defined 
# set of User accounts.

[roles]
# The 'roles' section is for simple deployments
# when you only need a small number of statically-defined
# roles.

[urls]
# The 'urls' section is used for url-based security
# in web applications.  We'll discuss this section in the
# Web documentation

I've searched around, and found no-one with the same problem, so I think I'm
doing something wrong. I have a couple of theories at this point:
1. I'm running out of memory and there is some disk swapping going on (but I
have tried doubling the available RAM from 128 MB to 256 MB and it makes no
difference).
2. There is a problem with one of the Realms (I tried commenting out each
realm from the .ini file one by one, but both attempts yielded similar
results - maybe both are broken?)
3. Parsing annotations is causing the slowness. I don't know how to
configure Shiro so annotations are turned off. If anyone knows, I'd be happy
to try it.

Full stacktrace (and logs) + the custom realms references from the shiro.ini
file are available at http://gebweb.net/shiro/ .

Would much appreciate it if anyone has any ideas.

Geir



--
View this message in context: 
http://shiro-user.582556.n2.nabble.com/Slow-shiro-initialization-on-Google-App-Engine-tp7577760.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply via email to