<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>Java Mapscript Error</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">Hi,</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I am hoping that someone is going to be able to help me out here.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I am using the Java version of mapscript, along with Tomcat to produce dynamic mapping for an application. Whilst coloring all features on a layer with the same color all is ok. Once I try to classify the features, the first client displays ok, but when another client invokes a session&nbsp; I get this error message</FONT></P>

<P><FONT SIZE=2 FACE="Arial">java.lang.UnknownError: loadSymbolSet(): Unknown identifier. Parsing error near (SYMBOL):(line 0)</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">at edu.umn.gis.mapscript.mapscriptJNI.mapObj_setSymbolSet(Native Method)</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">at edu.umn.gis.mapscript.mapObj.setSymbolSet(mapObj.java:461)</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I have replicated this using a simple loop to draw my map as below</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">public void doMap(){</FONT>

<BR><FONT SIZE=2 FACE="Arial">int j;</FONT>

<BR><FONT SIZE=2 FACE="Arial">for (j=0;j&lt;10;j++){</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;drawMap(j);</FONT>

<BR><FONT SIZE=2 FACE="Arial">}</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">public void drawMap(int index){</FONT>

<BR><FONT SIZE=2 FACE="Arial">String filename = &quot;mapImg&quot;+Integer.toString(index)+&quot;.jpg&quot;;</FONT>

<BR><FONT SIZE=2 FACE="Arial">mapObj icemap = new mapObj(&quot;&quot;);</FONT>

<BR><FONT SIZE=2 FACE="Arial">rectObj mainExtent = new rectObj(-77.1,38.85,-76.9,38.95,mapscriptConstants.MS_FALSE);&nbsp;&nbsp; </FONT>

<BR><FONT SIZE=2 FACE="Arial">icemap.setExtent(mainExtent);</FONT>

<BR><FONT SIZE=2 FACE="Arial">setPaths(icemap,index);</FONT>

<BR><FONT SIZE=2 FACE="Arial">icemap.setHeight(800);</FONT>

<BR><FONT SIZE=2 FACE="Arial">icemap.setWidth(800);</FONT>

<BR><FONT SIZE=2 FACE="Arial">doImageColor(icemap);</FONT>

<BR><FONT SIZE=2 FACE="Arial">webObj thisWeb = icemap.getWeb();</FONT>

<BR><FONT SIZE=2 FACE="Arial">thisWeb.setImagepath(&quot;/var/maps/tmp/&quot;);</FONT>

<BR><FONT SIZE=2 FACE="Arial">addLayerInfo(icemap,&quot;Urban Area&quot;,&quot;ap&quot;,mapscriptConstants.MS_LAYER_POLYGON,mapscriptConstants.MS_ON,0,10000000,15657698,&quot;NAME&quot;,&quot;georgia-bold&quot;,6,100000,50000000,0,0.0,0); </FONT></P>

<P><FONT SIZE=2 FACE="Arial">addthermalMap2(icemap);</FONT>

<BR><FONT SIZE=2 FACE="Arial">imageObj mapImg = icemap.draw();</FONT>

<BR><FONT SIZE=2 FACE="Arial">mapImg.save(&quot;/var/maps/tmp/&quot;+filename,icemap);</FONT>

<BR><FONT SIZE=2 FACE="Arial">icemap.delete();</FONT>

<BR><FONT SIZE=2 FACE="Arial">}</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">In addLayerInfo I create a layer etc etc and define a class with an empty expression (ie all features)</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">classObj oMapClass = new classObj(aLayer);</FONT>

<BR><FONT SIZE=2 FACE="Arial">oMapClass.setExpression(&quot;&quot;);</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">In addthermalMap2 I create an expression for an attrubute field frst as such</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">oMapClass.setExpression(&quot;([frst]&gt;=3.0)&quot;);</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">The function setPath , sets the path to shapefiles, symbol &amp; font files. </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp; public void setPaths(mapObj icemap, int index){</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icemap.setShapepath(&quot;/var/maps/shapefiles/&quot;);</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(&quot;Set Shape path&quot;);</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icemap.setSymbolSet(symSet); // THIS IS THE LINE THAT CAUSES IT TO STOP</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(&quot;Set Symbol&quot;);</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icemap.setFontSet(&quot;/var/maps/symbols/fonts.txt&quot;);</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(&quot;Set Font&quot;);</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp; }</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">The second time around the loop setPath generates the error message. If i comment out the addthermalMap, it runs ok ? I have seen something similar posted for php/mapscript. Is there any way round this ? Have I missed the point and done something wrong ? Is it a known bug ? If so is it planned to fix it ? This is real urgent as I have a deadline of end of this month to have the first system out for test.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">Thanks Stephen</FONT>
</P>

</BODY>
</HTML>