• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

grails and spatial data (custom type)

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

I'm trying to create a grails 1.1.1 application using spatial data along the lines of the blog entry at http://blog.mollusca.ch/2008/10/4/grails-spatial-data-postgis

The problem I'm having is that when I call the create method, I get the following exception:

Error 500: Error processing GroovyPageView: Error executing tag <g:form>: org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error evaluating expression [com.vividsolutions.jts.geom.Point.list()] on line [52]: groovy.lang.MissingMethodException: No signature of method: static com.vividsolutions.jts.geom.Point.list() is applicable for argument types: () values: []
Servlet: grails
URI: /spatial-demo/grails/event/create.dispatch
Exception Message: No signature of method: static com.vividsolutions.jts.geom.Point.list() is applicable for argument types: () values: []
Caused by: Error processing GroovyPageView: Error executing tag <g:form>: org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error evaluating expression [com.vividsolutions.jts.geom.Point.list()] on line [52]: groovy.lang.MissingMethodException: No signature of method: static com.vividsolutions.jts.geom.Point.list() is applicable for argument types: () values: []
Class: /event/create


Can someone please help understand what the problem might be?

Thanks!

--john
 
author
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi John,

I don't believe that Point is a domain class - it's a Hibernate custom type. That means Grails will not add the domain class methods like list() to it. As Silvio says, the scaffolding code probably thinks that Point is a domain class, so it includes a call to list().

If you haven't already done so, use either the grails generate-views or grails generate-all commands to create the physical GSP files. You can then modify them to remove the offending call to Point.list().

Hope that helps,

Peter
 
J. Cartwright
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much for your reply Peter. Removing those calls, e.g.

<g:select optionKey="id" from="${com.vividsolutions.jts.geom.Point.list()}" name="location.id" value="${eventInstance?.location?.id}" ></g:select>

does allow the page to display. I'm still confused however as to why Grails sees the "Point" class as a domain class rather than a property class like the String. Can you elaborate on the role of the PropertyEditorSupport class (com.vividsolutions.jts.geom.PointEditor, in my case) then?

Thanks again for your help!

--john


 
Peter Ledbrook
author
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's a bug in the scaffolding code. I suspect that it simply wasn't changed when custom types were introduced to Grails, so it uses some old (broken) way to determine whether a field is a relationship or not.

I don't think PropertyEditorSupport classes have any impact on the scaffolding. As far as I'm aware, they're only used during data-binding, for example when the params object is bound to a domain or command object.

Cheers,

Peter
 
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic