{"id":1290,"date":"2017-12-05T16:13:40","date_gmt":"2017-12-05T16:13:40","guid":{"rendered":"https:\/\/max-drake.cc\/?p=1290"},"modified":"2020-08-17T15:29:05","modified_gmt":"2020-08-17T15:29:05","slug":"openmaint-gis-localhost-no-success-date","status":"publish","type":"post","link":"https:\/\/max-drake.cc\/?p=1290","title":{"rendered":"OpenMAINT and GIS on Localhost. Part 1"},"content":{"rendered":"<p>I decided to look at the GIS ( Geographic Information System) component of OpenMAINT. I decided to test this initially on my PC.<\/p>\n<h2>To date, I have not been able to activate the GIS component.<\/h2>\n<p><span style=\"color: #ff0000;\"><strong>I am stuck with the following error:<\/strong><\/span><\/p>\n<p><em>Call: services\/json\/schema\/setup\/saveconfiguration<\/em><br \/>\n<em> &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/em><br \/>\n<em> Error: org.cmdbuild.exception.ORMException: ORM_POSTGIS_NOT_FOUND<\/em><br \/>\n<em> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at org.cmdbuild.exception.ORMException<\/em><\/p>\n<p>But the steps below may speed up others attempting to get it going.<\/p>\n<p><strong>Information on the process<\/strong><\/p>\n<p>First, getting the right packages. I have postGIS 2.2 installed, see <a href=\"https:\/\/max-drake.cc\/setup-openmaint-localhost-win-10-pc-win-server-later-blog\/\">first blog on setting up<\/a>. It recommends this package.<\/p>\n<p>Next it suggests Geoserver 2.8.3 in the same list of requirements. Ensure you have the WAR file and not the .exe file (my fist iterative mistake).<\/p>\n<p>Here for <a href=\"http:\/\/blog.geoserver.org\/2016\/03\/23\/geoserver-2-8-3-released\/\">Geoserver 2.8.3 page<\/a> and <a href=\"https:\/\/sourceforge.net\/projects\/geoserver\/files\/GeoServer\/2.8.3\/geoserver-2.8.3-war.zip\/download\">WAR download here<\/a>.<\/p>\n<p>The references for this exercise are from CMDBuild Manuals, you can find them <a href=\"http:\/\/www.cmdbuild.org\/en\/documentazione\">here:<\/a><\/p>\n<ul>\n<li>CMDBuild User Manual p50 to 53<\/li>\n<li>CMDBuild Technical Manual page 8 &amp; 48. Note- Page 8 important.<\/li>\n<li>CMDBuild Administration Manual 102 to 106<\/li>\n<\/ul>\n<p>On the CMDBuild forum I found the following:<\/p>\n<p><em><strong>The Problem<\/strong> <\/em><\/p>\n<p><em>Hi There &#8211; I have downloaded and installed Geoserver as per Technical Manual page 48, have deleted all preinstalled workspaces and created a new one. How ever when I try and enable GIS i get the following error: PostGIS not installed.<\/em><\/p>\n<p><em><strong> From Tecnoteca<\/strong> <\/em><\/p>\n<p><em>the problem concerns the PostGIS spatial database. Have you followed the correct procedure to restore them (http:\/\/www.cmdbuild.org\/file\/manuali\/technical-manual-in-english page 8) ? CMDBuild Team <\/em><\/p>\n<p><em>From &lt;http:\/\/www.cmdbuild.org\/forum\/forum-for-advanced-cmdbuild-users\/78829857?b_start=0#863640488&gt; <\/em><\/p>\n<p><strong><em>Also<\/em><\/strong><\/p>\n<p><em> Hi Andrea, when you restore of a databse containing a gis schema (as the openmaint-empty-gis.backup) you must follow the procedure explained at page 8 of CMDBuild Technical Manual (http:\/\/www.cmdbuild.org\/file\/manuali\/technical-manual-in-english). Basically you need to create a new database, create the gis schema, create the gis functions and then perform the restore of the backup. Hope this helps! Kind regards CMDBuild Team <\/em><\/p>\n<p><em>From &lt;http:\/\/www.cmdbuild.org\/forum\/forum-in-english\/902594555?b_start=0#6284086&gt;<\/em><\/p>\n<p>From the User Manual:<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-1295 aligncenter lazyload\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-01.png\" alt=\"\" width=\"1079\" height=\"1097\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-01.png 1079w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-01-295x300.png 295w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-01-768x781.png 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-01-1007x1024.png 1007w\" data-sizes=\"(max-width: 1079px) 100vw, 1079px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1079px; --smush-placeholder-aspect-ratio: 1079\/1097;\" \/><\/p>\n<ul>\n<li>So the inference is that you only need the postGIS installation to have the map functioning.<\/li>\n<li>The Geoserver is there to pull in the raster\/vector files.<\/li>\n<li>The setup also needs at least one geographical attribute (in the database)<\/li>\n<\/ul>\n<p><strong>From Page 8 of Technical Manual:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong><em>If you have to restore an existing database (using for example the \u201cpsql\u201d tool):<\/em><\/strong><\/p>\n<p><em>$ psql &#8230; cmdbuild<\/em><\/p>\n<ol>\n<li><em>cmdbuild=# CREATE SCHEMA gis; &nbsp;<\/em><\/li>\n<li><em>&nbsp;cmdbuild=# SET SEARCH_PATH TO gis, public; <\/em><\/li>\n<li><em>cmdbuild=# \\i ${POSTGIS_DIR}\/postgis.sql<\/em><\/li>\n<li><em>cmdbuild=# \\i ${POSTGIS_DIR}\/legacy.sql (if you use PostGIS 2.0)<\/em><\/li>\n<li><em>cmdbuild=# ALTER DATABASE ${DB_NAME} SET search_path=&#8221;$user&#8221;, public, gis; cmdbuild=# DROP TABLE gis.geometry_columns;<\/em><\/li>\n<li><em>cmdbuild=# DROP TABLE gis.spatial_ref_sys;<\/em><\/li>\n<\/ol>\n<p><em>Web site of reference: <a href=\"http:\/\/www.postgresql.org\/\">http:\/\/www.postgresql.org\/<\/a><\/em><\/p>\n<h3>Make a Backup of your Database before you start<\/h3>\n<p>Before you start messing with this part of the process, make a backup of your database. Its not a bad idea to make a backup of your whole setup actually.<\/p>\n<p>To make a backup of your database, right click on the database (item 1 in image 2 below) and click on backup. Find a nice safe place to put this.<\/p>\n<p>As I have 4 instances of openMAINT running (2 localhost\/2 vps) I get a bit casual about this, but you shouldn&#8217;t. OpenMAINT is like a leach and sucks hours of your time away, so try and minimise this.<\/p>\n<h3>Setting up the GIS Schema<\/h3>\n<p>From the above I have to go back to my original setup and 1\/ drop any GIS schemas in my Postgres Database<\/p>\n<p>check to see that the original GIS Schema is set correctly , items 1 to 6 above, then upload the empty gis database which came with the openmaint file.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1297 lazyload\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-03.png\" alt=\"\" width=\"1037\" height=\"263\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-03.png 1037w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-03-300x76.png 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-03-768x195.png 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-03-1024x260.png 1024w\" data-sizes=\"(max-width: 1037px) 100vw, 1037px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1037px; --smush-placeholder-aspect-ratio: 1037\/263;\" \/><\/p>\n<p>So the first thing you need to do is fire up your Postgrs database, if there is a gis schema already there, delete it.<\/p>\n<p>I found, if there were functions&nbsp; (and I think preliminary ones has (3) then they are associated with the schema and it will not let you just DROP the schema, you need to use drop\/cascade and this deletes the functions , tables and schema. (see numbers 5 &amp; 6)<\/p>\n<p>When testing, if there was a gis schema already there, I just renamed it by right clicking on the schema and editing name&nbsp; in the properties.<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-1296 aligncenter lazyload\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-02.png\" alt=\"\" width=\"817\" height=\"1185\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-02.png 817w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-02-207x300.png 207w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-02-768x1114.png 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-02-706x1024.png 706w\" data-sizes=\"(max-width: 817px) 100vw, 817px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 817px; --smush-placeholder-aspect-ratio: 817\/1185;\" \/><\/p>\n<p>So, after going through items 1 to 6 above you create a blank schema called gis.<\/p>\n<p>Next you restore the <strong>openmaint-1.1-empty-gis.backup <\/strong>file by right clicking on the database you are using , in the diagram above it is item 1. &#8220;om&#8221;.<\/p>\n<p>This seemed to have left my openmaint &amp; shark databases intact and only updated the gis schema.<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-1298 aligncenter lazyload\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-04.png\" alt=\"\" width=\"2610\" height=\"900\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-04.png 2610w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-04-300x103.png 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-04-768x265.png 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-04-1024x353.png 1024w\" data-sizes=\"(max-width: 2610px) 100vw, 2610px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 2610px; --smush-placeholder-aspect-ratio: 2610\/900;\" \/><\/p>\n<p>As&nbsp; you can see above, if you query the new table created (note also there are 53 functions now associated with this schema), there is a single spacial reference, which is what is required from the user manual.<\/p>\n<h3>Setting up Geoserver<\/h3>\n<p>I also just installed the&nbsp;&nbsp; <strong>Geoserver 2.8.3.war<\/strong> file in the C:\\alfresco\\tomcat\\webapps directory and then ran the bat start file to start tomcat.<\/p>\n<p><strong>Login : admin<\/strong><\/p>\n<p><strong>Pasword: geoserver<\/strong><\/p>\n<p>As soon as its started and gone through the whole process, you need to stop Tomcat and remove the <strong>Geoserver 2.8.3.war<\/strong> file .<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-1299 aligncenter lazyload\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-05.png\" alt=\"\" width=\"776\" height=\"521\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-05.png 776w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-05-300x201.png 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-05-768x516.png 768w\" data-sizes=\"(max-width: 776px) 100vw, 776px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 776px; --smush-placeholder-aspect-ratio: 776\/521;\" \/><\/p>\n<p>You should now have a newly created geoserver directory in the webapps directory.<\/p>\n<p>So, start tomcat again and go to your browser localhost:8080 and when tomcat starts, go to Manager App and you will see the geoserver running.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1301 lazyload\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-06.png\" alt=\"\" width=\"2383\" height=\"1745\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-06.png 2383w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-06-300x220.png 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-06-768x562.png 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-06-1024x750.png 1024w\" data-sizes=\"(max-width: 2383px) 100vw, 2383px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 2383px; --smush-placeholder-aspect-ratio: 2383\/1745;\" \/><\/p>\n<p>Click on the geoserver name on the left and it will take you to the geoserver page<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1300 lazyload\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-07.png\" alt=\"\" width=\"2489\" height=\"1464\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-07.png 2489w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-07-300x176.png 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-07-768x452.png 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-07-1024x602.png 1024w\" data-sizes=\"(max-width: 2489px) 100vw, 2489px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 2489px; --smush-placeholder-aspect-ratio: 2489\/1464;\" \/><\/p>\n<p>Go to the workspaces and create a new workspace, I called mine omgis.<\/p>\n<h3>OpenMaint setup<\/h3>\n<p>Now we have these items up and running, we should be able to get the openMAINT setup, so fire up openMAINT as your superadmin person and go into the Data Manager Module.<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-1306 aligncenter lazyload\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-08.png\" alt=\"\" width=\"2978\" height=\"1837\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-08.png 2978w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-08-300x185.png 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-08-768x474.png 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-08-1024x632.png 1024w\" data-sizes=\"(max-width: 2978px) 100vw, 2978px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 2978px; --smush-placeholder-aspect-ratio: 2978\/1837;\" \/><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-1305 lazyload\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-09.png\" alt=\"\" width=\"2999\" height=\"1848\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-09.png 2999w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-09-300x185.png 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-09-768x473.png 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-09-1024x631.png 1024w\" data-sizes=\"(max-width: 2999px) 100vw, 2999px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 2999px; --smush-placeholder-aspect-ratio: 2999\/1848;\" \/><\/p>\n<p>And that is as far as I have got so far.<\/p>\n<p>I have looked on the CMDBuild forum page and used Google Translate for the italian comments, but no success so far.<\/p>\n<p>A couple of things I haven&#8217;t tried yet.<\/p>\n<p>1\/ Restore my original Database, blow away any GIS schemas in&nbsp; it.<\/p>\n<p>Create a new database and restore the <strong>openmaint-1.1-empty-gis.backup <\/strong>file to that.<\/p>\n<p>Then try and Backup the GIS schema and restore that in my original Database.<\/p>\n<p>2\/ Looking on my Demo VPS on Amazon, it looks like the<strong> openmaint-1.1-demo.backup<\/strong> file also has the gis schema in it too.&nbsp; So maybe some testing on that one to see if I can get the postGIS working there. (Update, this instance has exactly the same error as above)<\/p>\n<p>3\/ As usual, rather than just loading up parts in openMAINT and using, you have to delve into all the components to figure out what is happening.<\/p>\n<h3>See <a href=\"https:\/\/max-drake.cc\/openmaint-gis-lo\u2026-partial-success\/\">part 2<\/a> for the next episode<\/h3>\n","protected":false},"excerpt":{"rendered":"<p>I decided to look at the GIS ( Geographic Information System) component of OpenMAINT. I decided to test this initially on my PC. To date, I have not been able to activate the GIS component. I am stuck with the following error: Call: services\/json\/schema\/setup\/saveconfiguration &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; Error: org.cmdbuild.exception.ORMException: ORM_POSTGIS_NOT_FOUND &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at org.cmdbuild.exception.ORMException But the steps below may [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1295,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7,9],"tags":[16,112,113,53,54,114],"class_list":["post-1290","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-maps","category-openmaint-assettiger","category-openmaint-setup","tag-amfm-data-management","tag-cafm","tag-cmms","tag-facility-management","tag-facility-operations","tag-iwms"],"featured_image_src":"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-01.png","featured_image_src_square":"https:\/\/max-drake.cc\/wp-content\/uploads\/2017\/12\/om-01.png","author_info":{"display_name":"Max Drake","author_link":"https:\/\/max-drake.cc\/?author=1"},"_links":{"self":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/1290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1290"}],"version-history":[{"count":0,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/1290\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/media\/1295"}],"wp:attachment":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}