1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 <2007> 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 <2007> 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: CAJ options |
From: | Matej Sekoranja <[email protected]> |
To: | [email protected] |
Date: | Wed, 16 May 2007 11:35:31 +0200 |
Hi, all! Igor notified me that there is a JCA/CAJ debate going on... :) Note that applets are run in a "sanbox" and do not have the same permissions like any ordinary java application, simple reasion: you do not want an applet to delete your local files. Calls as IO/file calls are restricted, some system calls call and also making TCP/UDP connections to the other-than-originating server (from where applet was loaded) are not allowed, so this will not work for for JCA (I guess this is the problem here). Still there is a simple solution. You must sign the JAR file. Signed JARs (accepted by user) will gain more permissions. Just a note: catch(Exception ex) { System.err.println("Initialization failed for " + dpm.dataSource+":\n" + ex + "\n"); System.exit(1); } Exception handling is one of the things that 99% of (java) programmers do not do right. Just to be short (not to write the whole essay): if you cannot handle the exception, stack it (and provide any context information) and rethrow, or at least (not really nice solution) dump the whole stack trace (this will show you the source of the problems). Still it is safer to catch Throwable than Exception. So add line "ex.printStackTrace()" after println. Matej |