Scenario:You're importing an archive to JasperReports® Server in a Unix system and you get an access denied error related to ehache: |
[toc] |
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehCacheBasedJasperServerAclCache' defined in file [/tmp/jasperreports-server-pro-6.3.2-bin/buildomatic/conf_source/iePro/applicationContext-security.xml]: Cannot resolve reference to bean 'aclCache' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aclCache' defined in file [/tmp/jasperreports-server-pro-6.3.2-bin/buildomatic/conf_source/iePro/applicationContext.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: java.io.IOException: Permission denied // {factory} = org.springframework.beans.factory.support // at {factory}.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:334) at {factory}.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) at {factory}.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:651) at {factory}.ConstructorResolver.autowireConstructor(ConstructorResolver.java:145) at {factory}.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1077) at {factory}.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:981) at {factory}.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487) at {factory}.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at {factory}.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) at {factory}.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at {factory}.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) at {factory}.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191) at {factory}.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) ... 212 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aclCache' defined in file [/tmp/jasperreports-server-pro-6.3.2-bin/buildomatic/conf_source/iePro/applicationContext.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: java.io.IOException: Permission denied at {factory}.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1514) at {factory}.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521) at {factory}.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at {factory}.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) at {factory}.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at {factory}.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) at {factory}.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191) at {factory}.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) ... 224 more Caused by: net.sf.ehcache.CacheException: java.io.IOException: Permission denied at net.sf.ehcache.DiskStorePathManager$DiskStorePath.<init>(DiskStorePathManager.java:331) at net.sf.ehcache.DiskStorePathManager.resolveAndLockIfNeeded(DiskStorePathManager.java:145) at net.sf.ehcache.DiskStorePathManager.getFile(DiskStorePathManager.java:262) at net.sf.ehcache.DiskStorePathManager.getFile(DiskStorePathManager.java:251) at net.sf.ehcache.store.disk.DiskStorageFactory.<init>(DiskStorageFactory.java:125) at net.sf.ehcache.store.disk.DiskStore.create(DiskStore.java:156) at net.sf.ehcache.store.DiskBackedMemoryStore.createDiskStore(DiskBackedMemoryStore.java:61) at net.sf.ehcache.store.DiskBackedMemoryStore.create(DiskBackedMemoryStore.java:49) at net.sf.ehcache.Cache.initialise(Cache.java:1097) at net.sf.ehcache.CacheManager.initializeEhcache(CacheManager.java:1298) at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:1329) at net.sf.ehcache.CacheManager.addCache(CacheManager.java:1227) at org.springframework.cache.ehcache.EhCacheFactoryBean.afterPropertiesSet(EhCacheFactoryBean.java:356) at {factory}.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1573) at {factory}.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511) ... 231 more Caused by: java.io.IOException: Permission denied at java.io.UnixFileSystem.createFileExclusively(Native Method) at java.io.File.createNewFile(File.java:1006) at net.sf.ehcache.DiskStorePathManager$DiskStorePath.<init>(DiskStorePathManager.java:322) ... 245 more
Solution:
This happens when you don't have sufficient permissions for the temp folder. The solution is either one of these:
-
If you insatlled JasperServer as root user, use sudo to execute the import script
-
If you cannot use the root user, make sure the system temp folder has all the permissions for the user executing the script
-
If you cannot assign permissions to the folder, you can select a different folder to be used for temp. Try to pass a different java.io.tmpdir variable to the import-export script JVM. To do that edit the js-import.sh and find the line with JAVA_OPTS and edit it like this:
export JAVA_OPTS="$JAVA_OPTS -Xms128m -Xmx512m -XX:PermSize=32m -XX:MaxPermSize=128m -Djava.io.tmpdir=/new/tmp/dir/with/permissions/for/user/maybe/home/directory”
Here, you pass a new -Djava.io.tmpdir location. In general though you need to make sure your user has complete permissions over the system temp folder (read/write/delete). Make sure the folder is empty too.
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now