Details
Description
Using latest trunk (7/13/09)
Steps to reproduce:
- UI -> Styles
- Create new style.
- Leave as is.
- Submit
- Click on newly created style
- Click Validate
- Error!
org.xml.sax.SAXParseException: cvc-complex-type.2.4.b: The content of element 'Rule' is not complete. One of '
{"http://www.opengis.net/sld":Abstract, "http://www.opengis.net/sld":LegendGraphic, "http://www.opengis.net/ogc":Filter, "http://www.opengis.net/sld":ElseFilter, "http://www.opengis.net/sld":MinScaleDenominator, "http://www.opengis.net/sld":MaxScaleDenominator, "http://www.opengis.net/sld":Symbolizer}' is expected.
Activity
Whoops, hit OK too soon. The error is a NPE:
14 Jul 15:16:04 ERROR [geoserver.ows] -
java.lang.NullPointerException
at org.geotools.styling.SLDParser.parseRule(SLDParser.java:801)
at org.geotools.styling.SLDParser.parseFeatureTypeStyle(SLDParser.java:7
56)
at org.geotools.styling.SLDParser.parseStyle(SLDParser.java:712)
at org.geotools.styling.SLDParser.readDOM(SLDParser.java:319)
at org.geotools.styling.SLDParser.readXML(SLDParser.java:295)
at org.geoserver.catalog.ResourcePool.getStyle(ResourcePool.java:852)
at org.geoserver.catalog.impl.StyleInfoImpl.getStyle(StyleInfoImpl.java:
57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.geoserver.catalog.impl.ModificationProxy.invoke(ModificationProxy
.java:113)
at $Proxy7.getStyle(Unknown Source)
at org.geoserver.wms.kvp.GetMapKvpRequestReader.read(GetMapKvpRequestRea
der.java:310)
at org.geoserver.wms.kvp.GetMapKvpRequestReader.read(GetMapKvpRequestRea
der.java:70)
at org.geoserver.ows.Dispatcher.parseRequestKVP(Dispatcher.java:1092)
at org.geoserver.ows.Dispatcher.dispatch(Dispatcher.java:431)
at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:20
9)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(
AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.ha
ndle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(Dispatch
erServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet.doService(Dispatche
rServlet.java:809)
at org.springframework.web.servlet.FrameworkServlet.processRequest(Frame
workServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServl
et.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487
)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
Handler.java:1093)
at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCha
racterEncodingFilter.java:108)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
Handler.java:1084)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:265)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(Filt
erSecurityInterceptor.java:107)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(Fi
lterSecurityInterceptor.java:72)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:275)
at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTra
nslationFilter.java:124)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:275)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFil
ter(AnonymousProcessingFilter.java:125)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:275)
at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicPr
ocessingFilter.java:174)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:275)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilte
r(HttpSessionContextIntegrationFilter.java:249)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(F
ilterChainProxy.java:275)
at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.jav
a:149)
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.j
ava:98)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
Handler.java:1084)
at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
Handler.java:1084)
at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.
java:183)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
Handler.java:1084)
at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:41)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
Handler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:3
60)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.jav
a:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:1
81)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:7
26)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHand
lerCollection.java:206)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.
java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:1
52)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:50
5)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpCo
nnection.java:828)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.ja
va:395)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool
.java:450)
The template is not a complete style which is why this happens. I think it makes more sense to have:
- no template, so by default the editor is blank
- Add three buttons or a drop down or something with 3 items: "Default point", "Default line", "Default polygon" which when selected populates the editor with a complete style, one that will validate.
If people think this is a good idea please create a separate issue and feel free to assign to it to me.
I was thinking we could have a directory in the data dir with "template" styles, or else, simply allow to select another existing style as the starting point (copy from <dropdown>).
What would be the difference between a "template" style and a regular style?
I like the idea of a drop down list for generic geometry styles. It's also probably a slippery slope ("ooh, can we add to this list?") but not one that I'm against.
Regardless, something that's complete and will validate by default is important. However you want to do that is fine by me.
Mike, if we go the dropdown chooser we could have:
- clean white slate on page open
- dropdown listing all existing styles, if you choose one you get a copy of it in the editor (and it gets appeneded to the current contents if there is anything... or should we overwrite?)
I guess this would satisfy most needs, the existing list is forced into having the basic pont/line/polygon/raster, but also more complex styles that one might legitimately want to start from
>dropdown listing all existing styles, if you choose one you get a
>copy of it in the editor (and it gets appeneded to the current
>contents if there is anything... or should we overwrite?)
Not to get too crafty, but a popup that says to confirm overwriting of whatever is in the box? I would hate to push a button by accident and have it clobber my work without undo. Appending to the current contents would be too confusing, I think.
Yeah... copy from existing with a drop down do styles makes a lot of sense to me. +1 on that approach.
Mike, if you grab today's nighlty build you can see what I made up for this form. It's only in the "new" form, I did not do it in the edit one as the two are getting very very similar and I want to refactor them to use a common base class once we get the interaction right. So let me know how the current approach works for you.
I think this is excellent. Having access to all styles was better than what I was thinking.
Although, pressing "Validate" now does the same as "Submit". It used to say "no validation errors" or "validation errors found" which I think makes more sense.
Yeah. I saw this behavior before the change as well, i believe it is a bug with how the form and submit buttons are arranged.
Needless to say, applying this style to a layer doesn't work.