[OpenMap Users] PropUtils.getResourceOrFileOrURL(PropUtils.java:735) - fails under web start

From: Carsten Ø. Madsen <com_at_navicon.dk>
Date: Tue, 26 Jan 2010 09:25:54 +0100

Hello

I'm not sure this is a bug in PropUtils but running something like this
under java web start (tested on 1.6.17 under windows XP)

String openMapUserFile = System.getProperty("user.home") +
"/openmap.properties";
Properties props =
PropertyHandler.fetchProperties(PropUtils.getResourceOrFileOrURL(openMapUserFile));

results in:

java.lang.IllegalArgumentException: name
     at sun.misc.URLClassPath$Loader.findResource(Unknown Source)
     at sun.misc.URLClassPath.findResource(Unknown Source)
     at java.net.URLClassLoader$2.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findResource(Unknown Source)
     at com.sun.jnlp.JNLPClassLoader.findResource(Unknown Source)
     at java.lang.ClassLoader.getResource(Unknown Source)
     at com.sun.jnlp.JNLPClassLoader.access$001(Unknown Source)
     at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at com.sun.jnlp.JNLPClassLoader.getResource(Unknown Source)
     at
com.bbn.openmap.util.PropUtils.getResourceOrFileOrURL(PropUtils.java:735)
     at
com.bbn.openmap.util.PropUtils.getResourceOrFileOrURL(PropUtils.java:680)

Running it as a regular java app works fine.

I have changed it to:

String openMapUserFile = System.getProperty("user.home") +
"/openmap.properties";
File openmapProperties = new File(openMapUserFile);
Properties props = new Properties();
if (openmapProperties.exists()) {
     FileInputStream fis = new FileInputStream(openmapProperties);
     props.load(fis);
     fis.close();
}

Could PropUtils be made java web start aware so I can continue to use
getResourceOrFileOrURL?

BTW: The problem has a stack trace similar to this
http://openmap.bbn.com/mailArchives/openmap-users/2005-06/4132.html

BR
Carsten


--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Tue Jan 26 2010 - 03:28:11 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT