Hi David,
I don't know what's going on, but generally speaking, the REST API is best
used via XML payloads,
the JSON ones have suffered from some hiccups here and there.

Cheers
Andrea


On Tue, Feb 7, 2017 at 7:03 PM, David Haynes II <[email protected]> wrote:

> Hello,
>
> I am running into an error when creating an SQL view data layer via REST.
> The problem is encountered when trying to creating the SQL view parameter.
> I submit the following text below in my JSON object and PosgreSQL detects
> the '%' and it creates the error so no view is created.
>
> select gi_id::text || '_0'::text as fake_id, gi_id AS id, short_label,
> geom, feat_label, 0 as zoom from terrascope.sgl_boundaries_view where
> sgl_id = %id%
>
> I am using Geoserver 2.8, here is the stack trace.
>
> Request: getServiceInfo
> 2017-02-07 09:32:15,570 ERROR [geoserver.ows] -
> org.geoserver.wfs.WFSException: Error occurred getting features
> at org.geoserver.wfs.GetFeature.run(GetFeature.java:651)
> at org.geoserver.wfs.DefaultWebFeatureService.getFeature(
> DefaultWebFeatureService.java:122)
> at sun.reflect.GeneratedMethodAccessor570.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection
> (AopUtils.java:319)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.
> invokeJoinpoint(ReflectiveMethodInvocation.java:183)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> ReflectiveMethodInvocation.java:150)
> at org.geoserver.ows.util.RequestObjectLogger.invoke(
> RequestObjectLogger.java:55)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
> ReflectiveMethodInvocation.java:172)
> at org.springframework.aop.framework.JdkDynamicAopProxy.
> invoke(JdkDynamicAopProxy.java:202)
> at com.sun.proxy.$Proxy56.getFeature(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:845)
> at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:275)
> 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:923)
> at org.springframework.web.servlet.DispatcherServlet.
> doService(DispatcherServlet.java:852)
> at org.springframework.web.servlet.FrameworkServlet.processRequest(
> FrameworkServlet.java:882)
> at org.springframework.web.servlet.FrameworkServlet.
> doGet(FrameworkServlet.java:778)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:303)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:208)
> at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(
> ThreadLocalsCleanupFilter.java:28)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:241)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:208)
> 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.filters.SpringDelegatingFilter.doFilter(
> SpringDelegatingFilter.java:46)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:241)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:208)
> at org.geoserver.platform.AdvancedDispatchFilter.doFilter(
> AdvancedDispatchFilter.java:50)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:241)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:208)
> at org.springframework.security.web.FilterChainProxy$
> VirtualFilterChain.doFilter(FilterChainProxy.java:311)
> at org.geoserver.security.filter.GeoServerCompositeFilter$
> NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
> at org.springframework.security.web.access.intercept.
> FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
> at org.springframework.security.web.access.intercept.
> FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
> 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:323)
> at org.geoserver.security.filter.GeoServerCompositeFilter$
> NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
> at org.springframework.security.web.access.ExceptionTranslationFilter.
> doFilter(ExceptionTranslationFilter.java:113)
> 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:323)
> at org.geoserver.security.filter.GeoServerAnonymousAuthenticati
> onFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:54)
> at org.springframework.security.web.FilterChainProxy$
> VirtualFilterChain.doFilter(FilterChainProxy.java:323)
> at org.geoserver.security.filter.GeoServerCompositeFilter$
> NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
> at org.springframework.security.web.authentication.www.
> BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
> 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.GeoServerBasicAuthenticationFi
> lter.doFilter(GeoServerBasicAuthenticationFilter.java:83)
> at org.springframework.security.web.FilterChainProxy$
> VirtualFilterChain.doFilter(FilterChainProxy.java:323)
> at org.geoserver.security.filter.GeoServerCompositeFilter$
> NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
> at org.springframework.security.web.context.SecurityContextPersistenceFilt
> er.doFilter(SecurityContextPersistenceFilter.java:87)
> at org.geoserver.security.filter.GeoServerSecurityContextPersis
> tenceFilter$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:323)
> at org.springframework.security.web.FilterChainProxy.doFilter(
> FilterChainProxy.java:173)
> at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(
> GeoServerSecurityFilterChainProxy.java:135)
> at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(
> DelegatingFilterProxy.java:346)
> at org.springframework.web.filter.DelegatingFilterProxy.doFilter(
> DelegatingFilterProxy.java:259)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:241)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:208)
> at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:87)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:241)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:208)
> at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:241)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:208)
> at org.geoserver.filters.SessionDebugFilter.doFilter(
> SessionDebugFilter.java:48)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:241)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:208)
> at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:44)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:241)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:208)
> at org.springframework.web.filter.CharacterEncodingFilter.
> doFilterInternal(CharacterEncodingFilter.java:88)
> at org.springframework.web.filter.OncePerRequestFilter.
> doFilter(OncePerRequestFilter.java:76)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:241)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:208)
> at org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:220)
> at org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:122)
> at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
> AuthenticatorBase.java:501)
> at org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:170)
> at org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:98)
> at org.apache.catalina.valves.AccessLogValve.invoke(
> AccessLogValve.java:950)
> at org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:116)
> at org.apache.catalina.connector.CoyoteAdapter.service(
> CoyoteAdapter.java:408)
> at org.apache.coyote.http11.AbstractHttp11Processor.process(
> AbstractHttp11Processor.java:1041)
> at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.
> process(AbstractProtocol.java:607)
> at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.
> run(JIoEndpoint.java:315)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.io.IOException: Error looking up primary key
> at org.geotools.jdbc.JDBCDataStore.getPrimaryKey(JDBCDataStore.java:1083)
> at org.geotools.jdbc.JDBCFeatureSource.<init>(JDBCFeatureSource.java:95)
> at org.geotools.jdbc.JDBCDataStore.createFeatureSource(
> JDBCDataStore.java:912)
> at org.geotools.data.store.ContentDataStore.getFeatureSource(
> ContentDataStore.java:395)
> at org.geotools.data.store.ContentDataStore.getFeatureSource(
> ContentDataStore.java:360)
> at org.geotools.data.store.ContentDataStore.getSchema(
> ContentDataStore.java:344)
> at org.geotools.jdbc.JDBCDataStore.createVirtualTable(
> JDBCDataStore.java:333)
> at org.geoserver.catalog.VirtualTableCallback.initialize(
> VirtualTableCallback.java:51)
> at org.geoserver.catalog.ResourcePool.getFeatureSource(
> ResourcePool.java:1168)
> at org.geoserver.catalog.impl.FeatureTypeInfoImpl.getFeatureSource(
> FeatureTypeInfoImpl.java:125)
> at sun.reflect.GeneratedMethodAccessor404.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.geoserver.catalog.impl.ModificationProxy.invoke(
> ModificationProxy.java:146)
> at com.sun.proxy.$Proxy70.getFeatureSource(Unknown Source)
> at org.geoserver.wfs.GetFeature.run(GetFeature.java:495)
> ... 101 more
> Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or
> near "%"
>   Position: 166
> at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(
> QueryExecutorImpl.java:2270)
> at org.postgresql.core.v3.QueryExecutorImpl.processResults(
> QueryExecutorImpl.java:1998)
> at org.postgresql.core.v3.QueryExecutorImpl.execute(
> QueryExecutorImpl.java:255)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(
> AbstractJdbc2Statement.java:570)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(
> AbstractJdbc2Statement.java:406)
> at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(
> AbstractJdbc2Statement.java:286)
> at org.apache.commons.dbcp.DelegatingStatement.executeQuery(
> DelegatingStatement.java:208)
> at org.apache.commons.dbcp.DelegatingStatement.executeQuery(
> DelegatingStatement.java:208)
> at org.geotools.jdbc.JDBCFeatureSource.getColumnMetadata(
> JDBCFeatureSource.java:884)
> at org.geotools.jdbc.JDBCDataStore.getPrimaryKey(JDBCDataStore.java:1046)
>
> --
> David Haynes, Ph.D.
> Research Associate Terra Populus
> Minnesota Population Center
> 612-626-3933 <(612)%20626-3933>
> www.terrapop.org
>
> ------------------------------------------------------------
> ------------------
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>


-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to