What steps will reproduce the problem?
1. Upload app onto GAE/J production server with the configuration to enable
ehcache-spring-annotations.
The followings are snippets relating to ehcache form the used configuration
files.
Spring DispatcherServlet configuration file (WEB-INF\applicationContext.xml):
<beans xmlns="http://www.springframework.org/schema/beans"
...
xmlns:ehcache="http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
...
http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring
http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd
">
...
<!-- For cache -->
<ehcache:annotation-driven />
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="/WEB-INF/ehcache-spring.xml" />
<property name="shared" value="false" />
</bean>
<ehcache:config cache-manager="cacheManager">
<ehcache:evict-expired-elements interval="60" />
</ehcache:config>
<!-- End for cache -->
...
</beans>
ehcache configuration file (WEB-INF\ehcache-spring.xml):
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">
<defaultCache
eternal="true" maxElementsInMemory="100" overflowToDisk="false" />
<cache name="vehicleListCache"
eternal="true" maxElementsInMemory="100" overflowToDisk="false" />
<cache name="vehicleCustomListCache"
eternal="true" maxElementsInMemory="100" overflowToDisk="false" />
</ehcache>
2. Open app's address with browser on client machine.
What is the expected output? What do you see instead?
Expected: app starts without problem.
Happened: hit the exception below:
ERROR o.s.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name
'com.googlecode.ehcache.annotations.config.internalEhCacheEvictionTask':
Invocation of init method failed; nested exception is
java.security.AccessControlException: access denied
(java.lang.RuntimePermission modifyThreadGroup)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-3.0.4.RELEASE.jar:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) ~[spring-beans-3.0.4.RELEASE.jar:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) ~[spring-beans-3.0.4.RELEASE.jar:na]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) ~[spring-beans-3.0.4.RELEASE.jar:na]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-3.0.4.RELEASE.jar:na]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) ~[spring-beans-3.0.4.RELEASE.jar:na]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) ~[spring-beans-3.0.4.RELEASE.jar:na]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) ~[spring-beans-3.0.4.RELEASE.jar:na]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) ~[advisedSpringContext.jar:na]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) ~[advisedSpringContext.jar:na]
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) ~[spring-web-3.0.4.RELEASE.jar:na]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) ~[spring-web-3.0.4.RELEASE.jar:na]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) ~[spring-web-3.0.4.RELEASE.jar:na]
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548) ~[na:na]
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) ~[na:na]
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) ~[na:na]
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) ~[na:na]
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467) ~[na:na]
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) ~[na:na]
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:202) ~[na:na]
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:171) ~[na:na]
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123) ~[na:na]
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:391) ~[na:na]
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:160) ~[na:na]
at java.lang.Thread.run(Thread.java:679) ~[na:1.6.0-google-v4]
Caused by: java.security.AccessControlException: access denied
(java.lang.RuntimePermission modifyThreadGroup)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:355) ~[na:1.6.0-google-v4]
at java.security.AccessController.checkPermission(AccessController.java:567) ~[na:1.6.0-google-v4]
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) ~[na:1.6.0-google-v4]
at com.google.apphosting.runtime.security.CustomSecurityManager.checkPermission(CustomSecurityManager.java:45) ~[na:na]
at com.google.apphosting.runtime.security.CustomSecurityManager.checkAccess(CustomSecurityManager.java:112) ~[na:na]
at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:315) ~[na:1.6.0-google-v4]
at java.lang.Thread.init(Thread.java:353) ~[na:1.6.0-google-v4]
at java.lang.Thread.<init>(Thread.java:437) ~[na:1.6.0-google-v4]
at java.util.TimerThread.<init>(Timer.java:478) ~[na:na]
at java.util.Timer.<init>(Timer.java:100) ~[na:1.6.0-google-v4]
at com.googlecode.ehcache.annotations.impl.ExpiredElementEvictor.afterPropertiesSet(ExpiredElementEvictor.java:126) ~[ehcache-spring-annotations-1.2.0.jar:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$5.run(AbstractAutowireCapableBeanFactory.java:1467) ~[spring-beans-3.0.4.RELEASE.jar:na]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0-google-v4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1465) ~[spring-beans-3.0.4.RELEASE.jar:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417) ~[spring-beans-3.0.4.RELEASE.jar:na]
... 24 common frames omitted
What version of the product are you using? On what operating system?
ehcache-spring-annotations-1.2.0.jar
ehcache-core-2.4.5.jar
Spring 3.0.4
appengine-java-sdk-1.5.4
Please provide any additional information below.
Original issue reported on code.google.com by art...@gmail.com on 5 Oct 2011 at 1:54
Original issue reported on code.google.com by
art...@gmail.com
on 5 Oct 2011 at 1:54