Importing OSM data with using Neo4j spatial fails

115 views
Skip to first unread message

Lesya Mankovska

unread,
May 30, 2015, 11:54:59 AM5/30/15
to ne...@googlegroups.com
Hello, I'm playing around with Neo4j and Neo4j spatial. I would like to Import a OSM file and save it in the database. Now I have the following Problem: the Import Fails quite in the end and I get the following Exception:



Loaded 147 nodes

Loaded 10 ways

Loaded 8 relations

Boschetsrieder.osm[3290]: When processing the relations, there were 585 missing members

Boschetsrieder.osm[3290]: info | Elapsed time in seconds: 2.863

Geometry statistics for 3 geometry types:

Exception in thread "main" java.lang.AbstractMethodError: org.geotools.metadata.iso.citation.ContactImpl.getOnlineResource()Lorg/opengis/metadata/citation/OnlineResource;

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:483)

at org.geotools.metadata.PropertyAccessor.get(PropertyAccessor.java:339)

at org.geotools.metadata.PropertyAccessor.hashCode(PropertyAccessor.java:521)

at org.geotools.metadata.MetadataStandard.hashCode(MetadataStandard.java:300)

at org.geotools.metadata.AbstractMetadata.hashCode(AbstractMetadata.java:186)

at org.geotools.metadata.PropertyAccessor.hashCode(PropertyAccessor.java:523)

at org.geotools.metadata.MetadataStandard.hashCode(MetadataStandard.java:300)

at org.geotools.metadata.AbstractMetadata.hashCode(AbstractMetadata.java:186)

at java.util.HashMap.hash(HashMap.java:338)

at java.util.HashMap.put(HashMap.java:611)

at java.util.HashSet.add(HashSet.java:219)

at org.geotools.util.CheckedHashSet.add(CheckedHashSet.java:120)

at org.geotools.metadata.iso.citation.CitationImpl.<init>(CitationImpl.java:195)

at org.geotools.metadata.iso.citation.Citations.<clinit>(Citations.java:90)

at org.geotools.referencing.datum.DefaultGeodeticDatum.<clinit>(DefaultGeodeticDatum.java:71)

at org.geotools.referencing.crs.DefaultGeographicCRS.<clinit>(DefaultGeographicCRS.java:92)

at org.neo4j.gis.spatial.SpatialDatabaseService.<clinit>(SpatialDatabaseService.java:444)

at org.neo4j.gis.spatial.osm.OSMImporter$StatsManager.dumpGeomStats(OSMImporter.java:210)

at org.neo4j.gis.spatial.osm.OSMImporter.importFile(OSMImporter.java:2037)

at org.neo4j.gis.spatial.osm.OSMImporter.importFile(OSMImporter.java:1765)

at org.neo4j.gis.spatial.osm.OSMImporter.importFile(OSMImporter.java:1752)

at testSpatial.Test_osm_import.createFromOsm(Test_osm_import.java:49)

at testSpatial.Test_osm_import.main(Test_osm_import.java:35)


I'm new to all this (also Java), but as I understand it, the importer is trying to call some method which is abstract  and of course it Fails, because there is no possibility to call such methods. But now I'm confused, because I don't know if there is a possibility to somehow get around this exception and continue the proceed the program execution... Does somebody have any ideas? I would be really happy to get some tips..

Michael Hunger

unread,
Oct 7, 2015, 1:37:37 PM10/7/15
to ne...@googlegroups.com
Hey it's rather trying to hash something that doesn't have support for it,
as it happens only in a dump-statistics method it shouldn't have an affect.

Did the import still work?

Michael

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Craig Taverner

unread,
Oct 8, 2015, 2:24:43 AM10/8/15
to ne...@googlegroups.com
Looking through the stack trace it seems like this is a lookup of the WGS84 CRS/Datum in GeoTools, and internal to that it is using hashmaps for it's datum lookup, and deeper down it finally gets the AbstractMethodException.

The Java docs for this state the following:
Thrown when an application tries to call an abstract method. Normally, this error is caught by the compiler; this error can only occur at run time if the definition of some class has incompatibly changed since the currently executing method was last compiled.
So I think this issue could be an issue of dependency management. A different version of geotools was used to run the code than the version used to compile the code. How was this code run? In maven, eclipse , intellij, neo4j server plugin? The  server plugin should have included the geotools libraries it was compiled with, so that should have worked.

Reply all
Reply to author
Forward
0 new messages