Hi,<br><br> I'm trying to get point data out of mysql to display on a map. I'm using the following .ovf file, which I've tested using ogrinfo and seems to work fine.<br><br><span style="font-family: courier new,monospace;">
<OGRVRTDataSource></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> <OGRVRTLayer name="test_gis"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> <SrcDataSource>MYSQL:test_gis,user=root,password=mypword,host=<a href="http://127.0.0.1">127.0.0.1</a>,port=3306,tables=boxes</SrcDataSource></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> <SrcSQL>SELECT fid, x, y FROM boxes</SrcSQL></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> <GeometryType>wkbPoint</GeometryType>
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> <GeometryField encoding="PointFromColumns" x="x" y="y" z="z" />
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </OGRVRTLayer></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
</OGRVRTDataSource></span><br><br>When I go to the jsp that draws the map I get these errors:<br><br><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.
</u></p><p><b>exception</b> </p><pre>org.apache.jasper.JasperException: Failed to draw layer named 'test_gis'.<br> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)<br> org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:375)<br> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)<br> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)<br> javax.servlet.http.HttpServlet.service(HttpServlet.java
:802)<br></pre><p><b>root cause</b> </p><pre>javax.servlet.ServletException: Failed to draw layer named 'test_gis'.<br> org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)<br> org.apache.jasper.runtime.PageContextImpl.handlePageException
(PageContextImpl.java:791)<br> org.apache.jsp.boxes.dartmoor_005fpoints_jsp._jspService(dartmoor_005fpoints_jsp.java:74)<br> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)<br> javax.servlet.http.HttpServlet.service
(HttpServlet.java:802)<br> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)<br> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)<br> org.apache.jasper.servlet.JspServlet.service
(JspServlet.java:264)<br> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)<br></pre><p><b>root cause</b> </p><pre>java.lang.UnknownError: Failed to draw layer named 'test_gis'.<br> edu.umn.gis.mapscript.mapscriptJNI.mapObj_draw
(Native Method)<br> edu.umn.gis.mapscript.mapObj.draw(mapObj.java:382)<br> org.apache.jsp.boxes.dartmoor_005fpoints_jsp._jspService(dartmoor_005fpoints_jsp.java:56)<br> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java
:97)<br> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)<br> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)<br> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:314)<br> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)<br> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)<br></pre><br><br>I've tried loads of different things in the .map file (below) but I still end up with the same problem. Does anyone know what I'm going wrong?
<br><br>Thanks,<br>Sarah<br><br><span style="text-decoration: underline;">Map file:</span><br><br><span style="font-family: courier new,monospace;">MAP</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
NAME DARTMOOR_POINTS</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> STATUS ON</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
SHAPEPATH "/usr/local/apache-tomcat-5.5.17/webapps/ROOT/boxes/"</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> EXTENT 250000.000000 57000.000000 260000.000000
70000.000000</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> SIZE 400 400</span><span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> WEB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> IMAGEPATH "/usr/local/apache-
tomcat-5.5.17/webapps/ROOT/temp/"</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> IMAGEURL "/temp/"</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> END</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> LAYER</span>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> NAME "test_gis"</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
STATUS ON</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> TYPE POINT</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
PROJECTION</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "proj=latlong"</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> "ellps=WGS84"</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "datum=WGS84"
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> END</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
CONNECTIONTYPE OGR</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> CONNECTION "test_gis.ovf"</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> DATA "test_gis"</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> CLASS</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> NAME "boxes"</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> SYMBOL 0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> COLOR 0 0 0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> OUTLINECOLOR 255 0 0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> END</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> END</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">END<br><br><span style="font-family: arial,sans-serif; text-decoration: underline;">JSP File<br><br></span><%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<br> pageEncoding="ISO-8859-1"%><br><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br><html><br><%@ page import = "edu.umn.gis.mapscript.mapObj" %><br>
<%@ page import = "edu.umn.gis.mapscript.imageObj" %><br><br><% mapObj vMap;<br> String vMapName = "/usr/local/apache-tomcat-5.5.17/webapps/ROOT/boxes/dartmoor_points.map";<br> vMap = new mapObj(vMapName);
<br> String vMapFile = "/usr/local/apache-tomcat-5.5.17/webapps/ROOT/boxes/dartmoor_points.mapfile";<br> vMap.setMappath(vMapName);<br> imageObj img = vMap.draw();<br> img.save(vMapFile,vMap);<br><br>
<br>%><br><head><br></head><br><body><br>Image:<br><br><image src="dartmoor_points.mapfile"><br></body><br></html><br><br></span>