[Geoserver-devel] [JIRA] (GEOS-10474) OpenID Connect fails with error "Provider for javax.xml.stream.XMLOutputFactory cannot be found"

Andre Zielinski created an issue

GeoServer / BugGEOS-10474

OpenID Connect fails with error “Provider for javax.xml.stream.XMLOutputFactory cannot be found”

Issue Type:

BugBug

Affects Versions:

2.19.6, 2.20.4

Assignee:

Unassigned

Components:

OAuth2

Created:

27/Apr/22 9:31 AM

Environment:

Windows Server 2019 with Redhat JRE 8 and Apache Tomcat 9.0.62

Priority:

MediumMedium

Reporter:

Andre Zielinski

When upgrading ot the latest GeoServer installation (2.20.4 or 2.19.6) the integration of the auth2-openid-connect-plugin fails with the following error message:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationManager' defined in URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Prod/Tomcat9_0_58/webapps/geoserver_test/WEB-INF/lib/gs-main-2.20.4.jar!/applicationSecurityContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'openidConnectAuthenticationProvider' defined in URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Prod/Tomcat9_0_58/webapps/geoserver_test/WEB-INF/lib/gs-sec-oauth2-openid-connect-2.20-SNAPSHOT.jar!/applicationContext.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.geoserver.security.oauth2.OpenIdConnectAuthenticationProvider]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'openIdConnectTokenServices' defined in URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Prod/Tomcat9_0_58/webapps/geoserver_test/WEB-INF/lib/gs-sec-oauth2-openid-connect-2.20-SNAPSHOT.jar!/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.geoserver.security.oauth2.services.OpenIdConnectTokenServices]: Constructor threw exception; nested exception is javax.xml.stream.FactoryConfigurationError: Provider for javax.xml.stream.XMLOutputFactory cannot be found
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109)
	at org.geoserver.platform.GeoServerExtensions.getBean(GeoServerExtensions.java:209)
	at org.geoserver.platform.GeoServerExtensions.extensions(GeoServerExtensions.java:126)
	at org.geoserver.platform.GeoServerExtensions.bean(GeoServerExtensions.java:288)
	at org.geoserver.platform.GeoServerExtensions.bean(GeoServerExtensions.java:272)
	at org.geoserver.config.util.XStreamPersister.getSecurityManager(XStreamPersister.java:634)
	at org.geoserver.config.util.XStreamPersister$StoreInfoConverter.doUnmarshal(XStreamPersister.java:1870)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:277)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
	... 142 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'openidConnectAuthenticationProvider' defined in URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Prod/Tomcat9_0_58/webapps/geoserver_test/WEB-INF/lib/gs-sec-oauth2-openid-connect-2.20-SNAPSHOT.jar!/applicationContext.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.geoserver.security.oauth2.OpenIdConnectAuthenticationProvider]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'openIdConnectTokenServices' defined in URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Prod/Tomcat9_0_58/webapps/geoserver_test/WEB-INF/lib/gs-sec-oauth2-openid-connect-2.20-SNAPSHOT.jar!/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.geoserver.security.oauth2.services.OpenIdConnectTokenServices]: Constructor threw exception; nested exception is javax.xml.stream.FactoryConfigurationError: Provider for javax.xml.stream.XMLOutputFactory cannot be found
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:314)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:295)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1361)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1208)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109)
	at org.geoserver.platform.GeoServerExtensions.getBean(GeoServerExtensions.java:209)
	at org.geoserver.platform.GeoServerExtensions.extensions(GeoServerExtensions.java:126)
	at org.geoserver.security.GeoServerSecurityManager.lookupSecurityProviders(GeoServerSecurityManager.java:2613)
	at org.geoserver.security.GeoServerSecurityManager.buildPersister(GeoServerSecurityManager.java:2673)
	at org.geoserver.security.GeoServerSecurityManager.setApplicationContext(GeoServerSecurityManager.java:353)
	at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:123)
	at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:100)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:415)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1791)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
	... 156 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.geoserver.security.oauth2.OpenIdConnectAuthenticationProvider]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'openIdConnectTokenServices' defined in URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Prod/Tomcat9_0_58/webapps/geoserver_test/WEB-INF/lib/gs-sec-oauth2-openid-connect-2.20-SNAPSHOT.jar!/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.geoserver.security.oauth2.services.OpenIdConnectTokenServices]: Constructor threw exception; nested exception is javax.xml.stream.FactoryConfigurationError: Provider for javax.xml.stream.XMLOutputFactory cannot be found
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:220)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:310)
	... 176 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'openIdConnectTokenServices' defined in URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Prod/Tomcat9_0_58/webapps/geoserver_test/WEB-INF/lib/gs-sec-oauth2-openid-connect-2.20-SNAPSHOT.jar!/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.geoserver.security.oauth2.services.OpenIdConnectTokenServices]: Constructor threw exception; nested exception is javax.xml.stream.FactoryConfigurationError: Provider for javax.xml.stream.XMLOutputFactory cannot be found
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1323)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1218)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109)
	at org.geoserver.security.oauth2.GeoServerOAuthAuthenticationProvider.<init>(GeoServerOAuthAuthenticationProvider.java:50)
	at org.geoserver.security.oauth2.OpenIdConnectAuthenticationProvider.<init>(OpenIdConnectAuthenticationProvider.java:21)
	at sun.reflect.GeneratedConstructorAccessor690.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:207)
	... 178 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.geoserver.security.oauth2.services.OpenIdConnectTokenServices]: Constructor threw exception; nested exception is javax.xml.stream.FactoryConfigurationError: Provider for javax.xml.stream.XMLOutputFactory cannot be found
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:220)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1315)
	... 192 more
Caused by: javax.xml.stream.FactoryConfigurationError: Provider for javax.xml.stream.XMLOutputFactory cannot be found
	at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:324)
	at javax.xml.stream.XMLOutputFactory.newFactory(XMLOutputFactory.java:263)
	at com.fasterxml.jackson.dataformat.xml.XmlFactory.<init>(XmlFactory.java:124)
	at com.fasterxml.jackson.dataformat.xml.XmlFactory.<init>(XmlFactory.java:101)
	at com.fasterxml.jackson.dataformat.xml.XmlFactory.<init>(XmlFactory.java:92)
	at com.fasterxml.jackson.dataformat.xml.XmlMapper.<init>(XmlMapper.java:141)
	at org.springframework.http.converter.json.Jackson2ObjectMapperBuilder$XmlObjectMapperInitializer.create(Jackson2ObjectMapperBuilder.java:888)
	at org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.build(Jackson2ObjectMapperBuilder.java:647)
	at org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter.<init>(MappingJackson2XmlHttpMessageConverter.java:52)
	at org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter.<init>(AllEncompassingFormHttpMessageConverter.java:86)
	at org.springframework.web.client.RestTemplate.<init>(RestTemplate.java:145)
	at org.springframework.security.oauth2.provider.token.RemoteTokenServices.<init>(RemoteTokenServices.java:64)
	at org.geoserver.security.oauth2.GeoServerOAuthRemoteTokenServices.<init>(GeoServerOAuthRemoteTokenServices.java:54)
	at org.geoserver.security.oauth2.services.OpenIdConnectTokenServices.<init>(OpenIdConnectTokenServices.java:27)
	at sun.reflect.GeneratedConstructorAccessor691.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:207)
	... 194 more

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100198-sha1:e4e2d96)

Atlassian logo