Hi,
we have to use GeoServer with enabled SecurityManager and had no problem with this including GeoServer Version 2.10.
Since version 2.11 in this situation geoserver startup fails. Logging entries let us suppose there is a wrong configuration in catalina.policy
But this would be the right (and it works with geoserver 2.10):
permission java.io.FilePermission “${catalina.base}/-”, “read,write,delete”;
and even
the same with “<>” makes no difference.
An interesting fact is: When starting the first time with an geoserver.war without an datadir, geoserver starts normal, creates the default datadir with an default content. But after an restart – then datadir is already here – geoserver will not come up again with the following log messages. There is mentioned a file named “… simple_roads.xml.xml” – but I suppose, the double “.xml.xml” is a wrong logging information. Of course I tryed with renamed file.
When not using the SecurityManager there is no problem…
Has anyone an idea how to get this work?
Regards,
Stefan
Tomcat 8.0.41
Java 1.8.0_111
Windows 7
GeoServer 2.11…, 2.12… (tested geoserver out of the box without own configurations)
from catalina log:
SCHWERWIEGEND [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/geoserver2-12-1] startup failed due to previous errors
from localhost.log:
SCHWERWIEGEND [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.geoserver.platform.GeoServerContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘GWCGeoServerRESTConfigurationProvider’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-gwc-2.12.1.jar!/geowebcache-geoserver-context.xml]: Cannot resolve reference to bean ‘catalog’ while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘localWorkspaceCatalog’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-main-2.12.1.jar!/applicationContext.xml]: Cannot resolve reference to bean ‘advertisedCatalog’ while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘advertisedCatalog’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-main-2.12.1.jar!/applicationContext.xml]: Cannot resolve reference to bean ‘secureCatalog’ while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘accessRulesDao’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-main-2.12.1.jar!/applicationSecurityContext.xml]: Cannot resolve reference to bean ‘rawCatalog’ while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘rawCatalog’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-main-2.12.1.jar!/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: java.security.AccessControlException: access denied (“java.io.FilePermission” “Q:\Programme2\Apache Software Foundation\Tomcat 8.0\webapps\geoserver2-12-1\data\styles\simple_roads.xml.xml” “read”)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:648)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:145)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.geoserver.platform.GeoServerContextLoaderListener.contextInitialized(GeoServerContextLoaderListener.java:23)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)
at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:131)
at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:153)
at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:143)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:727)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘localWorkspaceCatalog’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-main-2.12.1.jar!/applicationContext.xml]: Cannot resolve reference to bean ‘advertisedCatalog’ while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘advertisedCatalog’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-main-2.12.1.jar!/applicationContext.xml]: Cannot resolve reference to bean ‘secureCatalog’ while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘accessRulesDao’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-main-2.12.1.jar!/applicationSecurityContext.xml]: Cannot resolve reference to bean ‘rawCatalog’ while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘rawCatalog’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-main-2.12.1.jar!/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: java.security.AccessControlException: access denied (“java.io.FilePermission” “Q:\Programme2\Apache Software Foundation\Tomcat 8.0\webapps\geoserver2-12-1\data\styles\simple_roads.xml.xml” “read”)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:648)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:145)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
… 35 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘advertisedCatalog’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-main-2.12.1.jar!/applicationContext.xml]: Cannot resolve reference to bean ‘secureCatalog’ while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘accessRulesDao’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-main-2.12.1.jar!/applicationSecurityContext.xml]: Cannot resolve reference to bean ‘rawCatalog’ while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘rawCatalog’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-main-2.12.1.jar!/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: java.security.AccessControlException: access denied (“java.io.FilePermission” “Q:\Programme2\Apache Software Foundation\Tomcat 8.0\webapps\geoserver2-12-1\data\styles\simple_roads.xml.xml” “read”)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:648)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:145)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
… 47 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘accessRulesDao’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-main-2.12.1.jar!/applicationSecurityContext.xml]: Cannot resolve reference to bean ‘rawCatalog’ while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘rawCatalog’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-main-2.12.1.jar!/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: java.security.AccessControlException: access denied (“java.io.FilePermission” “Q:\Programme2\Apache Software Foundation\Tomcat 8.0\webapps\geoserver2-12-1\data\styles\simple_roads.xml.xml” “read”)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:648)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:145)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
… 59 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘rawCatalog’ defined in URL [jar:file:/Q:/Programme2/Apache%20Software%20Foundation/Tomcat%208.0/webapps/geoserver2-12-1/WEB-INF/lib/gs-main-2.12.1.jar!/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: java.security.AccessControlException: access denied (“java.io.FilePermission” “Q:\Programme2\Apache Software Foundation\Tomcat 8.0\webapps\geoserver2-12-1\data\styles\simple_roads.xml.xml” “read”)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
… 73 more
Caused by: java.lang.RuntimeException: java.security.AccessControlException: access denied (“java.io.FilePermission” “Q:\Programme2\Apache Software Foundation\Tomcat 8.0\webapps\geoserver2-12-1\data\styles\simple_roads.xml.xml” “read”)
at org.geoserver.config.GeoServerLoader.postProcessBeforeInitialization(GeoServerLoader.java:270)
at org.geoserver.config.GeoServerLoaderProxy.postProcessBeforeInitialization(GeoServerLoaderProxy.java:59)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1620)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
… 79 more
Caused by: java.security.AccessControlException: access denied (“java.io.FilePermission” “Q:\Programme2\Apache Software Foundation\Tomcat 8.0\webapps\geoserver2-12-1\data\styles\simple_roads.xml.xml” “read”)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at sun.nio.fs.WindowsPath.checkRead(Unknown Source)
at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(Unknown Source)
at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.readAttributes(Unknown Source)
at java.nio.file.Files.readAttributes(Unknown Source)
at org.geoserver.platform.resource.FileSystemResourceStore$FileSystemResource.getType(FileSystemResourceStore.java:434)
at org.geoserver.platform.resource.Resources.exists(Resources.java:52)
at org.geoserver.config.GeoServerLoader.lambda$loadStyles$2(GeoServerLoader.java:872)
at org.geoserver.config.AsynchResourceIterator.lambda$new$0(AsynchResourceIterator.java:97)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ReduceOps$ReduceTask.doLeaf(Unknown Source)
at java.util.stream.ReduceOps$ReduceTask.doLeaf(Unknown Source)
at java.util.stream.AbstractTask.compute(Unknown Source)
at java.util.concurrent.CountedCompleter.exec(Unknown Source)
at java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source)
at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)