[Geoserver-users] GeoServer 1.7.2 and SQL 2008

ok… I now can access the data on the SQL server.

Here are the issues I ran into getting things running… I will try to create a better document this weekend.

SQL 2008 Express did not enable TCP/IP support by default. You need to go into SQL Configuration Manager and configure it.

Creating a user with datareader access did not grant sufficient privledges to retrieve the data.

Specifying a database in the datastore properties will cause the driver not to connect. I did however set the default database of the user to the spatial database I am using.

So… I can access a TABLE and display the data correctly… but when I try to access a VIEW i get the following error

07 Feb 00:26:40 ERROR [geotools.rendering] - Could not determine fid from primary key
java.lang.RuntimeException: Could not determine fid from primary key
at org.geotools.jdbc.JDBCFeatureReader.next(JDBCFeatureReader.java:265)
at org.geotools.jdbc.JDBCFeatureReader.next(JDBCFeatureReader.java:79)
at org.geotools.data.FilteringFeatureReader.hasNext(FilteringFeatureReader.java:128)
at org.geotools.data.store.ContentFeatureCollection$WrappingIterator.hasNext(ContentFeatureCollection.java:247)
at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1603)
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:642)
at org.geotools.renderer.shape.ShapefileRenderer.renderWithStreamingRenderer(ShapefileRenderer.java:1472)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:1341)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:265)
at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:347)
at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:416)
at org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48)
at org.geoserver.ows.Dispatcher.response(Dispatcher.java:698)
at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:215)
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: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(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:163)
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.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
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.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.AbstractStringBuilder.setLength(AbstractStringBuilder.java:143)
at java.lang.StringBuffer.setLength(StringBuffer.java:153)
at org.geotools.jdbc.JDBCDataStore.encodeFID(JDBCDataStore.java:1175)
at org.geotools.jdbc.JDBCDataStore.encodeFID(JDBCDataStore.java:1167)
at org.geotools.jdbc.JDBCFeatureReader.next(JDBCFeatureReader.java:260)
… 62 more


Msg sent via CableONE.net MyMail - http://www.cableone.net

garland12@anonymised.com ha scritto:

ok.. I now can access the data on the SQL server.

Here are the issues I ran into getting things running... I will try to create a better document this weekend.

SQL 2008 Express did not enable TCP/IP support by default. You need to go into SQL Configuration Manager and configure it.

Creating a user with datareader access did not grant sufficient privledges to retrieve the data.

Specifying a database in the datastore properties will cause the driver not to connect. I did however set the default database of the user to the spatial database I am using.

So.. I can access a TABLE and display the data correctly... but when I try to access a VIEW i get the following error

07 Feb 00:26:40 ERROR [geotools.rendering] - Could not determine fid from primary key

I believe I fixed the inability to deal with tables without primary
keys (and so, views too) a few days ago.
You can go and grab a nightly build here:
http://gridlock.openplans.org/geoserver/1.7.x/

to check out if the fix works for you too
Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.