jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • GeoServer
  • GEOS-2873

NPE generating wms caps when restarting the converted WMS 1.1 data dir

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0-alpha1
  • Fix Version/s: 2.0-alpha2
  • Component/s: Configuration
  • Labels:
    None

Description

The NPE looks like:

15 apr 15:53:09 ERROR [geoserver.ows] - 
org.vfny.geoserver.wms.WmsException: Translator error
	at org.vfny.geoserver.wms.responses.WMSCapabilitiesResponse.execute(WMSCapabilitiesResponse.java:152)
	at org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48)
	at org.geoserver.ows.Dispatcher.response(Dispatcher.java:690)
	at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:216)
	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:875)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
	at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
	at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
	at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:178)
	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
	at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:173)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:41)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:324)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.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.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
Caused by: javax.xml.transform.TransformerException: Translator error
	at org.geotools.xml.transform.TransformerBase.transform(TransformerBase.java:133)
	at org.geotools.xml.transform.TransformerBase.transform(TransformerBase.java:108)
	at org.vfny.geoserver.wms.responses.WMSCapabilitiesResponse.execute(WMSCapabilitiesResponse.java:150)
	... 50 more
Caused by: java.lang.NullPointerException
	at org.geoserver.catalog.impl.ModificationProxy.invoke(ModificationProxy.java:77)
	at $Proxy17.getSRS(Unknown Source)
	at org.vfny.geoserver.wms.responses.helpers.WMSCapsTransformer$CapabilitiesTranslator.handleLayers(WMSCapsTransformer.java:520)
	at org.vfny.geoserver.wms.responses.helpers.WMSCapsTransformer$CapabilitiesTranslator.handleCapability(WMSCapsTransformer.java:337)
	at org.vfny.geoserver.wms.responses.helpers.WMSCapsTransformer$CapabilitiesTranslator.encode(WMSCapsTransformer.java:219)
	at org.geotools.xml.transform.TransformerBase$XMLReaderSupport.parse(TransformerBase.java:714)
	at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
	at org.geotools.xml.transform.TransformerBase$Task.run(TransformerBase.java:296)
	at org.geotools.xml.transform.TransformerBase.transform(TransformerBase.java:129)
	... 52 more

This is happening because WMSInfo.getSRS() returns null instead of an empty list. I guess some code like the one in CatalogImpl.resolve(xxx) is needed. Do service loaders have anything similar?

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Andrea Aime added a comment - 15/Apr/09 8:59 AM

This patch seems to do the trick:

### Eclipse Workspace Patch 1.0
#P wms
Index: src/main/java/org/geoserver/wms/WMSXStreamLoader.java
===================================================================
--- src/main/java/org/geoserver/wms/WMSXStreamLoader.java	(revisione 12135)
+++ src/main/java/org/geoserver/wms/WMSXStreamLoader.java	(copia locale)
@@ -42,6 +42,9 @@
         if ( service.getVersions().isEmpty() ) {
             service.getVersions().add( new Version( "1.1.1" ) );
         }
+        if(service.getSRS() == null) {
+            ((WMSInfoImpl)service).srs = new ArrayList<String>();
+        }
         return service;
     }
 }

However, maybe the same treatment is necessary for the other collections stored in wmsinfo?

Show
Andrea Aime added a comment - 15/Apr/09 8:59 AM This patch seems to do the trick:
### Eclipse Workspace Patch 1.0
#P wms
Index: src/main/java/org/geoserver/wms/WMSXStreamLoader.java
===================================================================
--- src/main/java/org/geoserver/wms/WMSXStreamLoader.java	(revisione 12135)
+++ src/main/java/org/geoserver/wms/WMSXStreamLoader.java	(copia locale)
@@ -42,6 +42,9 @@
         if ( service.getVersions().isEmpty() ) {
             service.getVersions().add( new Version( "1.1.1" ) );
         }
+        if(service.getSRS() == null) {
+            ((WMSInfoImpl)service).srs = new ArrayList<String>();
+        }
         return service;
     }
 }
However, maybe the same treatment is necessary for the other collections stored in wmsinfo?
Hide
Permalink
Justin Deoliveira added a comment - 15/Apr/09 9:16 AM

Probably, and other info objects as well. The way xstream deals with un-initializing collections kind of sucks. I wonder, how do you feel about making a single resolve() method in catalog that reflectively initializes all collection based attributes. It wold be slower but it would also be a heck of a lot easier to maintain, and would catch all these cases once and for all.

Show
Justin Deoliveira added a comment - 15/Apr/09 9:16 AM Probably, and other info objects as well. The way xstream deals with un-initializing collections kind of sucks. I wonder, how do you feel about making a single resolve() method in catalog that reflectively initializes all collection based attributes. It wold be slower but it would also be a heck of a lot easier to maintain, and would catch all these cases once and for all.
Hide
Permalink
Andrea Aime added a comment - 15/Apr/09 9:44 AM

Hmmm... works for me but... wouldn't that be the same as what the ModificationProxy is doing? I guess the issue is that you don't know which class you need to initialize? You only have an interface and you have to guess a good implementation.
So this works, but we have to state somewhere that impl should not rely on a specific implementation of collections, or that deserialization of empty ones will bring well known collection impl (ArraList, HashSet, HashMap, just to make a proposal).

Show
Andrea Aime added a comment - 15/Apr/09 9:44 AM Hmmm... works for me but... wouldn't that be the same as what the ModificationProxy is doing? I guess the issue is that you don't know which class you need to initialize? You only have an interface and you have to guess a good implementation. So this works, but we have to state somewhere that impl should not rely on a specific implementation of collections, or that deserialization of empty ones will bring well known collection impl (ArraList, HashSet, HashMap, just to make a proposal).
Hide
Permalink
Andrea Aime added a comment - 03/Jul/09 9:53 AM

Mass closing all resolved issues that have been closed for more than one month without further comments

Show
Andrea Aime added a comment - 03/Jul/09 9:53 AM Mass closing all resolved issues that have been closed for more than one month without further comments

People

  • Assignee:
    Justin Deoliveira
    Reporter:
    Andrea Aime
Vote (0)
Watch (0)

Dates

  • Created:
    15/Apr/09 8:54 AM
    Updated:
    03/Jul/09 9:53 AM
    Resolved:
    15/Apr/09 9:40 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.