1

calling GetCapabilities reports text/javascript for JSONP is not available for GetFeatureInfo. Other types are included in the list.

according to GeoServer docs @ http://docs.geoserver.org/latest/en/user/services/wms/reference.html this should be possible

this is a fresh install of geoserver 2.6.2 running as a service on Windows 8.1

we set ENABLE_JSONP true in\webapps\geoserver\WEB-INF\web.xml and restarted the GeoServer serveice

wrapper.log reports as follows;

INFO   | jvm 1    | 2015/03/02 12:38:16 | org.geowebcache.mime.MimeException: Unsupported format request: text/javascript
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geowebcache.mime.MimeType.createFromFormat(MimeType.java:134)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.gwc.layer.GeoServerTileLayer.getInfoMimeTypes(GeoServerTileLayer.java:1105)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geowebcache.service.wms.WMSGetCapabilities.capabilityRequestGetFeatureInfo(WMSGetCapabilities.java:303)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geowebcache.service.wms.WMSGetCapabilities.capability(WMSGetCapabilities.java:215)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geowebcache.service.wms.WMSGetCapabilities.generateGetCapabilities(WMSGetCapabilities.java:125)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geowebcache.service.wms.WMSGetCapabilities.writeResponse(WMSGetCapabilities.java:86)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geowebcache.service.wms.WMSService.handleRequest(WMSService.java:288)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geowebcache.service.wms.WMSService$$FastClassByCGLIB$$85c0e55b.invoke(<generated>)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.gwc.config.GWCServiceEnablementInterceptor.invoke(GWCServiceEnablementInterceptor.java:47)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geowebcache.service.wms.WMSService$$EnhancerByCGLIB$$e0331eae.handleRequest(<generated>)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geowebcache.GeoWebCacheDispatcher.handleServiceRequest(GeoWebCacheDispatcher.java:344)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geowebcache.GeoWebCacheDispatcher.handleRequestInternal(GeoWebCacheDispatcher.java:254)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.gwc.dispatch.GwcServiceProxy.dispatch(GwcServiceProxy.java:98)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at java.lang.reflect.Method.invoke(Unknown Source)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:792)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:274)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:75)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:71)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:46)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:50)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:54)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:83)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:53)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:135)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:76)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:48)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:44)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.Server.handle(Server.java:324)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
INFO   | jvm 1    | 2015/03/02 12:38:16 |   at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)

3 Answers 3

2

It does work for me with GeoServer 2.7-beta with Jetty. I tested by two methods.

  1. Edit web.xml.

On my computer web.xml had ENABLE_JSON pre-configured but commented out. When I removed the comments around context-parameters and restarted GeoServer I could find a new GetFeatureInfo format from the GetCapabilities: <Format>text/javascript</Format>

Corresponding part from my web.xml

 <!--Can be true or false (defaults to: false). -->
  <!--When true the JSONP (text/javascript) output format is enabled -->
  <!--  I REMOVED THIS LINE AND RESTARTED
  <context-param>
    <param-name>ENABLE_JSONP</param-name>
    <param-value>true</param-value>
  </context-param>
  -->   I REMOVED THIS LINE AND RESTARTED
  1. Set global environment variable

Another way to activate JSONP, also mentioned in the documentation http://docs.geoserver.org/latest/en/user/services/wms/global.html#wms-global-variables, is to set an environment variable. On Windows it means giving

 set ENABLE_JSONP=true

and on Linux

export ENABLE_JSONP=true

I made a successful test on Windows by adding environment variable into startup.bat without touching web.xml at all.

1
  • really appreciate this and i've since tried both options with no luck on fresh installs of win 8.1 and server 2008 using geoserver 2.6.2 and the 2.7.2 RC1 using JRE 1.7
    – ajayel
    Commented Mar 3, 2015 at 1:38
1

looks like a newbie mistake as the WMS has a tiled cache. i was calling GetCapabilities against the GWC cache instead of the WMS layer

Incorrect - response excludes text/javascript under GetFeatureInfo

http://127.0.0.1:8080/geoserver/gwc/service/wms?REQUEST=GetCapabilities

Correct - response includes text/javascript under GetFeatureInfo

http://127.0.0.1:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetCapabilities

see also https://stackoverflow.com/questions/4055196/geoserver-getfeatureinfo-wms-requests-do-not-work-when-using-geowebcache-layer

0

it works by setting environment variable on windows , just remember to restart the geoserver after you set the variable. I forgot to do this and wasted a lot of time on it. And strangely, I cannot modify the web.xml file of geoserver 2.6.2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.