Unable to open HTTP connection from Applet when called from JavaScript

VERIFIED DUPLICATE of bug 74367

Status

Core Graveyard
Java: OJI
--
blocker
VERIFIED DUPLICATE of bug 74367
17 years ago
7 years ago

People

(Reporter: udoo, Assigned: edburns)

Tracking

Trunk
x86
Windows NT

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; 0.8) Gecko/20010215
BuildID:    Mozilla 0.8; Gecko/20010215

An HTTP connection inside an applet is not possible, when the call comes from
JavaScript. It seems that the security settings are to stringent when a
javascript function calls a public java method. Calling of URL.openStream() (and
simalar methods) results in an AccessControlException: access denied
(java.net.SocketPermission <address> resolve).


Reproducible: Always
Steps to Reproduce:
1) see attached html and java (source and class) files
2) put all files into the same folder 
3) start SimplePhoneBack.html
4) the applet as well as the java console shows the first line of the html
source (due to a http get-request inside the applet start method). 
5) press the button "http get"

Actual Results:  java.security.AccessControlException: access denied
  (java.net.SocketPermission p49985.wdf.sap-ag.de resolve)
  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.checkConnect(Unknown Source)
  at sun.plugin.protocol.jdk12.http.HttpURLConnection.connectStep1(Unknown Source)
  at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
  at java.net.URL.openStream(Unknown Source)
  at com.sap.weblab.SimplePhoneBack.httpGet(SimplePhoneBack.java:36)
  at java.lang.reflect.Method.invoke(Native Method)
  at sun.plugin.liveconnect.PrivilegedCallMethodAction.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)


Expected Results:  an alert box with <!-- This is the first line of the html
source -->

This bug report is related to bug #69466
(http://bugzilla.mozilla.org/show_bug.cgi?id=69466) which I posted due to the
same problem. Bug #69466 changed to another problem so I opened this report with
new informations.
(Reporter)

Comment 1

17 years ago
Created attachment 29443 [details]
SimplePhoneBack.html
2x posted

*** This bug has been marked as a duplicate of 74367 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → DUPLICATE

Comment 3

17 years ago
Verified. Double submit.
Status: RESOLVED → VERIFIED

Updated

7 years ago
Component: Java: OJI → Java: OJI
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.