[Date Prev][Date Next] [Chronological] [Thread] [Top]

[mapserver-users] Java Mapscript, trouble compiling a servlet



Hello Sathis,

it looks like

I did an rpm install of tomcat4 and it did put a
/etc/tomcat4/conf/tomcat4.conf. If you have done other type of
installation, it might be somewhere else. Actaully that is the file
where you configure the JAVA_HOME variable.
OK I finally found the config file. I installed Tomcat4 via a shell script and therefore the config file (catalina.sh) is located in the tomcat/bin directory. I included the following line

export LD_LIBRARY_PATH=/path/to/directory:$LD_LIBRARY_PATH


As far as I understood, libmapscript.so and one another .so file is all
it matters if you want to use java mapscript. It has everything needed
within itself. I don't thing, where the mapserver is at, matters. You
just send the path where libmapscript.so is to tomcat.
You talk a about a second .so file. I did not know there are to of them.

Then you create a webapp and deploy it using tomcat manager. you can put
the mapscript class files at WEB-INF/lib directory if you have them in a
jar file or put them in WEB-INF/class/mapscript otherwise for a webapp.
This is something I got right. I put the class files in jar file called mapscript and placed it into the WEB-INF/lib directory.

Then I tried to compile your servlet example. But I got two types of error messages:
32. long image = map.prepareImage(); <------------------------> *** Error: The type of the left-hand side in this assignment, "long", is not compatible with the type of the right-hand side expression, "mapscript/imageObj".
35. layercounty.draw(map.getCPtr(),image); <-----------------------------------> *** Error: No match was found for method "draw(long, long)".

If I replace long with imageObj I get the following error message

<----------------------------------------------------------------------------------------------------------- 50. mapscript.msSaveImage(image,"/usr/lib/jakarta-tomcat-4.0.1/webapps/mapserver/"+filename,map.getImagetype(), 51. map.getTransparent(),map.getInterlace(),map.getImagequality()); ---------------------------------------------------------------------------------------------> *** Error: No match was found for method "msSaveImage(mapscript.imageObj, java.lang.String, int, int, int, int)".

How do I go about casting the imageObj so the the single methods are able to use them? Or do I still have a problem with the general setup?

Thanks in advance
Andreas


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com