Reloading the configuration did the trick.

For your info, for the query:
SELECT ST_GeomFromText( 'LINESTRING(%ROUTELINE%)' )
In the UI I get:
ERROR: parse error - invalid geometry Hint: "LINESTRING()" <-- parse error at 
position 13 within geometry

Thank you for the help.



From: [email protected] [mailto:[email protected]] On Behalf Of Andrea 
Aime
Sent: 11 September 2012 08:29
To: Simon Hartley
Cc: [email protected]
Subject: Re: [Geoserver-users] SQL view and NPE

On Thu, Sep 6, 2012 at 5:08 PM, Simon Hartley 
<[email protected]<mailto:[email protected]>> wrote:
Hiya,

I wanted to be able to pass in an arbitrary set of points to draw a line and 
still get GeoServer to define the styling.

In order to achieve this I tried to create the following SQL view as a layer:
SELECT ST_GeomFromText( 'LINESTRING(%ROUTELINE%)' )

Geoserver wouldn't let me get away with this (parse error) and so I changed it 
to the following:

Parse error of what kind?

SELECT ST_GeomFromText(
    'LINESTRING('
    || (SELECT '%ROUTELINE%'):: text
    || ')'
)

However, when I try to use this layer I get a NullPointerException (when tested 
with GeoServer 2.1.4).

Any ideas?
Thanks,

Simon


Here is the URL I use:
http://127.0.0.1:8089/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG%3A4326&FORMAT=image%2Fpng&WIDTH=1810&HEIGHT=1280&BBOX=-14.55%2C37.77%2C9.85%2C55.038&LAYERS=RouteLine&VIEWPARAMS=ROUTELINE%3A-0.189%2051.148%5C%2C-1.345%2050.955

Here is the log:
2012-09-06 14:48:21,990 ERROR [geoserver.ows] -
java.lang.NullPointerException
                at 
org.geoserver.catalog.impl.DataStoreInfoImpl.getDataStore(DataStoreInfoImpl.java:37)

Hmm... this error is a data structure corruption, the code is using a 
DataStoreInfoImpl whose "catalog"
field is null, which should never happen.
We hear of this issue from time to time, but nobody ever managed to make it 
reproducable, you just
reload the configuration or restart GeoServer and it's gone, without any 
apparent way to make it surface
again... it's quite puzzling

Cheers
Andrea

--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more 
information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:   +39 0584 962313
mob:   +39  339 8844549

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

-------------------------------------------------------

*** This communication has been sent from World Fuel Services 
Corporation or its subsidiaries or its affiliates for the intended recipient 
only and may contain proprietary, confidential or privileged information. 
If you are not the intended recipient, any review, disclosure, copying, 
use, or distribution of the information included in this communication 
and any attachments is strictly prohibited. If you have received this 
communication in error, please notify us immediately by replying to this 
communication and delete the communication, including any 
attachments, from your computer. Electronic communications sent to or 
from World Fuel Services Corporation or its subsidiaries or its affiliates 
may be monitored for quality assurance and compliance purposes.***

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to