Pierre Mauduit ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A585344fb-ece9-47e9-8382-30cea0b98063
 ) *created* an issue

GeoServer ( 
https://osgeo-org.atlassian.net/browse/GEOS?atlOrigin=eyJpIjoiYjNjN2QxNzJlODAwNDY3NDhlMTJjZTlmYTkwODlkM2EiLCJwIjoiaiJ9
 ) / Bug ( 
https://osgeo-org.atlassian.net/browse/GEOS-10906?atlOrigin=eyJpIjoiYjNjN2QxNzJlODAwNDY3NDhlMTJjZTlmYTkwODlkM2EiLCJwIjoiaiJ9
 ) GEOS-10906 ( 
https://osgeo-org.atlassian.net/browse/GEOS-10906?atlOrigin=eyJpIjoiYjNjN2QxNzJlODAwNDY3NDhlMTJjZTlmYTkwODlkM2EiLCJwIjoiaiJ9
 ) Authentication not sent if connection pooling activated ( 
https://osgeo-org.atlassian.net/browse/GEOS-10906?atlOrigin=eyJpIjoiYjNjN2QxNzJlODAwNDY3NDhlMTJjZTlmYTkwODlkM2EiLCJwIjoiaiJ9
 )

Issue Type: Bug Affects Versions: 2.22.2 Assignee: Unassigned Components: WMS 
Created: 24/Mar/23 3:33 PM Environment:

Runtime tested into the ` docker.osgeo.org/geoserver:2.22.2 ( 
http://docker.osgeo.org/geoserver:2.22.2 ) ` docker image

Priority: Medium Reporter: Pierre Mauduit ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A585344fb-ece9-47e9-8382-30cea0b98063
 )

It seems that when trying to access a secured remote WMS with connection 
pooling activated, the basic-authentication is not sent. Indeed, while trying 
to add a Cascaded WMS datastore configured onto a protected WMS, along with a 
correct basic authentication, I got the following stacktrace server-side:

{code}

24 Mar 14:10:42 INFO [ geoserver.web ( http://geoserver.web ) ] - Getting list 
of layers for the WMS store https://protected-wms/mapproxy/service? ( 
https://gdi.telekom.de/mapproxy/service? )
java.lang.RuntimeException: Could not list layers for this store, an error 
occurred retrieving them: null
at 
org.geoserver.web.data.layer.NewLayerPageProvider.getItemsInternal(NewLayerPageProvider.java:181)
at 
org.geoserver.web.data.layer.NewLayerPageProvider.getItems(NewLayerPageProvider.java:60)
at 
org.geoserver.web.wicket.GeoServerDataProvider.getFilteredItems(GeoServerDataProvider.java:190)
at 
org.geoserver.web.data.layer.NewLayerPageProvider.getFilteredItems(NewLayerPageProvider.java:197)
at 
org.geoserver.web.wicket.GeoServerDataProvider.size(GeoServerDataProvider.java:208)
at 
org.geoserver.web.wicket.GeoServerTablePanel$PagerDelegate.updateMatched(GeoServerTablePanel.java:662)
at 
org.geoserver.web.wicket.GeoServerTablePanel$PagerDelegate.<init>(GeoServerTablePanel.java:657)
at 
org.geoserver.web.wicket.GeoServerTablePanel.<init>(GeoServerTablePanel.java:236)
at 
org.geoserver.web.wicket.GeoServerTablePanel.<init>(GeoServerTablePanel.java:105)
at org.geoserver.web.data.layer.NewLayerPage$1.<init>(NewLayerPage.java:111)
at org.geoserver.web.data.layer.NewLayerPage.<init>(NewLayerPage.java:110)
at org.geoserver.web.data.store.WMSStoreNewPage.onSave(WMSStoreNewPage.java:88)
at 
org.geoserver.web.data.store.AbstractWMSStorePage$2.onSubmit(AbstractWMSStorePage.java:212)
at 
org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1.onSubmit(AjaxSubmitLink.java:111)

[…]

Caused by: java.io.IOException
at org.geoserver.catalog.ResourcePool.getWebMapServer(ResourcePool.java:1869)
at 
org.geoserver.catalog.impl.WMSStoreInfoImpl.getWebMapServer(WMSStoreInfoImpl.java:104)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at 
org.geoserver.catalog.impl.ModificationProxy.invoke(ModificationProxy.java:144)
at com.sun.proxy.$Proxy126.getWebMapServer(Unknown Source)
at 
org.geoserver.web.data.layer.NewLayerPageProvider.getItemsInternal(NewLayerPageProvider.java:141)
... 138 more
Caused by: org.geotools.ows.ServiceException: Error while parsing XML.
org.xml.sax.SAXParseException; lineNumber: 28; columnNumber: 3; The element 
type "meta" must be terminated by the matching end-tag "</meta>".
at 
org.geotools.ows.wms.response.WMSGetCapabilitiesResponse.<init>(WMSGetCapabilitiesResponse.java:58)
at 
org.geotools.ows.wms.WMS1_0_0$GetCapsRequest.createResponse(WMS1_0_0.java:230)
at 
org.geotools.data.ows.AbstractOpenWebService.internalIssueRequest(AbstractOpenWebService.java:461)
at org.geotools.ows.wms.WebMapServer.issueRequest(WebMapServer.java:450)
at 
org.geotools.data.ows.AbstractOpenWebService.negotiateVersion(AbstractOpenWebService.java:287)
at 
org.geotools.data.ows.AbstractOpenWebService.<init>(AbstractOpenWebService.java:124)
at 
org.geotools.data.ows.AbstractOpenWebService.<init>(AbstractOpenWebService.java:97)
at org.geotools.ows.wms.WebMapServer.<init>(WebMapServer.java:405)
at org.geoserver.catalog.ResourcePool.createWebMapServer(ResourcePool.java:1886)
at org.geoserver.catalog.ResourcePool.getWebMapServer(ResourcePool.java:1857)
... 146 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 28; columnNumber: 3; The 
element type "meta" must be terminated by the matching end-tag "</meta>".
at 
java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)
at 
java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:178)
at 
java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
at 
java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at 
java.xml/com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1465)
at 
java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1685)
at 
java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2883)
at 
java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
at 
java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
at 
java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
at 
java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
at 
java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
at 
java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at 
java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
at 
java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
at 
java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:324)
at java.xml/javax.xml.parsers.SAXParser.parse(SAXParser.java:197)
at org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:128)
at 
org.geotools.ows.wms.response.WMSGetCapabilitiesResponse.<init>(WMSGetCapabilitiesResponse.java:56)
... 155 more

{code}

I suspect the stacktrace to appear when GeoTools tries to parse a HTML page, 
being redirected onto the login page of the remote system, after a failing 
connection attempt.

If I deactivate the connection pooling when creating the datastore, I don’t 
encounter the issue, and I am able to publish a cascaded layer afterwards.

Using a publicly available remote WMS, I can create cascaded layers, no matter 
whether the connection pooling is activated or not.

( 
https://osgeo-org.atlassian.net/browse/GEOS-10906#add-comment?atlOrigin=eyJpIjoiYjNjN2QxNzJlODAwNDY3NDhlMTJjZTlmYTkwODlkM2EiLCJwIjoiaiJ9
 ) Add Comment ( 
https://osgeo-org.atlassian.net/browse/GEOS-10906#add-comment?atlOrigin=eyJpIjoiYjNjN2QxNzJlODAwNDY3NDhlMTJjZTlmYTkwODlkM2EiLCJwIjoiaiJ9
 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( 
https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail
 ) or iOS ( 
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8
 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100219- 
sha1:ac3e918 )
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to