jBox Java applet

Andhare, Manjiri mandhare at STATE.PA.US
Mon Nov 22 10:10:33 EST 2004


Hi Rich,
Thanks for correcting me the way I have specified the archive. I have
changed the code base to "c:/Inetpub/wwwroot/MapServer/java/jBox"
And archive to "jBoxPNG.jar.
But after hitting the "initialize" button, when I looked at the
generated source code , I found that the path to the png map image
generated by Mapserver was incorrect. Previously,I had put the code for
displaying the map image as:
<param name="image" value="http://[host][img]">
But my image was in heep://localhost/MapServer/Docs/tmp folder.
So I changed that line to:
<param name="image" value="http://[host]/MapServer/Docs/[img]"
But the problem is, when mapserver put the value for [img], it creates
it as:  " \tmp\ITASCA11011353302004.png"
Therefore I'm getting the value for the map image in the source as:
<param name="image"
value="http://localhost/MapServer/Docs/\tmp\ITASCA11011353302004.png">
But I'm not getting the way so that the mapserver could correctly get
the path to the image.
An after doing all these changes, I neither see the map in the browser
not the java consol error. So, I'm not sure whether the java applet is
being called and executed or not.
If someone could point to the mistake I'm doing, please help me with
this..
Thank you,
Manjiri Andahre
GIS co-ordinator
PA Fish & Boat commission
tel: (814)3595182
fax:(814)3595153
 
-----Original Message-----
From: Richard Greenwood [mailto:richard.greenwood at gmail.com] 
Sent: Thursday, November 18, 2004 2:36 PM
To: Andhare, Manjiri
Cc: mapserver-users at lists.umn.edu
Subject: Re: [UMN_MAPSERVER-USERS] jBox Java applet

Looks like there are problems with your codebase and archive
parameters. You have:
    codebase="java\jBox"
    archive="jBoxPNG.jar,png.jar"

The way you have codebase, the 'java' directory will not be found. I
assume that 'mapserver' is an IIS virtual directory, so try:
    'codebase=/mapserver/java/jbox'
Forward slashes, not back slashes, as this is a URI, not a DOS path.

I'm a little unclear on the specification of two jar files in the
archive parameter. Is that legal? Where'd you come up with that? And
you have the .jar files in /mapserver/java/jbox/ not a subdirectory,
right?

You might want to start with GIFs and the standard jBox, rather than
jBoxPNG which requries the sixlegs library. If you're using the Sun
Java VM, you don't need six-legs anyway.

I am cc'ing the mapserver-users list as others may spot something that I
missed.

Rich
-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com



