moovida / hydrologis4polymap

Plugins by HydroloGIS for the Polymap project
0 stars 1 forks source link

Upload: Unable to add resource to the catalog #5

Open fb71 opened 7 years ago

fb71 commented 7 years ago

TODO:

Test:

java.lang.RuntimeException: java.lang.IllegalStateException: Error while initializing. at com.hydrologis.polymap.geopaparazzi.servlets.GeopaparazziUploadServlet.addToCatalog(GeopaparazziUploadServlet.java:140) at com.hydrologis.polymap.geopaparazzi.servlets.GeopaparazziUploadServlet.doPost(GeopaparazziUploadServlet.java:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:360) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:370) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494) at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalStateException: Error while initializing. at org.polymap.model2.engine.UnitOfWorkImpl.createEntity(UnitOfWorkImpl.java:173) at org.polymap.core.catalog.local.LocalMetadataCatalog$2.newEntry(LocalMetadataCatalog.java:178) at com.hydrologis.polymap.geopaparazzi.servlets.GeopaparazziUploadServlet.addToCatalog(GeopaparazziUploadServlet.java:113) ... 30 more Caused by: java.lang.RuntimeException: Unable to resolve imported data source. at com.hydrologis.polymap.geopaparazzi.servlets.GeopaparazziUploadServlet.lambda$0(GeopaparazziUploadServlet.java:134) at org.polymap.core.catalog.local.LocalMetadataCatalog$2.lambda$0(LocalMetadataCatalog.java:181) at org.polymap.model2.engine.UnitOfWorkImpl.createEntity(UnitOfWorkImpl.java:168) ... 32 more Caused by: java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (no such table: metadata) at org.sqlite.core.DB.newSQLException(DB.java:890) at org.sqlite.core.DB.newSQLException(DB.java:901) at org.sqlite.core.DB.throwex(DB.java:868) at org.sqlite.core.NativeDB.prepare(Native Method) at org.sqlite.core.DB.prepare(DB.java:211) at org.sqlite.jdbc3.JDBC3Statement.executeQuery(JDBC3Statement.java:81) at org.jgrasstools.dbs.spatialite.jgt.JGTStatement.executeQuery(JGTStatement.java:53) at org.jgrasstools.gears.io.geopaparazzi.GeopaparazziUtilities.getProjectInfo(GeopaparazziUtilities.java:205) at com.hydrologis.polymap.geopaparazzi.servlets.GeopaparazziUploadServlet.lambda$0(GeopaparazziUploadServlet.java:118) ... 34 more

fb71 commented 7 years ago

SessionContext was missing. Fix in master.

fb71 commented 7 years ago

Inside the servlet the NewLayerOperation is not properly working as we are outside the user session. Asking the user via dialogs is not possible. So the map extent is not adopted.