MapscriptJNI - No such file failure in new_projectionObj

McGraw, Joanne mcgrawj at AGR.GC.CA
Mon Mar 27 11:14:14 PST 2006


Solution:

The problem was that the Java code (actually, dll at that point) could not find MapServer's epsg definition file. It CAN find it if the file is placed under C:\proj (in Windows) or if the directory it exists in is pointed to by the PROJ_LIB environment variable (any operating system). 

This is noted in the README.TXT file in MapServer's /proj directory.

Cheers,
jtm


Joanne T. McGraw
GIS Data Analyst / Analyste des données du SIG
Agriculture and Agri-Food Canada / Agriculture et Agroalimentaire Canada
Telephone/Téléphone: 613 759-6103
Facsimile/Télécopieur: 613 759-1937
960 Carling Ave, Bldg. 20, Rm. 1136
Ottawa, Ontario
K1A 0C6

mcgrawj at agr.gc.ca


		-----Original Message-----
		From: McGraw, Joanne 
		Sent: Friday, March 24, 2006 3:44 PM
		To: 'MAPSERVER-USERS at LISTS.UMN.EDU'
		Subject: MapscriptJNI - No such file failure in new_projectionObj

		It's taken a while but I have finally been able to get something to happen in a Java Mapscript environment. In a JSP running on Tomcat 5.5.9, I created a new mapObj, drew it and saved the results to a file. Okay, good.

		Now, I'm actually trying to do what I started out wanting to do in the first place and am completely stuck. I have a JSP that receives an input EPSG projection, an output EPSG projection and a bounding box provided in the coordinate system of the input EPSG projection. So, my first two lines of code are:

		  String szProjIn = "init=" + request.getParameter("INPROJ");
		  // szProjIn contains "init=EPSG:42304"
		  projectionObj oProjIn = new projectionObj(szProjIn);

		When the code attempts the new projectionObj(szProjIn) code, it fails with the following message:

		java.lang.UnknownError: No such file or directory
			at edu.umn.gis.mapscript.mapscriptJNI.new_projectionObj(Native Method)
			at edu.umn.gis.mapscript.projectionObj.<init>(projectionObj.java)
			at org.apache.jsp.MapScript_jsp._jspService(org.apache.jsp.MapScript_jsp:52)
			at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
			at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

		I'm guessing, but have no way of knowing, that the problem is that the new_projectionObj code in the dll is looking for a file that details the EPSG:42304 projection and not finding it. I'm assuming too that it's the /proj/epsg file that is part of the standard MapServer installation. If all this is correct, where in the Tomcat server configuration is it looking for this file? At the moment, my jar is under the app's WEB-INF/lib/ directory and the dll is in the same place.

		If this is not the problem, does anyone have any ideas what else it might be? 

		Cheers,
		jtm



More information about the MapServer-users mailing list