RMI question - VMID

  • Thread starter Andrew Thompson
  • Start date
A

Andrew Thompson

.
com.ms.security.SecurityExceptionEx[java/rmi/dgc/VMID.<clinit>]: ...
having to do either (i) download the full Java plugin - i.e. only download
only the necessary class(es) (ii) signing the applet - I have heard this
extremely painful and is pretty much a last resort.

You can try using the PolicyTool to adjust
individual browsers to use the applet, but
that is not really practical for anything
beyond an intranet.

Figure how to sign your code, and you will
never look back.
 
H

Horace

Hello

I have a very simple applet that uses RMI as follows :-

import java.applet.*;
import java.net.*;
import java.io.*;
import java.awt.*;
import java.rmi.dgc.*;
public class GetHandle extends Applet {
public VMID vm;
public String vmStr;
public void init() {
vm = new VMID();
vmStr = vm.toString();
}
}

I am invoking this applet from the following HTML :-

<script language="JavaScript">
function x() {
alert(document.GetHandle.vmStr);
}
</script>
<HTML>
<BODY onload=javascript:x()>
<applet id=GetHandle name=GetHandle code="GetHandle.class"
codebase="../rmi/"
archive="../rmi/rmi.jar"
width=0 height=0 VIEWASTEXT>
</applet>
</BODY>
</HTML>

I have downloaded the rmi.jar file used from a website.

When the HTML is invoked I get the following error message in the Java
console of my IE browser (note that on some machines I get the the error
message [in the Java console] and the alert box showing the VMID but on
other machines there is just the error message [in the Java console] with no
alert box) :-

com.ms.security.SecurityExceptionEx[java/rmi/dgc/VMID.<clinit>]: cannot
connect to "my-machine-name"
at com/ms/security/permissions/NetIOPermission.check
at com/ms/security/PolicyEngine.deepCheck
at com/ms/security/PolicyEngine.checkPermission
at com/ms/security/StandardSecurityManager.chk
at com/ms/security/StandardSecurityManager.chkex
at com/ms/security/StandardSecurityManager.checkConnect
at java/net/InetAddress.getLocalHost
at java/rmi/dgc/VMID.<clinit>
at GetHandle.init
at com/ms/applet/AppletPanel.securedCall0
at com/ms/applet/AppletPanel.securedCall
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.run
at java/lang/Thread.run

My question : is there a way to get rid of the above error message *without*
having to do either (i) download the full Java plugin - i.e. only download
only the necessary class(es) (ii) signing the applet - I have heard this
extremely painful and is pretty much a last resort.

Many thanks
Phil
 
G

Guest

Andrew

Thanks for the reply - it's such a small thing I want want to do that
signing an applet doesn't seem justified - perhaps there's an alternative.
All's I'm trying to do is the following :-
- identify the client machine - this cannot change throughout the course of
the user's session - ideally it would be unique (but this is not absolutley
necessary - I'm not worried about nanoseconds - i.e. VMID is fine)
- without having to drop a cookie
- make it very difficult for the client to modify

I have tried :-
- VMID through the means shown
- IP address (via ASP Request.ServerVariables("REMOTE_ADDR") and/or Java
java.net.InetAddress.getLocalHost().getHostAddress() / getHostName())
- session.sessionID, but this cannot be relied on, when using frames, to be
the same across frames

Do you know of any other alternatives or suggestions ?

Cheers
Phil


Andrew Thompson said:
com.ms.security.SecurityExceptionEx[java/rmi/dgc/VMID.<clinit>]: ..
having to do either (i) download the full Java plugin - i.e. only download
only the necessary class(es) (ii) signing the applet - I have heard this
extremely painful and is pretty much a last resort.

You can try using the PolicyTool to adjust
individual browsers to use the applet, but
that is not really practical for anything
beyond an intranet.

Figure how to sign your code, and you will
never look back.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
A

Andrew Thompson

Please do not top-post..
<http://www.physci.org/codes/javafaq.jsp#netiquette>

Because...
Andrew Thompson said:
com.ms.security.SecurityExceptionEx[java/rmi/dgc/VMID.<clinit>]: ..
having to do either (i) download the full Java plugin
....
Do you know of any other alternatives or suggestions ?
You can try using the PolicyTool..

[ * ..becasue often you miss important bits,
like 'PolicyTool', which I had already suggested.. ]
 
H

Horace

Andrew, thanks but it's an Internet application, so as you mentioned
adjusting client browsers using a PolicyTool is not really an option. I
have a solution but I don't know how stable it is. Instead of using VMID I
have used UID (as in java.rmi.server.UID). This returns an ID and *no*
security error message.

However, with the bailout of the JVM by Microsoft on IE, are applets stable
now as well as future versions of IE. I assume IE 7 won't have Java support
as part of the standard - will the user be required to download the Java
plugin for all applets ?

Cheers
Phil



Andrew Thompson said:
Please do not top-post..
<http://www.physci.org/codes/javafaq.jsp#netiquette>

Because...
Andrew Thompson said:
com.ms.security.SecurityExceptionEx[java/rmi/dgc/VMID.<clinit>]:
..
having to do either (i) download the full Java plugin
...
Do you know of any other alternatives or suggestions ?
You can try using the PolicyTool..

[ * ..becasue often you miss important bits,
like 'PolicyTool', which I had already suggested.. ]

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
A

Andrew Thompson

However, with the bailout of the JVM by Microsoft on IE, are applets stable
now as well as future versions of IE.

That sounds to me like the question
"Can I expect Java to be installed
in the the user's browser"

Short answer, no. Long answer..
..I assume IE 7 won't have Java support
as part of the standard - will the user be required to download the Java
plugin for all applets ?

Assume it. Use the JavaVersionApplet
to let your users kknow what is happening in
case they have 1.1 and you code for 1.4,
otherwise use the 'alt' and 'no applet'
options to inform the user..

"You need the Sun Java Plug-In to view
this fine software "

(shrugs) Bottom line, you simply cannot
reach 100% of internet users if you rely
on Applets. Some users will not have it,
and will have no option for getting it.
(I could be barred by the system admin,
for instance)
 
A

Andrew Thompson

.
(I could be barred by the system admin,
for instance)

...errr
"(IT [Java*] could be barred by the system admin,
for instance)"

* As opposed to "I [A.T.] could be barred..",
though that is a contiguous and ever present
possibility.. ;-)
 
H

Horace

Andrew, is it possible to run an applet from within an Internet web page
without the user having to download the plugin - i.e. is there software that
wraps up all required classes that an applet will use into one compact jar
file, include that jar file within your applet/object tag, so that there's
no need for the 15MB worth of plugin download.
Cheers
Phil




Andrew Thompson said:
(I could be barred by the system admin,
for instance)

..errr
"(IT [Java*] could be barred by the system admin,
for instance)"

* As opposed to "I [A.T.] could be barred..",
though that is a contiguous and ever present
possibility.. ;-)

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
A

Andrew Thompson

Andrew, is it possible to run an applet from within an Internet web page
without the user having to download the plugin
No.

..- i.e. is there software that
wraps up all required classes that an applet will use into one compact jar
file, include that jar file within your applet/object tag, so that there's
no need for the 15MB worth of plugin download.

No.

There are ways to do that with a stand-alone
application, but they will not work for an applet.

An applet must have a suitable JRE available
in the browser.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top