<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>ResponseMX Blog</title>
	<link>http://www.dottedeyes.com/web_mapping/blog</link>
	<description>A platform for building spatially enabled rich internet applications.</description>
	<pubDate>Wed, 11 Jun 2008 15:14:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2</generator>
	<language>en</language>
			<item>
		<title>Multiple ResponseMX applications with mapserver</title>
		<link>http://www.dottedeyes.com/web_mapping/blog/2008/06/11/multiple-response-mx-applications-with-mapserver/</link>
		<comments>http://www.dottedeyes.com/web_mapping/blog/2008/06/11/multiple-response-mx-applications-with-mapserver/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 12:42:29 +0000</pubDate>
		<dc:creator>Jon Hawkesworth</dc:creator>
		
		<category><![CDATA[MapServer]]></category>

		<category><![CDATA[ResponseMX]]></category>

		<guid isPermaLink="false">http://www.dottedeyes.com/web_mapping/blog/2008/06/11/multiple-response-mx-applications-with-mapserver/</guid>
		<description><![CDATA[In the past, if you used mapserver as the mapping engine, you could only use one ResponseMX server application inside Tomcat.  This was due to the fact that mapserver uses native libraries, which can only be loaded once by any given process, rather than pure java libraries.
We have found a way to remove this [...]]]></description>
			<content:encoded><![CDATA[<p>In the past, if you used mapserver as the mapping engine, you could only use one ResponseMX server application inside Tomcat.  This was due to the fact that mapserver uses native libraries, which can only be loaded once by any given process, rather than pure java libraries.</p>
<p>We have found a way to remove this restriction, which opens up a number of possibilities.  For example, it allows different applications to be created for different user groups. We are already using this to allow us to host several different ResponseMX applications in our test environment.</p>
<p>The change requires a small code modification to the ResponseMX server.  If you would like to run multiple ResponseMX servers on the same tomcat, please contact Dotted Eyes so we can supply you with a new version of ResponseMX server.</p>
<p>There is no configuration required, but you have to make the following changes to your software installation once you have the new server software.</p>
<p><strong>Set up</strong></p>
<p>Assuming you have two ResponseMX applications called rmxa and rmxb, you&#8217;ll need to do the following:</p>
<p>Copy the mapscript.jar file from the WEB-INF/lib folder of one of the ResponseMX applications to $TOMCAT_HOME/shared/lib</p>
<p>For example</p>
<p>cd /opt/app/apache-tomcat-5.5.17/webapps/rmxa/WEB-INF/lib<br />
cp mapscript.jar /opt/app/apache-tomcat-5.5.17/shared/lib</p>
<p>Then for each ResponseMX application installation inside your tomcat, rename the mapscript.jar file so that it is not automatically loaded when ResponseMX starts.</p>
<p>For example</p>
<p>cd /opt/app/apache-tomcat-5.5.17/webapps/rmxa/WEB-INF/lib<br />
mv mapscript.jar mapscript.jar-DO-NOT-LOAD<br />
cd /opt/app/apache-tomcat-5.5.17/webapps/rmxb/WEB-INF/lib<br />
mv mapscript.jar mapscript.jar-DO-NOT-LOAD</p>
<p>Restart tomcat and have fun with maps.</p>
<p><strong>Troubleshooting</strong></p>
<p>It is important that none of the applications try to load mapscript.jar from the WEB-INF/lib folder any more, so if the server won&#8217;t start or won&#8217;t produce maps, check each installed webapp for mapscript.jar first.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dottedeyes.com/web_mapping/blog/2008/06/11/multiple-response-mx-applications-with-mapserver/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ResponseMX Database search enhancements</title>
		<link>http://www.dottedeyes.com/web_mapping/blog/2008/02/29/response-mx-database-search-enhancements/</link>
		<comments>http://www.dottedeyes.com/web_mapping/blog/2008/02/29/response-mx-database-search-enhancements/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 15:53:21 +0000</pubDate>
		<dc:creator>Jon Hawkesworth</dc:creator>
		
		<category><![CDATA[MapXtreme Java]]></category>

		<category><![CDATA[MapServer]]></category>

		<category><![CDATA[ResponseMX]]></category>

		<guid isPermaLink="false">http://www.dottedeyes.com/web_mapping/blog/2008/02/29/response-mx-database-search-enhancements/</guid>
		<description><![CDATA[I&#8217;ve been busy this week enhancing ResponseMX&#8217;s database search functionality.  
At the moment if you have spatial data in Oracle, SQLServer, MySQL or access databases you can configure ResponseMX to search your database records and locate points on your maps.  
In ResponseMX 3 you&#8217;ll have more flexibility when configuring searches.  You&#8217;ll be [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been busy this week enhancing ResponseMX&#8217;s database search functionality.  </p>
<p>At the moment if you have spatial data in Oracle, SQLServer, MySQL or access databases you can configure ResponseMX to search your database records and locate points on your maps.  </p>
<p>In ResponseMX 3 you&#8217;ll have more flexibility when configuring searches.  You&#8217;ll be able to specify how records are matched.  Currently if you enter &#8216;Abbey&#8217; into the search form, you&#8217;ll only find records that start with the word &#8216;Abbey&#8217;.  However, if you add &lt;matchmethod&gt;contains&lt;/matchmethod&gt; inside the &lt;search/&gt; tag, the word Abbey could appear anywhere in field that is being searched, so if you were searching a list of addresses you&#8217;d find &#8216;Mary&#8217;s Abbey Road&#8217; as well as any Abbey Roads, Abbey Streets or Abbey Avenues you might have in your database. </p>
<p>Also, you&#8217;ll be able to conditionally filter out certain records.  This can be useful when generating pre-populated searches.  Say for example you have the locations of pharmacists in your database but wanted to have two pre-populated searches, one showing those offering evening and weekend services and another showing those with daytime opening hours.  In ResponseMX 3 you&#8217;ll be able to add something like the following to your search xml:</p>
<p>&lt;filter&gt;<br />
	&lt;field&gt;Out_Of_Hours&lt;/field&gt;<br />
	&lt;string&gt;Y&lt;/string&gt;<br />
&lt;/filter&gt;</p>
<p>This will change the search so that unless the Out_Of_Hours field contains a Y, the record will not be displayed in the search results.</p>
<p>By the way, both these changes will work the same if you are using database layers or are searching layers drawn from .TAB files and will work the same if you are using MapXtreme Java or MapServer.</p>
<p>Jon</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dottedeyes.com/web_mapping/blog/2008/02/29/response-mx-database-search-enhancements/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Join the ResponseMX team</title>
		<link>http://www.dottedeyes.com/web_mapping/blog/2008/02/12/join-the-responsemx-team/</link>
		<comments>http://www.dottedeyes.com/web_mapping/blog/2008/02/12/join-the-responsemx-team/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 09:22:10 +0000</pubDate>
		<dc:creator>Matt Walker</dc:creator>
		
		<category><![CDATA[ResponseMX]]></category>

		<guid isPermaLink="false">http://www.dottedeyes.com/web_mapping/blog/2008/02/12/join-the-responsemx-team/</guid>
		<description><![CDATA[We&#8217;re looking to recruit a Front End Web Developer into the ResponseMX team.
We&#8217;re looking for someone who is familiar with Object Orientated JavaScript and ActionScript; can create good looking, usable and accessible content and is motivated and willing to learn all about this spatial stuff.
See the careers section for more details.
]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re looking to recruit a Front End Web Developer into the ResponseMX team.</p>
<p>We&#8217;re looking for someone who is familiar with Object Orientated JavaScript and ActionScript; can create good looking, usable and accessible content and is motivated and willing to learn all about this spatial stuff.</p>
<p>See the <a href="http://www.dottedeyes.com/about/careers.php">careers section</a> for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dottedeyes.com/web_mapping/blog/2008/02/12/join-the-responsemx-team/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Load Balancing ResponseMX over clustered Tomcats.</title>
		<link>http://www.dottedeyes.com/web_mapping/blog/2008/02/11/load-balancing-responsemx-over-clustered-tomcats/</link>
		<comments>http://www.dottedeyes.com/web_mapping/blog/2008/02/11/load-balancing-responsemx-over-clustered-tomcats/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 17:11:13 +0000</pubDate>
		<dc:creator>Mike Talbutt</dc:creator>
		
		<category><![CDATA[MapXtreme Java]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[ResponseMX]]></category>

		<guid isPermaLink="false">http://www.dottedeyes.com/web_mapping/blog/2008/02/11/load-balancing-responsemx-over-clustered-tomcats/</guid>
		<description><![CDATA[Load Balancing ResponseMX over clustered Tomcats. 
What is load balancing and clustering. Well a lot cleverer people then me have wrote a lot of text on the different type of load balancing algorithms and clustering methodologies, so instead of regurgitating what my learned colleagues have wrote I&#8217;ll just briefly sum up. 
Load Balancing is a [...]]]></description>
			<content:encoded><![CDATA[<p>Load Balancing ResponseMX over clustered Tomcats. </p>
<p>What is load balancing and clustering. Well a lot cleverer people then me have wrote a lot of text on the different type of load balancing algorithms and clustering methodologies, so instead of regurgitating what my learned colleagues have wrote I&#8217;ll just briefly sum up. </p>
<p>Load Balancing is a method of distributing requests onto multiple servers seamlessly to the user doesn&#8217;t realise. </p>
<p>Clustering is slightly more in-depth. For static web sites load balancing is fine for distributing load, however for statefull applications running on app servers load balancing alone won&#8217;t work. This problem is load balanced servers work completely independently, so consecutive requests sent to different application servers will lose their session. Clustering allows multiple application servers to share their session data, so it is transparent to the user which server they are using at any time </p>
<p>Why would you want to do this ? well for two reasons, firstly to enhance performance, on sites with large volumes (two servers are better then one), giving you more capacity. Secondly for business critical applications distributed server gives fail over, I.e. if one server goes down you have a seconds server there ready to take the load (just like those skeletons in Jason and the Argonauts).</p>
<p>We&#8217;ve been doing some work on ResponseMX with MapXtreme to run over load balanced servers with clustered tomcats. ResponseMX uses session persistence quite heavily to store the state of its geographic maps. Clustered applications can work in a few ways, such as persisting its session data to a database, or broadcasting its sessions data to any other application servers, to do this we need all session data to serialisable, this is allowing data to be streamed to a string or suitable format to be wrote to disk. The changes required to ResponseMX will be included in the 3.0 release, however if you would like to get hold of a Beta version of this functionality in 2.6 please contact a member of the Dotted Eyes team who will be happy to oblige. </p>
<p>To set up our environment we shall be using 2 Tomcat 5 Application servers clustered both running ResponseMX and Mapxtreme. We shall also use Apache HTTP server in front on them to act as our load balancer.</p>
<p>1. Setting up Apache as a load balance (Many thanks to Pascal Forget and Matt Raible) for a great aticle on setting up Apache as load balancer http://raibledesigns.com/tomcat/)</p>
<p>1.1. Download and install Apache2.2 </p>
<p>1.2. Download and install the mod_jk module into the modules directory of Apache</p>
<p>1.3. Add the following text to the Dynamic Shared Object (DSO) Support section of the httpd.conf file to install mod_jk </p>
<p><code>&lt;br /&gt;<br />
&nbsp;&nbsp;LoadModule jk_module modules/mod_jk.so&lt;br /&gt;<br />
&nbsp;&nbsp;JkWorkersFile conf/workers.properties&lt;br /&gt;<br />
&nbsp;&nbsp;JkLogFile logs/mod_jk.log&lt;br /&gt;<br />
&nbsp;&nbsp;JkLogLevel info&lt;br /&gt;<br />
</code></p>
<p>1.4. Add the the following text to the httpd.conf file telling Apache what requests are for ResponseMX and to forward to the Tomcat application server.</p>
<p>
<code>&lt;br /&gt;<br />
&nbsp;&nbsp;JkMount /rmx26* loadbalancer&lt;br /&gt;<br />
&nbsp;&nbsp;JkMount /mapxtreme* loadbalancer&lt;br /&gt;<br />
</code></p>
<p>1.5. Create a workers.properties file in the conf folder of your Apache installation, with the following text</p>
<p><code>&lt;br /&gt;<br />
&nbsp;&nbsp;ps=/&lt;br /&gt;<br />
&nbsp;&nbsp;# list the workers by name&lt;br /&gt;<br />
&nbsp;&nbsp;worker.list=tomcat1, tomcat2, loadbalancer&lt;br /&gt;<br />
&nbsp;&nbsp;# &#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&lt;br /&gt;<br />
&nbsp;&nbsp;# First tomcat server&lt;br /&gt;<br />
&nbsp;&nbsp;# &#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&lt;br /&gt;<br />
&nbsp;&nbsp;worker.tomcat1.port=11009&lt;br /&gt;<br />
&nbsp;&nbsp;worker.tomcat1.host=localhost&lt;br /&gt;<br />
&nbsp;&nbsp;worker.tomcat1.type=ajp13&lt;br /&gt;<br />
&nbsp;&nbsp;worker.tomcat1.lbfactor=100&lt;br /&gt;<br />
&nbsp;&nbsp;# &#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&lt;br /&gt;<br />
&nbsp;&nbsp;# Second tomcat server&lt;br /&gt;<br />
&nbsp;&nbsp;# &#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&lt;br /&gt;<br />
&nbsp;&nbsp;worker.tomcat2.port=12009&lt;br /&gt;<br />
&nbsp;&nbsp;worker.tomcat2.host=localhost&lt;br /&gt;<br />
&nbsp;&nbsp;worker.tomcat2.type=ajp13&lt;br /&gt;<br />
&nbsp;&nbsp;worker.tomcat2.lbfactor=100&lt;br /&gt;<br />
&nbsp;&nbsp;# &#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&lt;br /&gt;<br />
&nbsp;&nbsp;# Load Balancer worker&lt;br /&gt;<br />
&nbsp;&nbsp;# &#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&lt;br /&gt;<br />
&nbsp;&nbsp;worker.loadbalancer.type=lb&lt;br /&gt;<br />
&nbsp;&nbsp;worker.loadbalancer.balanced_workers=tomcat1, tomcat2&lt;br /&gt;<br />
</code>
</p>
<p>2. Set up 2 clustered tomcat instances, for this example we shall be running two instances of tomcat on the same server. We shall also be using the in memory broadcasting clustering setup.</p>
<p>2.1. Download Apache Tomcat, I&#8217;ve tested this configuration on Tomcat 5.5.25 and Java 1.5</p>
<p>2.2. Install it twice in two separate directories. </p>
<p>2.3. Change the server.xml file to make sure tomcat is listening on 2 different ports to avoid those annoying port conflict errors. I&#8217;ve chosen to run mine on ports 9080 and 10080</p>
<p>
<code>&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;Connector port=&quot;9080&quot; maxHttpHeaderSize=&quot;8192&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; maxThreads=&quot;150&quot; minSpareThreads=&quot;25&quot; maxSpareThreads=&quot;75&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enableLookups=&quot;false&quot; redirectPort=&quot;8443&quot; acceptCount=&quot;100&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connectionTimeout=&quot;20000&quot; disableUploadTimeout=&quot;true&quot; /&gt;&lt;br /&gt;<br />
</code></p>
<p>2.4. Change the AJP13 connector ports so they correspond the the ports in the workers.properties file in the apache installation</p>
<p>
<code>&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Connector port=&quot;11009&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enableLookups=&quot;false&quot; redirectPort=&quot;8443&quot; protocol=&quot;AJP/1.3&quot; /&gt;&lt;br /&gt;<br />
</code><br />
2.5. Add the following cluster Element to the server.xml in the Engine element<br />
<code>&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Cluster className=&quot;org.apache.catalina.cluster.tcp.SimpleTcpCluster&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; managerClassName=&quot;org.apache.catalina.cluster.session.DeltaManager&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; expireSessionsOnShutdown=&quot;false&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; useDirtyFlag=&quot;true&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; notifyListenersOnReplication=&quot;true&quot;&gt;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Membership&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;className=&quot;org.apache.catalina.cluster.mcast.McastService&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mcastAddr=&quot;228.0.0.4&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mcastPort=&quot;45564&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mcastFrequency=&quot;500&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mcastDropTime=&quot;3000&quot;/&gt;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Receiver&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;className=&quot;org.apache.catalina.cluster.tcp.ReplicationListener&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tcpListenAddress=&quot;auto&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tcpListenPort=&quot;4001&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tcpSelectorTimeout=&quot;100&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tcpThreadCount=&quot;6&quot;/&gt;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Sender&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;className=&quot;org.apache.catalina.cluster.tcp.ReplicationTransmitter&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;replicationMode=&quot;pooled&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ackTimeout=&quot;15000&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;waitForAck=&quot;true&quot;/&gt;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Valve className=&quot;org.apache.catalina.cluster.tcp.ReplicationValve&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filter=&quot;.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;&quot;/&gt;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Deployer className=&quot;org.apache.catalina.cluster.deploy.FarmWarDeployer&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tempDir=&quot;/tmp/war-temp/&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;deployDir=&quot;/tmp/war-deploy/&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;watchDir=&quot;/tmp/war-listen/&quot;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;watchEnabled=&quot;false&quot;/&gt;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ClusterListener className=&quot;org.apache.catalina.cluster.session.ClusterSessionListener&quot;/&gt;&lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Cluster&gt;&lt;br /&gt;<br />
</code>
</p>
<p>3. Install Mapxtreme471 and ResponseMX on both tomcat instances.</p>
<p>3.1. Some configuration is needed on where the ResponseMX server will write its map images to, and where the client will request them from. The problem with having the application load balanced is you never know which server is going to get the request, and a request for a map from ResponseMX actually means two requests to the server, the xml map request telling the server what geoset to load, the view etc, which will respond with a URL to a map image, and the the second request to get that map image. However on load balanced and even clustered servers the image will only be wrote on that server, so if the second request goes to another server you&#8217;ll get a 404 error. The answer is to write the image to a shared directory (perhaps where your map data is being held). On my example I wrote them to a separate directory outside the ResponseMX application so the images could be requested straight from apache. The parameters that need changing are in the rmx.properties file</p>
<p>
<code>&lt;br /&gt;<br />
&nbsp;&nbsp;servername&nbsp;&nbsp;=&nbsp;&nbsp;rmx1&lt;br /&gt;<br />
&nbsp;&nbsp;image_url&nbsp;&nbsp;=&nbsp;&nbsp;http://&lt;server name&gt;/images&lt;br /&gt;<br />
&nbsp;&nbsp;image_dir&nbsp;&nbsp;=&nbsp;&nbsp;C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/images&lt;br /&gt;<br />
</code></p>
<p>The servername property needs to be different for each clustered tomcat instance. This parameter is appended the the image name to avoid naming conflicts between servers.</p>
<p>3.2. The server.xml in each ResponseMX application needs to be changed; the following line should be added to the web.xml file in the WEB-INF folder.</p>
<p><distributable/></p>
<p>This tell tomcat that the session objects for this application should be shared with any other application servers in the cluster</p>
<p>4. Have fun with maps</p>
<p>4.1. Start both your tomcat instances and apache</p>
<p>4.2. Open a browser and hit the ResponseMX application through Apache on port 80 as opposed to going straight to tomcat (http://(server name)/rmx20 ) </p>
<p>4.3. By looking at the ResponseMX log files you should be able to tell which tomcat instance is is receiving the requests, and if all is working it should be all of them.</p>
<p>Have fun clustering everyone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dottedeyes.com/web_mapping/blog/2008/02/11/load-balancing-responsemx-over-clustered-tomcats/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to display polygons from non-spatial databases</title>
		<link>http://www.dottedeyes.com/web_mapping/blog/2008/02/06/how-to-display-polygons-from-non-spatial-databases/</link>
		<comments>http://www.dottedeyes.com/web_mapping/blog/2008/02/06/how-to-display-polygons-from-non-spatial-databases/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 12:53:33 +0000</pubDate>
		<dc:creator>Jon Hawkesworth</dc:creator>
		
		<category><![CDATA[MapServer]]></category>

		<category><![CDATA[ResponseMX]]></category>

		<guid isPermaLink="false">http://www.dottedeyes.com/web_mapping/blog/2008/02/06/how-to-display-polygons-from-non-spatial-databases/</guid>
		<description><![CDATA[Here&#8217;s a tip for mapserver users which allows you read and display vector data stored within a regular database in ResponseMX.
You will need ODBC access to your database.  I&#8217;ve used mysql on windows for this example but other databases should work just the same.
The tip takes advantage of OGR ability to understand geometry in [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a tip for mapserver users which allows you read and display vector data stored within a regular database in ResponseMX.</p>
<p>You will need ODBC access to your database.  I&#8217;ve used mysql on windows for this example but other databases should work just the same.</p>
<p>The tip takes advantage of OGR ability to understand geometry in Well Known Text (WKT) format, via its Virtual Format mechanism.  </p>
<p>So to be of use, you&#8217;ll need to be able to create WKT feature descriptions and store them in a text column in your non-spatial database.</p>
<p>To do this you need to do the following:</p>
<p>   1. Create a database containing your vector data<br />
   2.  Create a system DSN to give ODBC access to a data source<br />
   3. Create an .ovf file<br />
   4. Test the connection through ogrinfo to prove access to the data<br />
   5. Modify map file<br />
   6. Modify the ResponseMX geoset</p>
<p>Here&#8217;s the detailed steps:</p>
<p>
<h3>1. Create a database containing your vector data</h3>
</p>
<p>Create a database table</p>
<p><code><br />
&nbsp;&nbsp;DROP TABLE IF EXISTS `test`.`polygon_test`;<br />
&nbsp;&nbsp;CREATE TABLE&nbsp;&nbsp;`test`.`polygon_test` (<br />
&nbsp;&nbsp;`Record_Id` int(10) unsigned NOT NULL auto_increment,<br />
&nbsp;&nbsp;`Polygon` text NOT NULL,<br />
&nbsp;&nbsp;`Info` varchar(45) NOT NULL,<br />
&nbsp;&nbsp;PRIMARY KEY&nbsp;&nbsp;(`Record_Id`)<br />
&nbsp;&nbsp;) ENGINE=InnoDB DEFAULT CHARSET=latin1;<br />
</code></p>
<p>Now add some data to it.  The Polygon column is going to hold the geometry which can be a very long string, so it needs to be a text type column.</p>
<p>
<code><br />
insert into polygon_test values (DEFAULT, &#039;POLYGON (( 350600 420200, 350600 440200, 330100 440200, 330100 420200, 350600 420200 ))&#039;, &#039;A square&#039;);<br />
insert into polygon_test values (DEFAULT, &#039;POLYGON (( 436909.520549625 346979.908498395, 428048.086151056 341231.951050675, 431401.061328893 329975.534382221, 443495.721791806 330694.029063187, 446249.951402172 340752.954596698, 446249.951402172 340752.954596698, 436909.520549625 346979.908498395 ))&#039;, &#039;A Pentagon&#039;);<br />
</code>
</p>
<p>
<h3>2 Create a system DSN to give ODBC access to the data source</h3>
</p>
<p>On Windows, Go to Control panel -&gt; Administrative tools -&gt; Data Sources (ODBC) then select the System DSN tab.</p>
<p>Click Add and select the correct driver for whatever database is being used, e.g. SQL Server, MySQL</p>
<p>From this point the set up will be specific to the database server, but typically you will have to configure the database server connection details, such as server name, database name, username and password, default database to connect to.</p>
<p>Test the connection once you have entered the necessary details.</p>
<p>Once you have a working ODBC connection to your database you&#8217;re ready for step 2.</p>
<p>
<h3>3. Create an .ovf file</h3>
</p>
<p>The ovf file provides mapserver with the connection details it needs to retrieve geometry and feature information from the database.</p>
<p>Example .ovf file:</p>
<p>
  &lt;OGRVRTDataSource&gt;<br />
    &lt;OGRVRTLayer name=&#8221;boundaries&#8221;&gt;<br />
     &lt;SrcDataSource&gt;ODBC:TestDbUser/secret@testdb&lt;/SrcDataSource&gt;<br />
        &lt;SrcLayer&gt;geometryTable&lt;/SrcLayer&gt;<br />
        &lt;FID&gt;Record_Id&lt;/FID&gt;<br />
        &lt;GeometryType&gt;wkbPolygon&lt;/GeometryType&gt;<br />
        &lt;GeometryField encoding=&#8221;WKT&#8221; field=&#8221;POLYGON&#8221;/&gt;<br />
    &lt;/OGRVRTLayer&gt;<br />
  &lt;/OGRVRTDataSource&gt;&gt;
</p>
<p>Things you will have to configure:</p>
<p>&lt;OGRVRTLayer name=&#8221;boundaries&#8221;&gt; – this needs to be the name of your data source, in this case &#8216;boundaries&#8217;</p>
<p>    &lt;SrcDataSource&gt;ODBC:TestDbUser/secret@testdb&lt;/SrcDataSource&gt;
</p>
<p> This is the odbc connection string which is in the format</p>
<p>ODBC:username/password@database</p>
<p>or</p>
<p>ODBC:username/password@database,tableName</p>
<p>&lt;SrcLayer&gt;geometryTable&lt;/SrcLayer&gt; – this is where you specify the table that holds your vector data.</p>
<p>&lt;FID&gt;Record_Id&lt;/FID&gt; – this may or may not be required. It is used to specify the column that contains the unique key for the row (the Feature Identifier, hence FID). Mapserver will have a go at guessing but can be confused by some data structures, hence this tag.</p>
<p>For point data you would leave &lt;GeometryType&gt;&lt;/GeometryType&gt; set to wkbPoint and leave the encoding attribute of the &lt;GeometryField/&gt; tag set to “PointFromColumns”.<br />
Then you will need to specify the columns where the x and y coordinates are drawn from in the database table as the x and y attributes of the &lt;GeometryField/&gt; tag.</p>
<p>However, in this example we&#8217;re storing polygons in our database, so you would set<br />
&lt;GeometryType&gt;&lt;/GeometryType&gt; to wkbPolygon and set the GeometryField tag thus:<br />
&lt;GeometryField encoding=&#8221;WKT&#8221; field=&#8221;POLYGON&#8221;/&gt;</p>
<p>  This tells OGR to expect the geometry of our polygons to be stored in a column called POLYGON and encoded in WKT format.</p>
<p>You&#8217;ll need to store your .ovf file in the same folder as your mapserver&#8217;s .map file.  To avoid confusion, give the file a name that matches the layer name you&#8217;re going to give the layer in your .MAP file.  e.g. boundaries.ovf</p>
<p>Be aware that although the .ovf file format looks like xml, it isn&#8217;t actually fully-compliant xml, so don&#8217;t put an xml declaration at the top of the file and if you have problems when you test the connection, make sure you don&#8217;t have blank lines or hidden characters in the file.</p>
<p>
<h3>4. Test the connection through ogrinfo to prove access to the data</h3>
</p>
<p>Having configured your .ovf file, test it using the following ogrinfo command:</p>
<p><code>ogrinfo -al boundaries.ovf</code>
</p>
<p>ogrinfo will warn you that the layer is read only with the following message:</p>
<p><code>ERROR 4: Update access not supported for VRT datasources.</code>
</p>
<p>This is ok - unfortunately virtual format layers can&#8217;t be updated (yet).  If your configuration is correct you will be rewarded with a list of the features in your database.</p>
<p>
<h3>5. Modify map file</h3>
</p>
<p>Now you&#8217;ll need to modify your mapserver&#8217;s .map file to include your new layer.  Note that you&#8217;ll need to provide styling for the layer as there won&#8217;t be any styling information in your database.</p>
<p><code><br />
LAYER<br />
    NAME "boundaries"<br />
    STATUS ON<br />
    CONNECTIONTYPE OGR<br />
    CONNECTION "boundaries.ovf"<br />
    DATA "polygon_test"<br />
    TYPE POLYGON</p>
<p>
<h3>6. Modify the ResponseMX geoset</h3>
</p>
<p>Finally add the layer to the Response MX geoset xml file that corresponds to your mapserver .map file.  Depending on your requirements this may be as simple as adding</p>
<pre>
</pre>
<p>Finally restart ResponseMX to pick up your changes</p>
<p>With luck your new layer is displaying your polygons.</p>
<p>If not here are a few things to check:</p>
<p>If you are using x and y values to retrieve point data, there seems to be a limit to the numeric length that OGR can handle for the FID column approx 12 digits long.</p>
<p>Check that your data is really in Well Known Text format.  When setting up this test I managed to miss a couple of spaces which meant two coordinates were stuck together.  The tell tale for this is ogrinfo -al shows &#8216;POLYGON (string)&#8217; before the feature data but doesn&#8217;t then repeat all the feature data without the &#8216;(string)&#8217;.  In other words ogrinfo can see your data, but can&#8217;t turn it into WKT.</p>
<p>There are several ways in which you can get WKT format wrong - see this post for another example: <a href="http://www.mail-archive.com/mapserver-users@lists.umn.edu/msg03679.html">http://www.mail-archive.com/mapserver-users@lists.umn.edu/msg03679.html</a></p>
<p>Be careful when using the  tag.  I had this in my first few attempts and it stopped mapserver in its tracks.  You shouldn&#8217;t need to specify a SRS in the .ovf file if the data is in the same spatial referencing system as your other layers.</p>
<p>
<h3>Further info</h3>
</p>
<p>Reference on mapserver site:</p>
<p><a href="http://mapserver.gis.umn.edu/docs/reference/vector_data/VirtualSpatialData">http://mapserver.gis.umn.edu/docs/reference/vector_data/VirtualSpatialData</a></p>
<p>Actual ovf file reference documentation:</p>
<p><a href="http://www.gdal.org/ogr/drv_vrt.html">http://www.gdal.org/ogr/drv_vrt.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dottedeyes.com/web_mapping/blog/2008/02/06/how-to-display-polygons-from-non-spatial-databases/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
