After I updated GeoServer I observed that some layers are not rendered -
GetMap requests returned java.lang.NullPointerException (in response as
XML). Note: I have copied data_dir and told the new GeoServer to look at the
copy.

In the logs I saw:

/ERROR [geoserver.ows] - 
java.lang.NullPointerException
        at
org.geoserver.wms.map.GetMapKvpRequestReader.getDefaultStyle(GetMapKvpRequestReader.java:635)
        at
org.geoserver.wms.map.GetMapKvpRequestReader.read(GetMapKvpRequestReader.java:446)/

Then I checked the source code and found that exception occurs here:

/private Style getDefaultStyle (LayerInfo layer) throws IOException{
        if (layer.getResource() instanceof WMSLayerInfo) {
            // NamedStyle is a subclass of Style -> we use it as a way to
convey
            // cascaded WMS layer styles
            NamedStyle namedStyle =
CommonFactoryFinder.getStyleFactory(null)
                    .createNamedStyle();
            namedStyle.setName(null);
            return namedStyle;
        } else {
            StyleInfo defaultStyle = layer.getDefaultStyle();
            *return defaultStyle.getStyle();*
        }
    }/

Then I went to GeoServer web > Layers > selected bad layer > Publishing tab
> and saw that in fact "Default Style" property was not set. I enabled
verbose logging, did same actions and I saw this in the logs:

/15 Kov 10:17:01 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] -
Checking match of request : 'Path:
/web/wicket/bookmarkable/org.geoserver.web.data.resource.resourceconfigurationpage,
QueryString: name=ORT16_JPEG_50&wsName=NMA_GIS2'; against '/web/**'
15 Kov 10:17:01 DEBUG [security.IncludeQueryStringAntPathRequestMatcher] -
Matched Path:
/web/wicket/bookmarkable/org.geoserver.web.data.resource.resourceconfigurationpage,
QueryString: name=ORT16_JPEG_50&wsName=NMA_GIS2 with /web/**
15 Kov 10:17:01 DEBUG [geoserver.ows] - Could not a layer group named web
15 Kov 10:17:01 TRACE [ows.OWSHandlerMapping] - No handler mapping found for
[/web/wicket/bookmarkable/org.geoserver.web.data.resource.ResourceConfigurationPage]
15 Kov 10:17:01 DEBUG [geoserver.ows] - Could not a layer group named web
15 Kov 10:17:01 TRACE [ows.OWSHandlerMapping] - No handler mapping found for
[/web/wicket/bookmarkable/org.geoserver.web.data.resource.ResourceConfigurationPage]
15 Kov 10:17:01 DEBUG [org.geoserver] - Thread 102 locking in mode READ
15 Kov 10:17:01 DEBUG [org.geoserver] - Thread 102 got the lock in mode READ
15 Kov 10:17:01 DEBUG [org.geoserver] - Thread 102 locking in mode READ
15 Kov 10:17:01 DEBUG [org.geoserver] - Thread 102 releasing the lock in
mode READ
15 Kov 10:17:01 ERROR [java.JavaSerializer] - Error serializing object class
org.geoserver.web.data.resource.ResourceConfigurationPage [object=[Page
class = org.geoserver.web.data.resource.ResourceConfigurationPage, id = 27,
render count = 1]]
org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream$ObjectCheckException:
The object type is not Serializable!
A problem occurred while checking object with type:
org.geoserver.catalog.impl.ResolvingProxy
Field hierarchy is:
  27 [class=org.geoserver.web.data.resource.ResourceConfigurationPage,
path=27]
    private java.lang.Object org.apache.wicket.MarkupContainer.children
[class=java.util.ArrayList]
      java.lang.Object org.apache.wicket.Component.data[write:90][write:91]
[class=org.apache.wicket.markup.html.form.Form, path=27:publishedinfo]
        java.lang.Object org.apache.wicket.Component.data
[class=org.apache.wicket.model.CompoundPropertyModel]
          private java.lang.Object
org.apache.wicket.model.ChainingModel.target
[class=org.apache.wicket.model.Model]
            private java.io.Serializable
org.apache.wicket.model.Model.object [class=com.sun.proxy.$Proxy58]
              protected java.lang.reflect.InvocationHandler
java.lang.reflect.Proxy.h
[class=org.geoserver.catalog.impl.ModificationProxy]
                java.lang.Object
org.geoserver.catalog.impl.ModificationProxy.proxyObject
[class=org.geoserver.catalog.impl.LayerInfoImpl]
                  protected org.geoserver.catalog.StyleInfo
org.geoserver.catalog.impl.LayerInfoImpl.defaultStyle
[class=com.sun.proxy.$Proxy51]
                    protected java.lang.reflect.InvocationHandler
java.lang.reflect.Proxy.h [class=org.geoserver.catalog.impl.ResolvingProxy]
<----- field that is causing the problem
        at
org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream.internalCheck(CheckingObjectOutputStream.java:358)
        at
org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream.check(CheckingObjectOutputStream.java:341)
...
...
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.NotSerializableException:
org.geoserver.catalog.impl.ResolvingProxy
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
        at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
...
.../



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html

------------------------------------------------------------------------------
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