Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] [jira] Created: (UDIG-1683) PostGIS Connection Missing

PostGIS Connection Missing
--------------------------

                 Key: UDIG-1683
                 URL: http://jira.codehaus.org/browse/UDIG-1683
             Project: uDIG
          Issue Type: Bug
          Components: database
    Affects Versions: UDIG 1.2.RC3
            Reporter: Jody Garnett


Here is the origional email from David Epstein:
{panel}
Hi folks,

I am relatively new to Udig & PostGIS. I am using Ubuntu 9.04 and Udig
1.2-RC3.

I am having trouble displaying PostGIS layers generated from US Census
shapefiles available at:

http://www2.census.gov/cgi-bin/shapefiles2009/national-files

I load the shapefiles into PostGIS using this statement on the
commandline:

shp2pgsql -W IBM850 -s 4269 -c County99_d00 county99_pg US_National |
psql -d US_National

I believe that the text encoding and SRID are correct. The loading
appears to proceed without a problem.

After adding the layers using Layer-->Add, the layers are displayed in
the lefthand layer window with small X's signifying something is wrong.
The map window remains empty. The table window says "displaying
features..." but remains empty. If I right-click to see a layer's
properties, the status field of the summary window says:

RenderingProblem rendering: Exception rendering layer
DefaultMapLayer[ Test, VISIBLE, UNSELECTED, style=StleImpl[ name=Default
Styler],
data=net.refractions.udig.project.internal.impl.UDIGFeatureStore@5fb39192, query=Query:[Request All Features]
feature type: null
filter: Filter.INCLUDE
[properties: ALL]]

I was able to display these layers with some difficulty before if I did
not include the -s switch and set it manually after loading into Udig.

I am having two other difficulties, perhaps related:

(1) If I load new geometry using the commandline loader, I can see the
new tables in pgAdmin and in Udig initially, but not in the 2nd loading
screen of Udig right before it actually loads the layers. I need to
restart the program. Simply re-connecting to the database does not seem
to be sufficient.

(2) It is really unclear to me when a map configuration is "saved".
Sometimes when I close a map all the setting are kept so that when I
restart the software, my project comes up just as before. Sometimes this
does not happen. Is there a way to know this for certain? The "save"
option seems always unavailable (gray).

Any advice would be welcomed!
-david
{panel}

What is most interesting here is the "feature type: null"

Asking for the logs we get:
{panel}
I can load and display shapefiles fine. I cannot seem to display postGIS
layers. From pgadminIII, I can see that the tables have data and--in
particular--that "the_geom" column is not empty. I've attached below an
example from the log. Sorry for the length. I'm not sure what is key
information. I do notice the word "missing" coming up a lot, which
cannot be good. I also see "feature type:null". But, shp2pgsql completes
without an error.

Is there a test, perhaps from a tutorial using known data that I can use
to diagnose what is wrong?
----------
java.lang.NullPointerException
	at org.geotools.jdbc.JDBCDataStore.createConnection(JDBCDataStore.java:1420)
	at org.geotools.jdbc.JDBCDataStore.getConnection(JDBCDataStore.java:1377)
	at org.geotools.jdbc.JDBCFeatureSource.getCountInternal(JDBCFeatureSource.java:404)
	at org.geotools.data.store.ContentFeatureSource.getCount(ContentFeatureSource.java:409)
	at org.geotools.jdbc.JDBCFeatureStore.getCountInternal(JDBCFeatureStore.java:172)
	at org.geotools.data.store.ContentFeatureSource.getCount(ContentFeatureSource.java:409)
	at org.geotools.data.store.ContentFeatureCollection.size(ContentFeatureCollection.java:290)
	at org.geotools.feature.collection.DecoratingFeatureCollection.size(DecoratingFeatureCollection.java:168)
	at net.refractions.udig.ui.FeatureTableContentProvider$ContentLoader.setEnabled(FeatureTableContentProvider.java:344)
	at net.refractions.udig.ui.FeatureTableContentProvider$ContentLoader.run(FeatureTableContentProvider.java:243)
	at net.refractions.udig.ui.PlatformGIS$Runner.run(PlatformGIS.java:187)
	at net.refractions.udig.ui.PlatformGIS$Runner.run(PlatformGIS.java:212)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
{panel}

Looking at the code:
{code}
        JDBCTransactionState tstate = (JDBCTransactionState) t.getState(this);
        if(tstate != null) {
            return tstate.cx;
        } else {
            Connection cx = createConnection();
            try {
                cx.setAutoCommit(false);   /// <---- ERROR OCCURS HERE
            } catch (SQLException e) {
                throw (IOException) new IOException().initCause(e);
            }
            
            tstate = new JDBCTransactionState(cx, this);
            t.putState(this, tstate);
            return cx;
        }
{code}

Where the create connectionConnection() method ends up calling DataSource.getConnect() which must be returning null.
Really cannot imagine what the trouble is.

Any suggestions for debugging?
- Checking the postgis access logs?
- Are the steps used to load the data correct? Apparently the user has now tried with QGis


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


Back to the top