RMI question - VMID

Discussion in 'Java' started by Andrew Thompson, Jun 8, 2004.

  1. On Wed, 9 Jun 2004 00:02:20 +0800, Horace wrote:
    ....
    > 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
    Andrew Thompson, Jun 8, 2004
    #1
    1. Advertising

  2. Andrew Thompson

    Horace Guest

    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
    Horace, Jun 8, 2004
    #2
    1. Advertising

  3. Andrew Thompson

    Guest 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" <> wrote in message
    news:g79uvua8h72z$...
    > On Wed, 9 Jun 2004 00:02:20 +0800, Horace wrote:
    > ...
    > > 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
    Guest, Jun 9, 2004
    #3
  4. On Wed, 9 Jun 2004 09:54:55 +0800, <> wrote:

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

    Because...

    > "Andrew Thompson" <> wrote in message
    >> On Wed, 9 Jun 2004 00:02:20 +0800, Horace wrote:
    >> ...
    >>> 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
    Andrew Thompson, Jun 9, 2004
    #4
  5. Andrew Thompson

    Horace Guest

    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" <> wrote in message
    news:wyhob8ajejgw$...
    > On Wed, 9 Jun 2004 09:54:55 +0800, <> wrote:
    >
    > Please do not top-post..
    > <http://www.physci.org/codes/javafaq.jsp#netiquette>
    >
    > Because...
    >
    > > "Andrew Thompson" <> wrote in message
    > >> On Wed, 9 Jun 2004 00:02:20 +0800, Horace wrote:
    > >> ...
    > >>> 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
    Horace, Jun 9, 2004
    #5
  6. On Wed, 9 Jun 2004 23:14:02 +0800, Horace wrote:

    > 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..
    <http://www.physci.org/codes/java/plugin.jsp>

    >..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)

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
    Andrew Thompson, Jun 9, 2004
    #6
  7. On Wed, 09 Jun 2004 16:29:14 GMT, Andrew Thompson wrote:
    ....
    > (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
    Andrew Thompson, Jun 9, 2004
    #7
  8. Andrew Thompson

    Horace Guest

    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" <> wrote in message
    news:3bku3jt3i3rq.1wohjtz2qbump$...
    > On Wed, 09 Jun 2004 16:29:14 GMT, Andrew Thompson wrote:
    > ...
    > > (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
    Horace, Jun 10, 2004
    #8
  9. On Thu, 10 Jun 2004 10:30:15 +0800, Horace wrote:

    > 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.

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
    Andrew Thompson, Jun 10, 2004
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joshua Long

    RMI question

    Joshua Long, Oct 29, 2003, in forum: Java
    Replies:
    0
    Views:
    457
    Joshua Long
    Oct 29, 2003
  2. coder_1024

    RMI connection question

    coder_1024, Nov 30, 2003, in forum: Java
    Replies:
    2
    Views:
    2,024
  3. Buu Nguyen

    RMI, JINI or RMI/IIOP

    Buu Nguyen, Aug 25, 2004, in forum: Java
    Replies:
    1
    Views:
    553
    Sudsy
    Aug 25, 2004
  4. JScoobyCed

    RMI Vs RMI over IIOP

    JScoobyCed, Jan 28, 2005, in forum: Java
    Replies:
    1
    Views:
    726
    Dag Sunde
    Jan 28, 2005
  5. Jan Schulze
    Replies:
    1
    Views:
    563
    Esmond Pitt
    Mar 26, 2005
Loading...

Share This Page