Hi Don (and list),
I have solved my problem with this, but I am not sure why noone else has the
same problem. What I did is to catch the exception when trying to open the
jar file and return false. This then means that the resource is then tried
as a URLInputReader and this works. I am not sure why it isn't just loaded
as a URL straight away instead of using the JarInputReader - does this give
some benefit over the URLInputReader?
thanks,
Barney
-----Original Message-----
From: Don Dietrick [mailto:dietrick@bbn.com]
Sent: Friday, 15 March 2002 6:40 AM
To: Wrightson, Barney ( Contractor )
Cc: 'openmap-users@bbn.com'
Subject: Re: openMapApplet and .jar data
Hi Barney,
I've not seen this before. What do your properties look like for the
DTEDLayer? The dted path directory should be the relative path from the
root inside the data.jar file to the dted directory, with no reference
to the data.jar file directly.
- Don
On Wednesday, March 13, 2002, at 06:20 PM, Wrightson, Barney
( Contractor ) wrote:
> Hi guys,
> I am trying to get layer data including DTED and Political
> Boundaries working with the data in a .jar file, and have tried
> changing the
> com.bbn.openmap.io.BinaryFile.java file to use
> Thread.currentThread().getContextClassLoader().getResource(name); but
> this
> results in th following error (using JRE Plugin 1.3.1_02, latest apache,
> NT4, Netscape 6.2):
>
> *** ERROR ***
> access denied (java.io.FilePermission \\host.name.com\openmap\data.jar
> read)
> *************
> java.security.AccessControlException: access denied
> (java.io.FilePermission
> \\host.name.com\openmap\data.jar read)
> at java.security.AccessControlContext.checkPermission(Unknown
> Source)
> at java.security.AccessController.checkPermission(Unknown Source)
> at java.lang.SecurityManager.checkPermission(Unknown Source)
> at java.lang.SecurityManager.checkRead(Unknown Source)
> at java.util.zip.ZipFile.<init>(Unknown Source)
> at java.util.jar.JarFile.<init>(Unknown Source)
> at java.util.jar.JarFile.<init>(Unknown Source)
> at com.bbn.openmap.io.JarInputReader.reopen(JarInputReader.java:73)
> at com.bbn.openmap.io.JarInputReader.<init>(JarInputReader.java:58)
> at
> com.bbn.openmap.io.BinaryFile.setJarInputReader(BinaryFile.java:212)
> at com.bbn.openmap.io.BinaryFile.<init>(BinaryFile.java:131)
> at
> com.bbn.openmap.io.BinaryBufferedFile.<init>(BinaryBufferedFile.java:84)
> at
> com.bbn.openmap.io.BinaryBufferedFile.<init>(BinaryBufferedFile.java:96)
> at
> com.bbn.openmap.layer.shape.SpatialIndex.<init>(SpatialIndex.java:178)
> at
> com.bbn.openmap.layer.shape.SpatialIndex.locateAndSetShapeData
> (SpatialIndex.
> java:709)
> at
> com.bbn.openmap.layer.shape.ShapeLayer.setProperties(ShapeLayer.java:179)
> at
> com.bbn.openmap.util.ComponentFactory.create(ComponentFactory.java:129)
> at com.bbn.openmap.LayerHandler.getLayers(LayerHandler.java:307)
> at
>
com.bbn.openmap.gui.OverviewMapHandler.setProperties(OverviewMapHandler.java
> :334)
> at
> com.bbn.openmap.gui.OverviewMapHandler.init(OverviewMapHandler.java:242)
> at
>
com.bbn.openmap.gui.OverviewMapHandler.findAndInit(OverviewMapHandler.java:
> 9
> 02)
> at
> com.bbn.openmap.gui.OverviewMapHandler.setBeanContext
> (OverviewMapHandler.jav
> a:966)
> at java.beans.beancontext.BeanContextSupport.add(Unknown Source)
> at
> com.bbn.openmap.PropertyHandler.createComponents(PropertyHandler.java:515)
> at com.bbn.openmap.app.OpenMapApplet.init(OpenMapApplet.java:142)
> at sun.applet.AppletPanel.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>
> where my applet is at http://host.name.com/openmap/
> with 2 jar files, openmap.jar that contains the altered BinaryFile.class
> and data.jar that contains a layer I am creating and the DTED and
> Political
> Boundaries data
>
> Any ideas why java is acting as if the jar is a local file that I don't
> hava
> permission to access?
>
> thanks,
> Barney
>
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick@bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Thu Mar 21 23:21:32 2002
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:32 EDT