Yes Christian, j2ee filter is in the rest filter chain settings. In any
case, I found a solution by changing the header Content-type to
application/xml instead of text/xml. Now everything works.

Cheers
Dmitriy

On Wed, Sep 4, 2013 at 2:42 PM, Christian Mueller <
[email protected]> wrote:

> Only to be sure, did you put your j2ee filter on the rest queue (ant
> pattern /rest/**)
>
> Cheers
> Christian
>
>
> On Wed, Sep 4, 2013 at 12:13 PM, Dmitriy Tyugaev <[email protected]>wrote:
>
>> Hi list.
>>
>> I have an issue with Rest security in latest geoserver 2.3.5 (also in
>> 2.3.4) I use j2ee authentication filter for authorization in our JOSSO
>> system. Authorization is proceeding normally and everything is working as
>> it should, but when I try to create a workspace via a REST receive the
>> following error
>>
>> 2013-09-03 08:55:07,145 DEBUG
>> [security.RESTfulPathBasedFilterInvocationDefinitionMap] - Converted URL to
>> lowercase, from: '/rest/workspaces'; to: '/rest/workspaces'  and
>> httpMethod= POST
>> 2013-09-03 08:55:07,145 DEBUG
>> [security.RESTfulPathBasedFilterInvocationDefinitionMap] - ~~~~~~~~~~
>> antPath= /** methodList= [GET]
>> 2013-09-03 08:55:07,145 DEBUG
>> [security.RESTfulPathBasedFilterInvocationDefinitionMap] - Candidate is:
>> '/rest/workspaces'; antPath is /**; matchedPath=true; matchedMethods=false
>> 2013-09-03 08:55:07,145 DEBUG
>> [security.RESTfulPathBasedFilterInvocationDefinitionMap] - ~~~~~~~~~~
>> antPath= /** methodList= [POST, DELETE, PUT]
>> 2013-09-03 08:55:07,145 DEBUG
>> [security.RESTfulPathBasedFilterInvocationDefinitionMap] - Candidate is:
>> '/rest/workspaces'; antPath is /**; matchedPath=true; matchedMethods=true
>> 2013-09-03 08:55:07,145 DEBUG
>> [security.RESTfulPathBasedFilterInvocationDefinitionMap] - returning
>> RIHMI-WDC.RCITU:GIS:ADMIN
>> 2013-09-03 08:55:07,146 TRACE [ows.OWSHandlerMapping] - No handler
>> mapping found for [/rest/workspaces]
>> 2013-09-03 08:55:07,146 TRACE [ows.OWSHandlerMapping] - No handler
>> mapping found for [/rest/workspaces]
>> 2013-09-03 08:55:07,149 DEBUG [org.geoserver] - Thread 151 locking in
>> mode WRITE
>> 2013-09-03 08:55:07,149 DEBUG [org.geoserver] - Thread 151 got the lock
>> in mode WRITE
>> 2013-09-03 08:55:07,181 DEBUG [org.geoserver] - Thread 151 releasing the
>> lock in mode WRITE
>> 2013-09-03 08:55:07,182 ERROR [geoserver.rest] -
>> com.thoughtworks.xstream.io.StreamException:  : input contained no data
>>     at
>> com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:126)
>>     at
>> com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148)
>>     at
>> com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:141)
>>     at
>> com.thoughtworks.xstream.io.xml.AbstractPullReader.move(AbstractPullReader.java:118)
>>     at
>> com.thoughtworks.xstream.io.xml.AbstractPullReader.moveDown(AbstractPullReader.java:103)
>>     at com.thoughtworks.xstream.io.xml.XppReader.<init>(XppReader.java:63)
>>     at
>> com.thoughtworks.xstream.io.xml.AbstractXppDriver.createReader(AbstractXppDriver.java:54)
>>     at
>> com.thoughtworks.xstream.io.xml.AbstractXppDriver.createReader(AbstractXppDriver.java:65)
>>     at com.thoughtworks.xstream.XStream.fromXML(XStream.java:922)
>>     at
>> org.geoserver.config.util.XStreamPersister.load(XStreamPersister.java:549)
>>     at
>> org.geoserver.catalog.rest.AbstractCatalogResource$1.read(AbstractCatalogResource.java:50)
>>     at
>> org.geoserver.rest.format.StreamDataFormat.toObject(StreamDataFormat.java:33)
>>     at
>> org.geoserver.rest.ReflectiveResource.handlePost(ReflectiveResource.java:117)
>>     at org.restlet.Finder.handle(Finder.java:296)
>>     at
>> org.geoserver.rest.BeanDelegatingRestlet.handle(BeanDelegatingRestlet.java:37)
>>     at org.restlet.Filter.doHandle(Filter.java:105)
>>     at org.restlet.Filter.handle(Filter.java:134)
>>     at org.restlet.Router.handle(Router.java:444)
>>     at org.geoserver.rest.RESTDispatcher$1.handle(RESTDispatcher.java:204)
>>     at
>> com.noelios.restlet.ext.servlet.ServletConverter.service(ServletConverter.java:129)
>>     at
>> org.geoserver.rest.RESTDispatcher.handleRequestInternal(RESTDispatcher.java:86)
>>     at
>> org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
>>     at
>> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
>>     at
>> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
>>     at
>> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
>>     at
>> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
>>     at
>> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>     at
>> org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:27)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>     at
>> org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:74)
>>     at
>> org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:45)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>     at
>> org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:49)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>     at
>> org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
>>     at
>> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
>>     at
>> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
>>     at
>> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
>>     at
>> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
>>     at
>> org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
>>     at
>> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
>>     at
>> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
>>     at
>> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
>>     at
>> org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
>>     at
>> org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:53)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
>>     at
>> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
>>     at
>> org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)
>>     at
>> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
>>     at
>> org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
>>     at
>> org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:82)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
>>     at
>> org.geoserver.security.filter.GeoServerPreAuthenticationFilter.doFilter(GeoServerPreAuthenticationFilter.java:74)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
>>     at
>> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
>>     at
>> org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
>>     at
>> org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:52)
>>     at
>> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
>>     at
>> org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
>>     at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
>>     at
>> org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
>>     at
>> org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:134)
>>     at
>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
>>     at
>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>     at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:75)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>     at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:48)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>     at
>> org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:47)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>>     at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>     at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
>>     at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
>>     at
>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
>>     at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
>>     at
>> com.googlecode.psiprobe.Tomcat70AgentValve.invoke(Tomcat70AgentValve.java:38)
>>     at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>>     at org.josso.tc70.agent.SSOAgentValve.invoke(SSOAgentValve.java:672)
>>     at
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
>>     at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>>     at
>> org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:219)
>>     at
>> org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:335)
>>     at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
>>     at
>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
>>     at
>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>>     at
>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
>>     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: java.io.EOFException: input contained no data
>>     at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:2983)
>>     at org.xmlpull.mxp1.MXParser.more(MXParser.java:3026)
>>     at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1410)
>>     at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395)
>>     at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
>>     at
>> com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:109)
>>     ... 104 more
>>
>> Creating a workspace with a basic authentication filter is working fine..
>>
>> My curl command
>> curl -b /tmp/geoserver.txt -XPOST -H "Content-type: text/xml" -d
>> "<workspace><name>new</name></workspace>"
>> http://localhost:8081/resources/rest/workspaces
>>
>> /tmp/geoserver.txt is a cookie file received from the JOSSO.
>>
>> Java 7.0_25 and Tomcat 7.0.42 on Linux
>>
>> Please help me what is the problem?
>> --
>> Cheers, Dmitriy
>>
>>
>> ------------------------------------------------------------------------------
>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
>> Discover the easy way to master current and previous Microsoft
>> technologies
>> and advance your career. Get an incredible 1,500+ hours of step-by-step
>> tutorial videos with LearnDevNow. Subscribe today and save!
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Geoserver-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>
>>
>
>
> --
> DI Christian Mueller MSc (GIS), MSc (IT-Security)
> OSS Open Source Solutions GmbH
>
>
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to