Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!zen.net.uk!dedekind.zen.co.uk!aioe.org!.POSTED!not-for-mail From: emf Newsgroups: comp.lang.java.programmer Subject: Re: Applet not running on the web Date: Thu, 10 Jan 2013 07:19:08 -0500 Organization: Aioe.org NNTP Server Lines: 81 Message-ID: References: <50ea1db2$0$284$14726298@news.sunsite.dk> <50ee1ea8$0$292$14726298@news.sunsite.dk> NNTP-Posting-Host: q0ALVNQQ0ipGALYDIb4tnQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:21299 On 2013-01-09 20:51 Arne Vajhøj wrote: > On 1/9/2013 1:40 AM, emf wrote: >> On 2013-01-06 19:58 Arne Vajhøj wrote: >>> Ooops. >>> >>> #FileReader ephemeris = new FileReader("transits/ephemeris.csv"); >>> >>> applets run client side! >>> >>> The user do not have a transits/ephemeris.csv file and the >>> applet would not have priv to access it anyway. >>> >>> Stuff your class files *and* the CSV file in a jar >>> file and let the Java code retrieve the CSV as a resource! >> >> Unfortunately the suggested solutions does not work. > > It works. It has been used thousands of times before. > >> I have both >> versions on the server: >> >> https://files.nyu.edu/emf202/public/jv/NatalTransitsA.html >> >> uses the jar archive, while >> >> https://files.nyu.edu/emf202/public/jv/NatalTransits.html >> >> uses the transits folder. >> >> Both work fine in my browser when running from the local files, but when >> running through the Internet they both give a >> java.security.AccessControlException, after using >> >> catch (e Exception) >> >> The code is here >> >> https://files.nyu.edu/emf202/public/jv/NatalTransitsApplet.java > > You are still using: > > #FileReader ephemeris = new FileReader("transits/ephemeris.csv"); > > I said: > > #and let the Java code retrieve the CSV as a resource > > So you need code like: > > Reader ephemeris = > new > InputStreamReader(getClass().getClassLoader().getResourceAsStream("transits/ephemeris.csv"))); > > > and the file needs to be "transits/ephemeris.csv" within the jar file. > > Arne Arne, the line of code is marvelous! I rechecked the 3 Java books (2 of which I've read through, and 2 of them are over 600p long) and recreating all the code, and they do not have it. That's why these newsgroups are invaluable. Sometimes, of course, you can find answers by googling them, but not always. Thanks to you, the final product: https://files.nyu.edu/emf202/public/jv/NatalTransits.html Still I have to reread some chapter Tarnas' book, and add a paragraph or 2 of what exactly to look for. But the preset Saturn return with 5° orb is very convincing if you've at least 28-29 years old, and even more if you are 60, while the Neptune aspects are rather elusive. Thanks, Eustace -- It ain't THAT, babe! - A radical reinterpretation https://files.nyu.edu/emf202/public/bd/itaintmebabe.html