Hi Nikolaus,

Your probably will need to rewrite your XML document
<layers>
<layer>collins:Collins_Midscale_Stadt</layer>
<layer>collins:Collins_World_Hintergrund</layer>
</layers>

*To something like this  *

<publishables>
<published type="layer"> <name> *collins:Collins_Midscale_Stadt*</name>
</published>
<published type="layer"> <name> *collins:Collins_World_Hintergrund*</name>
</published>
</publishables>
<styles>
<style><name></name></style>
...
<./styles>.

You can see here
http://docs.geoserver.org/latest/en/api/#/1.0.0/layergroups.yaml plus it
worked this way for me.
Kind regards,
Steve Omondi


On Mon, Aug 27, 2018 at 10:57 AM Nikolaus Pruzsinszky <nikopr...@gmail.com>
wrote:

> Hi list,
> I am trying to set up a layergroup consisting of layergroups that I
> created before and I run into the same error all the time. Is it because of
> the empty style elements? But how do I address a style for a layergroup?
>
> This is what I tried:
>
> curl -v -u %login% -POST -H "Content-type: text/xml" -d
> "<layerGroup><name>test</name><layers><layer>collins:Collins_Midscale_Stadt</layer><layer>collins:Collins_World_Hintergrund</layer></layers><styles><style></style><style></style></styles></layerGroup>"
> %url%/workspaces/collins/layergroups
> *   Trying ::1...
> * TCP_NODELAY set
> * Connected to localhost (::1) port 8080 (#0)
> * Server auth using Basic with user 'admin'
> > POST /geoserver/rest/workspaces/collins/layergroups HTTP/1.1
> > Host: localhost:8080
> > Authorization: Basic YWRtaW46Z2Vvc2VydmVy
> > User-Agent: curl/7.61.0
> > Accept: */*
> > Content-type: text/xml
> > Content-Length: 199
> >
> * upload completely sent off: 199 out of 199 bytes
> < HTTP/1.1 500
> < X-Frame-Options: SAMEORIGIN
> < Transfer-Encoding: chunked
> < Date: Mon, 27 Aug 2018 07:32:24 GMT
> < Connection: close
> <
> Layer group must not be empty* Closing connection 0
>
> This is what I find in the log:
>
> 2018-08-27 09:32:24,217 ERROR [geoserver.rest] - Layer group must not be
> empty
> java.lang.IllegalArgumentException: Layer group must not be empty
>     at
> org.geoserver.catalog.impl.CatalogImpl.validate(CatalogImpl.java:867)
>     at
> org.geoserver.security.SecureCatalogImpl.validate(SecureCatalogImpl.java:1162)
>     at
> org.geoserver.catalog.impl.AbstractFilteredCatalog.validate(AbstractFilteredCatalog.java:546)
>     at
> org.geoserver.catalog.impl.AbstractCatalogDecorator.validate(AbstractCatalogDecorator.java:451)
>     at
> org.geoserver.catalog.impl.LocalWorkspaceCatalog.validate(LocalWorkspaceCatalog.java:245)
>     at
> org.geoserver.rest.catalog.LayerGroupController.layerGroupPost(LayerGroupController.java:140)
>     at sun.reflect.GeneratedMethodAccessor790.invoke(Unknown Source)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>     at java.lang.reflect.Method.invoke(Unknown Source)
>     at
> org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
>     at
> org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
>     at
> org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
>     at
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
>     at
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
>     at
> org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
>     at
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
>     at
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
>     at
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
>     at
> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
>     at
> org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>     at
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>     at
> org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>     at
> org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:75)
>     at
> org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:71)
>     at
> org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71)
>     at
> org.geoserver.flow.controller.IpBlacklistFilter.doFilter(IpBlacklistFilter.java:94)
>     at
> org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71)
>     at
> org.geoserver.flow.ControlFlowCallback.doFilter(ControlFlowCallback.java:248)
>     at
> org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71)
>     at
> org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:46)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>     at
> org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:50)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>     at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
>     at
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)
>     at
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
>     at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
>     at
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
>     at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
>     at
> org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:54)
>     at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
>     at
> org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:213)
>     at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
>     at
> org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:84)
>     at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
>     at
> org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91)
>     at
> org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:53)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
>     at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
>     at
> org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213)
>     at
> org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)
>     at
> org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:152)
>     at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
>     at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>     at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:88)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>     at
> org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:89)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>     at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:48)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>     at
> org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:48)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>     at
> org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:44)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>     at
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
>     at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>     at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
>     at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
>     at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
>     at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
>     at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
>     at
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)
>     at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
>     at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
>     at
> org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:412)
>     at
> org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
>     at
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)
>     at org.apache.tomcat.util.net
> .NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1385)
>     at org.apache.tomcat.util.net
> .SocketProcessorBase.run(SocketProcessorBase.java:49)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>     at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>     at java.lang.Thread.run(Unknown Source)
>
> Cheers, Niko
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://geoserver.org/comm/userlist-guidelines.html
>
> If you want to request a feature or an improvement, also see this:
> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>
>
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to