On Thu, 18 Nov 2004 09:49:02 -0500, Andhare, Manjiri
<mandhare at state.pa.us> wrote:
> Yes I have JVM and after running the demo, if I check the java
console,
> I get following:
> ----------------------------------------------------
> load: class jBoxPNG.class not found.
> 
> java.lang.ClassNotFoundException: jBoxPNG.class
> 
>         at sun.applet.AppletClassLoader.findClass(Unknown Source)
> 
>         at java.lang.ClassLoader.loadClass(Unknown Source)
> 
>         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
> 
>         at java.lang.ClassLoader.loadClass(Unknown Source)
> 
>         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
> 
>         at sun.applet.AppletPanel.createApplet(Unknown Source)
> 
>         at sun.plugin.AppletViewer.createApplet(Unknown Source)
> 
>         at sun.applet.AppletPanel.runLoader(Unknown Source)
> 
>         at sun.applet.AppletPanel.run(Unknown Source)
> 
>         at java.lang.Thread.run(Unknown Source)
> 
> Caused by: java.io.IOException: open HTTP connection failed.
> 
>         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
> 
>         at sun.applet.AppletClassLoader.access$100(Unknown Source)
> 
>         at sun.applet.AppletClassLoader$1.run(Unknown Source)
> 
>         at java.security.AccessController.doPrivileged(Native Method)
> 
>         ... 10 more
> 
> Manjiri Andahre
> GIS co-ordinator
> PA Fish & Boat commission
> tel: (814)3595182
> fax:(814)3595153
> 
> 
> 
> -----Original Message-----
> From: Richard Greenwood [mailto:richard.greenwood at gmail.com]
> Sent: Thursday, November 18, 2004 9:43 AM
> To: Manjiri Andhare
> Subject: Re: [UMN_MAPSERVER-USERS] jBox Java applet
> 
> Do you have a Java Virtual machine installed?
> Get one here:
> 
>    http://www.java.com/en/download/installed.jsp
> 
> Rich
> --
> Richard Greenwood
> richard.greenwood at gmail.com
> www.greenwoodmap.com
> 
> On Thu, 18 Nov 2004 07:29:16 -0600, Manjiri Andhare
> <mandhare at state.pa.us> wrote:
> > Hi!
> > I was looking for the functionality to draw a rectangle for zooming
in
> on
> > the map. I found jBox by Steve Lime on
> > http://mapserver.gis.umn.edu/contributed.html
> > I have Windows 2000 and I'm running mapserver 4.2 on IIS.
> > I follwed the steps from jBox HOWTO 4.2 to test it with the workshop
> demo.
> > But when i try to run the workshop demo with "Basic application"
> option, in
> > the status bar of Browser(I'm using IE 6.0) I get the message as;
> > Loading Java Applet Failed..
> > And I'm not getting the reason behind this..
> > Here is the changed portion of itasca_basic.html file:
> > ***************************************
> >
> > <html>
> > <head>
> >   <title>MapServer - Itasca Application</title>
> >    <script language="javascript">
> >
> >    function setbox_handler(name,minx,miny,maxx,maxy)
> >      {
> >      document.mapserv.imgbox.value = minx + " " + miny
> > + " " + maxx + " " + maxy;
> >      document.mapserv.imgxy.value = minx + " " + miny;
> >      //additional code can go here prior to the form
> > submit, below
> >      //for example, form validation code.
> >      document.mapserv.submit();
> >       }
> >    function seterror_handler(message)
> >    {
> >     alert(message);
> >    }
> >   </script>
> > </head>
> > <body bgcolor="#ffffff">
> >
> > <center><h1>MapServer - Itasca Application</h1></center>
> > <hr>
> > <form method="GET" action="cgi-bin/mapserv.exe" name="mapserv" >
> >
> > <center>
> > <table border="0" cellspacing="0" cellpadding="4">
> > <tr>
> > <td valign="top" align="center">
> >   <table width="390" border="0" cellspacing="0" cellpadding="4"
> > align="center" bgcolor="#666666">
> >     <tr>
> >       <td colspan="2">
> >   <applet
> >    codebase="java\jBox"
> >    archive="jBoxPNG.jar,png.jar"
> >    code="jBoxPNG.class"
> >    width="600"
> >    height="600"
> >    name="jBox"
> >    MAYSCRIPT>
> >    <param name="image" value="http:\\[host][img]">
> >   </applet>
> >  </td>
> >  </tr>
> >     <tr><td bgcolor="#666666">
> >       <img title="scalebar (mi)" alt="scalebar (mi)"
src="[scalebar]">
> >     </td></tr>
> >   </table>
> > </td>
> > <td valign="top" bgcolor="#ffffff">
> >   <table cellpadding="5" cellspacing="0" border="0"
bgcolor="#ffffff">
> >     <tr><td>
> >       <center><input type="submit" value="Refresh/Query"></center>
> >       <p>
> >
> >       <input type="radio" name="mode" value="browse" checked>
> <b>Browse
> > map</b><br>
> >       <input type="radio" name="mode" value="query"> <b>Query
> > feature</b><br>
> >       <input type="radio" name="mode" value="nquery"> <b>Query
> multiple
> > features</b>
> >
> >       <hr>
> >
> >       <p>
> >       <b>Select Layers to Display: </b><br>
> >       <select multiple name="layer" size=3>
> >         <option value="airports" [airports_select]> Airports
> >         <option value="cities" [cities_select]> Cities
> >         <option value="lakespy2" [lakespy2_select]> Lakes & Rivers
> >         <option value="dlgstln2" [dlgstln2_select]> Streams
> >         <option value="roads" [roads_select]> Roads
> >         <option value="twprgpy3" [twprgpy3_select]> Townships
> >         <option value="drgs" [drgs_select]> USGS 1:250,000 Quads
> >       </select>
> >
> >       <p>
> >       Zoom In <input type=radio name=zoomdir value=1
> [zoomdir_1_check]>
> >       Pan <input type=radio name=zoomdir value=0 [zoomdir_0_check]>
> >       Zoom Out <input type=radio name=zoomdir value=-1
> [zoomdir_-1_check]>
> >       <p>
> >       Zoom Size <input type=text name=zoomsize size=4
> value=[zoomsize]>
> >       <p>
> >
> >       <font size=+1><b>Legend</b></font><br><hr>
> >       <img src="[legend]"><hr>
> >
> >       <p>
> >       <center>
> >   <input name="ref" type="image" src="[ref]"
> > border="0"></center>
> >     </td></tr></table>
> >
> >   </td></tr>
> > </table>
> > </center>
> > <input type="hidden" name="imgbox" value="-1 -1 -1 -1">
> >
> > ***************************************************
> >
> > I have placed the jBox as:
> > c:\Inetpub\wwwroot\MapServer\java\jBox
> > And I have placed the jar files, class files and java source files
> from
> > lib,classes and src folders respectively under
> > c:\Inetpub\wwwroot\MapServer\java\jBox
> >
> > If somebody could point out what i'm missing,it'll be great!!
> > Thank you,
> > Manjiri Andhare
> > GIS Coordinator
> > PA Fish & Boat Commission
> > U.S.A.
> >
> 
>



More information about the mapserver-users mailing list