Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #21237

Re: Applet not running on the web

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!news.stack.nl!aioe.org!.POSTED!not-for-mail
From emf <emfril@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: Applet not running on the web
Date Wed, 09 Jan 2013 01:40:56 -0500
Organization Aioe.org NNTP Server
Lines 97
Message-ID <kcj34i$ido$1@speranza.aioe.org> (permalink)
References <kcd5kg$elb$1@speranza.aioe.org> <50ea1db2$0$284$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/17.0 Thunderbird/17.0
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.java.programmer:21237

Show key headers only | View raw


On 2013-01-06 19:58 Arne Vajhøj wrote:
> On 1/6/2013 7:46 PM, emf wrote:
>> The webpage is:
>>
>> https://files.nyu.edu/emf202/public/jv/NatalTransits.html
>>
>> and you can find the code in
>>
>> https://files.nyu.edu/emf202/public/jv/transits/NatalTransitsApplet.java
>>
>> The applet was working without a problem from the beginning in the
>> eclipse applet viewer. Then I managed to make it work on browser from my
>> computer by putting the class and the csv files into a transits folder
>> (like the package in eclipse) and the html in the higher level
>> directory. Then I created the same structure in the webserver. The
>> applet loads, when you enter a invalid birthdate it lets you know, but
>> when you enter a valid birthdate it seems that it does nothing. I tried
>> to troubleshoot adding JOptionPanes, and the problem seems to be in the
>> planet array method:
>>
>> // array of date, planet position formatted to integer, and in minutes
>> public int[][] planetArray(String birthday$) {
>>      int i = 0;
>>      String textLine = null;
>>      int[][] planetArray = new int[36525][2];
>>      try {
>>          FileReader ephemeris = new FileReader("transits/ephemeris.csv");
>>          BufferedReader buffer = new BufferedReader(ephemeris);
>>          String date;
>>          do {
>>              textLine = buffer.readLine();
>>              date = textLine.substring(0, 8);
>>              i++;
>>          } while (!date.equals(birthday$));
>>          for (i = 0; i < 36525; i++) {
>>              planetArray[i][0] = Integer.parseInt(textLine.substring(0,
>>                  8));
>>              planetArray[i][1] =
>>                  toMinutes(textLine.substring(planetPlace,planetPlace
>>                  + 5));
>>              textLine = buffer.readLine();
>>              if (textLine == null) {
>>                  break;
>>              } //the remaining places of the array are 0
>>          }
>>          buffer.close();
>>      } catch (IOException e) {
>>          outputArea.setText("Invalid date input.");
>>          outputArea.append("\n" + e.toString());
>>      }
>>      return planetArray;
>> }
>>
>> but the try block does not catch any errors. What could the problem be?
>
> 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!
>
> Arne

Unfortunately the suggested solutions does not work. 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

What is done is similar cases?

Eustace

-- 
Canto General - a folk oratorio of Mikis Theodorakis
https://files.nyu.edu/emf202/public/mt/index.html

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Applet not running on the web emf <emfril@gmail.com> - 2013-01-06 19:46 -0500
  Re: Applet not running on the web Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 19:56 -0500
    Re: Applet not running on the web emf <emfril@gmail.com> - 2013-01-09 01:21 -0500
  Re: Applet not running on the web Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 19:58 -0500
    Re: Applet not running on the web emf <emfril@gmail.com> - 2013-01-07 03:39 -0500
    Re: Applet not running on the web emf <emfril@gmail.com> - 2013-01-09 01:40 -0500
      Re: Applet not running on the web Lew <lewbloch@gmail.com> - 2013-01-08 23:01 -0800
        Re: Applet not running on the web emf <emfril@gmail.com> - 2013-01-10 07:08 -0500
      Re: Applet not running on the web Arne Vajhøj <arne@vajhoej.dk> - 2013-01-09 20:51 -0500
        Re: Applet not running on the web emf <emfril@gmail.com> - 2013-01-10 07:19 -0500
          Re: Applet not running on the web Arne Vajhøj <arne@vajhoej.dk> - 2013-01-10 07:20 -0500
  Re: Applet not running on the web Roedy Green <see_website@mindprod.com.invalid> - 2013-01-08 22:56 -0800
    Re: Applet not running on the web emf <emfril@gmail.com> - 2013-01-09 02:46 -0500
      Re: Applet not running on the web Roedy Green <see_website@mindprod.com.invalid> - 2013-01-09 11:22 -0800
    Re: Applet not running on the web Arne Vajhøj <arne@vajhoej.dk> - 2013-01-09 20:44 -0500
  Re: Applet not running on the web Roedy Green <see_website@mindprod.com.invalid> - 2013-01-09 11:26 -0800

csiph-web