Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: UDIG 1.2.RC1
-
Fix Version/s: UDIG 1.2.RC3
-
Component/s: database
-
Labels:None
Description
From Luk on udig-users:
I'm trying to load some postGIS data in udig. I'm able to create the new
layers but nothing appears due to an rendering error. The error is:
"Rendering: Exception(s) occourred during rendering: Must call hasNext
before calling next".
Jody tested and found the following:
Well I have an "answer" but I was not very happy with it ... I was able to reproduce the error (and fix it). However the application only ran into this case when it was unable to unpack the "EPSG.zip" file into a temporary directory. So although I fixed the problem showed up in the stack trace it was not really where the problem occured....
So can you check your logs and see if there are any complaints about not being able to write to a temp directory and unpack "EPSG.zip"?
If you can check please send me the section of the logfile; and hopefully I can learn something (or make a good bug report for GeoTools).
After that, I ended up clearing out that directory myself, and after a restart the application was able to connect. Attached is a screen snap of the PostGIS instance described in walkthrough 1...
So we got two issues here:
1) The EPSG.zip did not get unpacked; and thus EPSG definitions were not available to PostGIS
2) If the Layer and FeatureSource CoordianteReferenceSystems do not match...
- The CRS is forced in there using ForceCoordinateSystemFeatureResults(featureSource.getFeatures(), layer.getCRS());
- Which is in turn wrapped up in DataUtilities.source(collection)
- which calls next() without hasNext() to sort out the FeatureType
ENTRY net.refractions.udig.tools.edit 1 0 2010-03-31 11:34:09.733
!MESSAGE
!STACK 0
java.lang.IllegalStateException: Must call hasNext before calling next
at org.geotools.jdbc.JDBCFeatureReader.ensureNext(JDBCFeatureReader.java:238)
at org.geotools.jdbc.JDBCFeatureReader.next(JDBCFeatureReader.java:252)
at org.geotools.jdbc.JDBCFeatureReader.next(JDBCFeatureReader.java:82)
at org.geotools.data.store.ContentFeatureCollection$WrappingFeatureIterator.next(ContentFeatureCollection.java:197)
at org.geotools.data.store.ContentFeatureCollection$WrappingFeatureIterator.next(ContentFeatureCollection.java:177)
at net.refractions.udig.project.internal.commands.edit.AddFeatureCommand.getNewFeature(AddFeatureCommand.java:101)
at net.refractions.udig.tools.edit.commands.CreateAndSelectNewFeature.run(CreateAndSelectNewFeature.java:92)
at net.refractions.udig.project.command.UndoableComposite.execute(UndoableComposite.java:81)
at net.refractions.udig.tools.edit.BehaviourCommand.execute(BehaviourCommand.java:65)
at net.refractions.udig.project.command.UndoableComposite.execute(UndoableComposite.java:78)
at net.refractions.udig.project.command.CommandManager$Executor.execute(CommandManager.java:394)
at net.refractions.udig.project.command.CommandManager$Executor.run(CommandManager.java:325)
at net.refractions.udig.project.command.CommandManager$Executor.run(CommandManager.java:311)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)