Hi,
I'm trying to make a little app that displays some POI ( by modyfing the seagull tut) but i can't seem to connect to Postgis; I've done a little debugging and i noticed that, in the PostgisServiceExtension2.createService method code execution seems to always stop at the (!getFactory().canProcess(params)) condtion which will be 1 and so the method returns a big fat null
http://imageshack.us/f/204/ss20110918201557.png/.

The main reason for this seems to be (if only it would return true :D ) :

http://imageshack.us/f/101/ss20110918202320.png/

the code snippet i'm trying (i'm aiming for a non-null "service" for now; can't wait to finally do some queries) java.util.Map<String,Serializable> params = new HashMap<String,Serializable>();
    params.put("dbtype", "postgis");           // must be "postgis"
params.put("host", "localhost"); // the name or ip address of the machine running PostGIS params.put("port", new Integer(5432)); // the port that PostGIS is running on (generally 5432) params.put("database", "postgis"); // the name of the database to connect to. params.put("user", "postgres"); // the user to connect with
    params.put("passwd", "12345");

    IRepository local = CatalogPlugin.getDefault().getLocal();
IService service = local.acquire( params, new NullProgressMonitor() ); // should not be null but it is


i get the following exception BTW:
java.io.IOException: Unable to connect to any service supporting {port=5432, passwd=12345, dbtype=postgis, host=localhost, user=postgres, database=postgis} at net.refractions.udig.catalog.internal.CatalogImpl.acquire(CatalogImpl.java:337)
    at mytest.seagul.MapView$YSetBackgroundFileAction.run(MapView.java:238)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at mytest.seagul.Application.start(Application.java:20)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
dataHandles empty


What am i doing wrong?
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to