Applets & RMI - How Straightforward

I recently developed an application to run over the corporate Intranet using an Applet on the the client side and Servlets on the server to do the database querying. Everything works fine but I cannot deploy the solution as the server runs IIS and I canot get the administrator to set up a servlet container.
Thus, I thought I would switch to using RMI on the server. I'm new to RMI and have been trying to get the basic communication between the Applet and a remote object working in order to test the feasability of this solution. I can run it okay on the local machine with both Applet Viewer and IE5.0, however, when I try to run the Applet from another machine I get the following error.
java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
The Applet is trying to connect to the same machine from which it was downloaded and thus, I believe, there should not be any need to mess around with the policy files as seems to be suggested by mnay replies to other posts relating to this error.
I am confused by the fact that the exception indicates the client loopback address - 127.0.0.1:1099 - which suggests to me that the problem possibly lies elsewhere???
A println of the String ipadd below indicates the correct host - 13.22.2.41/QueryServer
String ipadd = getCodeBase().getHost() + "/QueryServer";
try
DatabaseQuery dq = (DatabaseQuery)Naming.lookup(ipadd);
Vector v = dq.performDatabaseQuery("SOME_QUERY");
}In the main() of my remote object I Have:
try
RemoteQuery rq = new RemoteQuery();
String serverObjectName = "//13.22.2.41/QueryServer";
Naming.rebind(serverObjectName, rq);
System.out.println("Server Running.....");
}After compiling the classes. I do start rmiregistry followed by rmic RemoteQuery followed by java RemoteQuery . As stated above, everything works perfectly on the local machine.
Any ideas anyone.
No dukes awarded for suggestions involving policy files!!

Given that the loopback address is quoted in the Exception Message, it seems to me that possibly my Applet is "missing something" and the applet's lookup attempt is defaulting to the client (hence the exception as the Applet cannot of course access the local system) rather than the server.

Similar Messages

  • Using plain Java Sockets(not RMI) how..?

    hi!
    1. Using plain Java Sockets(not RMI) how can the client detect when its server
    goes down?
    There is a long time interval between client requests and the client wants
    to retain a live connection rather than disconnect after every reqest.
    Please also cc your reply to [email protected]
    Thanks,
    \Raghu

    If you try to send data when the host is gone, it throws an exception. I don'thow to check if it is alive though. I'm having the same problem right now.

  • Applet question, how to download resource files from server

    hi,
    i am new at applet world.
    i have an applet that reads some resource, data and configuration files. so i need to download these files from server to client. i did some resarch and could not find how to download files from server in an applet application.
    how can i do this task?
    thank you for your answers.

    You may want to distinguish between 'resources' and data/configuration files.
    'Resources' are non-class files that are part of your application, i.e without them the application would simply not work, just like class files.
    Those are typically images, sounds or resource bundles (GUI elements translated to different languages) that nobody except you, the developer, would touch (when releasing an upgrade or a patch).
    Those should just go into the applet jar or additional jars named in the applet tag.
    Data/configuration files, that may be changed by others than the developers, should be made available through HTTP, just like the applet jar itself. The applet will have (read) access to them using java.net.URLConnection.

  • Running an ActiveX component wrapped as a Java Applet. How to do it?

    I have a legacy ActiveX/ocx plugin that the client wants to be run as a Java Applet. They think that will make things J2EE compliant.
    How would you wrap that? are there libraries to help?
    Thanks in advance

    thanks for trying to help since I wasn't able to find the appropriate category given the new change (discussions.apple.com/thread/6421739)

  • How to use DOMParser from an Applet / Or, how to parse XML from an Applet?

    Hey,
    As stating in the subject line, I wonder how to do it without getting an �Access Denied� error.
    I would like to parse a XML file that has external DTD pointing to a SYSTEM location. Yes, I can change it to a public location. However, in either way, I have problems to use DOMBuilder to parse the xml file. The application always throws the security exception.
    I tried to use the DOMParser from org.apache.xerces.parsers to parse the xml file. I set the DOMParser to ignore parsing the external DTD, and use the DOMParser.parse(InputSource) to parse the xml file from a giving URL. However, I get null of the result document.
    Does anyone know how to parse the XML from an Applet? Or, does anyone know how to use the DOMParser from an Applet?
    Thank you very much,

    If the document resides on the local filesystem, you will need to sign a CAB or JAR for the applet to circumvent the sandbox's security restrictions. There are dozens of posts on how to do this. Basically, that will turn the applet into an application, from a Java security perspective.
    - Saish
    "My karma ran over your dogma." - Anon

  • I have a question about weblogic RMI , how can I resolve it.Thank you

    I have a question about the weblogic RMI .
    I have a program.web services+weblogic RMI +Data Sources When I run the program in the console application.it is ok.But When i run it with the web services(it 'is mean Get some parameter and run the different program).it's fail.The Exception is
    cannot assign instance of yype weblogic.rmi.RMIServices_1033_WLStub to field demo.RMIServer_1033_WLStub.stubinfo of type weblogic.rmi.internal.StubInfo in instance of demo.RMIEsrver_1033_WLStub
    how to resolve .Thank you.

    Hi Charles,
    Parental Controls has always had problems with https sites, no idea if it's fixed in 10.9.x or not.
    When you setup your Mac it shouldv'e made an admin account, are you not running from that account, or did you somehow change it to a Managed account???

  • 10g - Gaps at top and side of applet. How can I remove?

    Hi
    When running 10g webforms I have noticed that there are gaps at the top of and the side of the forms applet. This is causing our converted forms not to fit in the browser window without scrollbars (the presence of which further reduces the amount of the form visible :) )
    Rather than resize all our forms I need to get rid of the gaps. Anybody know how?
    thanks
    paul schweiger
    I have a small image illustrating my point - anybody know how to upload images?

    Vielen Dank Volker,
    That sounds like a handy tip! We're getting our feet wet with 10g writing new apps, for the time being, so these conversion headaches haven't yet entered the picture, for us. We have, however, several 6i apps to migrate, so I'm trying to learn as much as possible, from others on the forum.
    I would like to recommend that people take a look at JDAPI, which is the Java counterpart to the C-based Forms API. Using it, one can automate Forms manipulations that they would ordinarily carry out manually using Forms Builder. It looks quite possible to do some very neat stuff, like scaling the size of one's forms programmatically.
    One thing that interests me most is that JDAPI is not a "blind" tool -- one can inspect each form's properties programmatically, and perform only those operations that appear necessary. Of course, there are no Artificial Intelligence routines provided -- Genuine Intelligence is required, and the developer must provide this!
    Anyway, I just wanted to mention JDAPI, for the benefit of anyone who might not be familiar with it. I would like to add, as an intermediate Java programmer, that one need not be a Java expert to have success with JDAPI. As always, there is a learning curve, but I found it fairly straight-forward. I, and others, have posted a few simple JDAPI examples to the forum, so anyone interested can have a look at these, to get a sense of what JDAPI code looks like.
    Eric Adamson
    Lansing, Michigan

  • RMI - How to detect the cease of client program

    Hi guys,
    Under RMI, the client program can easily detect the death of the server. Does anybody knows how the server detect the death of the client?
    The situation is like this. The client program makes a remote call to the implementation. Before the implementation returns the result, the client is dead. How would the server know that this particular client is dead? There may be multiple clients for the server.
    Regards,
    Jonathan Li

    the server can't know that the client is dead. If it get's a method call, it handles it and then continues waiting.
    In my case a sort of heartbeat on the client and detection on the server were sufficient to determine whether the client's still running - you keep a timer and if the client has not accessed after a certain interval, it is considered dead. The client runs a similar timer that sets off a simple heartbeat call with a certain frequency to tell that it's alive, even if no request went to the server in the meantime. - In your case the heartbeat will have to contain an ID for the client and the server will have to keep a list of clients to listen for...
    HTH

  • Applet RMI Error

    I have a very simplet Applet that is getting an error in the Init method:
    public void init() {
         print("Starting Init Method");
         print("Server Hostname = " + hostname);
         try {
              String objectName = "//" + hostname + "/EMSL Test RMI Server";
              print("Looking up RMI Object : " + objectName);
              Object object = Naming.lookup(objectName);
              print("Result = " + object);
              ServerInterface server = (ServerInterface)object;
              print("Using Remote Object to get Remote Object Hostname");
              print("... " + server.getHostname());
         }catch(Throwable e) {
              print("");
              print("Error :");
              print(e.toString());
              print("");
              print("Stack Trace :");
              StringWriter stringWriter = new StringWriter();
              PrintWriter printWriter = new PrintWriter(stringWriter);
              e.printStackTrace(printWriter);
              print(stringWriter.toString());
    Error:
    java.lang.ExceptionInInitializerError
    Stack Trace:
    java.lang.ExceptionInInitializerError
    at java.rmi.Naming.getRegistry(bytecode 12)
    at java.rmi.Naming.lookup(bytecode 6)
    at AppletClient.init(bytecode 41)
    at com.insignia.applet.AppletPanel.run(bytecode 167)
    at java.lang.Thread.run (bytecode 11)
    Any thoughts? This works as an appliction under WinCE using insignia EVM, but not as an applet.
    Regards,
    Bill

    Error:
    java.lang.ExceptionInInitializerError
    Stack Trace:
    java.lang.ExceptionInInitializerError
    at java.rmi.Naming.getRegistry(bytecode 12)
    at java.rmi.Naming.lookup(bytecode 6)
    at AppletClient.init(bytecode 41)
    at com.insignia.applet.AppletPanel.run(bytecode
    ode 167)
    at java.lang.Thread.run (bytecode 11)
    Any thoughts? This works as an appliction under WinCE
    using insignia EVM, but not as an applet.Looks like it cant find the registry.
    Make sure that the registry deamon is started and accessible from within your applet.
    Verify that host and port are correct and that the applet is running in an environment where the registry deamon can be reached, eg inside the same subnet.
    This advice sounds like a simple truth, but it is always the simple things stopping software from working.
    Oliver

  • Debug an Applet ? How ?

    I probably cant see the wood for the trees, but no mater how hard I try, I cannot debug an applet class. Whenever I right-click and run I get
    init:
    deps-jar:
    compile-single:
    run-applet:
    Warning: <param name=... value=...> tag requires name attribute.
    Warning: <param name=... value=...> tag requires name attribute.
    Warning: <param name=... value=...> tag requires name attribute.
    Warning: <param name=... value=...> tag requires name attribute.
    BUILD SUCCESSFUL (total time: 0 seconds)
    I have followed the help guide and have the html file in the src directory. I can run the html file ok in a normal browser. but for the life of me I cannot see where or how to either attach the debugger to the applet process, or even run it and hit a breakpoint.
    I canot run it like a normal application as there is no "Main Class" and trying to set that up is a nightmare in itself. I have only just started using the IDE and although it has similarities with .NET (hope thats not a bad word here) it does seem to be a lot more complex when youre trying to recall everything you forgot from years ago.
    Can anyone explain is an easy straight foward basic language what I need to do ? I find the help files assume that one already has a vast amount of background. The learning curve for me is very steep at the moment.
    Thanks for your time and help.
    Kess

    Quote:
    Copy the MyApplet.html launcher file from the build folder to the package where the applet class lives in the src folder (in this case, to org.me.hello). Make sure that the MyApplet.html launcher file has the same name as the applet class.
    Note that later it says....
    Note that applets run in the virtual machine of the IDE's default web browser. The IDE uses a different virtual machine and therefore applets are not included in a web application's debug session. Debug the applet within the Java project, as explained above.
    So, if you create the htm file and add in some parameters, it becomes a web application and the caveat is that no breakpoints can be set and you cant step into the code.
    Which is the problem I am having.
    Of course none of the examples or help pages only ever give the most simplest of the "Hello Word" examples, and it would appear that doing something a little more complex is beyond the help articles.......
    I am still stuck, and would much prefer someone to state excatly how to debug an applet.....
    I cant believe this beyond some of the experts here.
    Thanks for your comments so far.

  • Resize Applet Window - How?

    I know how to set a specific size by numbe for an applet window,
    but I would like to know if there is a way of telling the applet window to open in full view mode - like instead of saying open (650, 650) in a separate window, I would like it to take up the entire screen to the exact size of the screen in the internet explorer browser.

    Hi,
    This forum is for discussions related to Sun Java Studio Creator. Please post your query in the appropriate forum. You can try posting your query at:
    http://forum.java.sun.com/forum.jspa?forumID=421
    Cheers
    Girish

  • Applet/rmi connections ...

    I am trying to use RMI callbacks tunnelled over http from an applet.
    Will this scale ?. Are there any benchmark numbers that weblogic can
    provide ?.
    When the applet registers itself with the RMI server, a connection is
    presumably created. Is this connection object kept in memory or is it
    recreated during usage ?. What are the configurable parameters available
    /rk
    [email protected]

    Is it possible, that the IE crashes or runs in a loop, if the server don't answers in a approbiate time to the RMI call?No. The client part of an RMI call is just a network write followed by a network read. No loops.
    I would suspect the Jacob/ActiveX part of it myself rather than anything you could do to IE via Java

  • Applet + rmi problem

    I am makinga cards game using rmi .
    When I start my applet , my paint method doesnt run on some clients. Sometimes it doesnt run on all.
    And what is bothering me is the asynchronous behaviour(if I am thinking right) is that when the applet starts
    I register it with the server and the server invokes a remote method on the client. Now which method runs first , the paint() or the remote method. What if both run simultaenoulsy ? is that a problem?
    Also the buttons I show o nthe applet(this is another remote method invoked fro mthe server) only appears after I resize the applet .
    Any ideas?
    thanks

    just use ctrl+a to mark the code and the ctrl+c to copy it. then focus on the textfield you want to paste into and hit ctrl+v...
    thats it ;)

  • Applets, RMI  & ClassCastException

    I'm developing my first RMI application and I'm getting a ClassCastException upon Naming.lookup(...) on the client:
    java.lang.ClassCastException: com.alcatel.applet.FileUploaderRemote_Stub
    at com.alcatel.applet.FileUploader$UploadThread.run(FileUploader.java:184)
    I'm pretty sure I've got my interfaces, etc. setup correctly and I'm not sure what the problem is. The client has a signed .jar which contains the same stub/skel as the server:
    jar tvf FileUploader.jar
    846 Tue Apr 16 09:01:10 PDT 2002 META-INF/MANIFEST.MF
    899 Tue Apr 16 09:01:14 PDT 2002 META-INF/mycompany.SF
    960 Tue Apr 16 09:01:14 PDT 2002 META-INF/mycompany.DSA
    0 Tue Apr 16 09:01:08 PDT 2002 META-INF/
    5012 Fri Apr 12 13:28:52 PDT 2002 com/mycompany/applet/FileUploader$$3.class
    3624 Tue Apr 16 09:01:14 PDT 2002 com/mycompany/applet/FileUploader$UploadThread.class
    5134 Tue Apr 16 09:01:14 PDT 2002 com/mycompany/applet/FileUploader.class
    1447 Tue Apr 16 09:01:14 PDT 2002 com/mycompany/applet/FileUploaderRemote.class
    340 Mon Apr 15 16:17:36 PDT 2002 com/mycompany/applet/FileUploaderRemoteInterface.class
    2216 Tue Apr 16 09:01:32 PDT 2002 com/mycompany/applet/FileUploaderRemote_Skel.class
    4126 Tue Apr 16 09:01:30 PDT 2002 com/mycompany/applet/FileUploaderRemote_Stub.class
    Here's my implementation... maybe something is wrong here.. Anyone got any ideas where I'm going wrong?
    FileUploaderRemoteInterface.java
    package com.mycompany.applet;
    import java.rmi.*;
    public interface FileUploaderRemoteInterface extends Remote {
    FileUploaderRemote.java:
    package com.mycompany.applet;
    import java.rmi.*;
    import java.rmi.server.*;
    public class FileUploaderRemote extends UnicastRemoteObject
                                          implements FileUploaderRemoteInterface {
      public static void main(String args[]) {
        try {
          FileUploaderRemote fur = new FileUploaderRemote();
          Naming.rebind("FileUploader", fur);
        catch(Exception e) {
          e.printStackTrace();
          System.exit(1);
    FileUploader.java:
    package com.mycompany.applet;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.io.*;
    import java.text.*;
    import java.rmi.*;
    public class FileUploader extends JApplet implements ActionListener {
      FileUploaderRemote remote =  null;
      try {
        remote = (FileUploaderRemote)Naming.lookup("rmi://myserver/FileUploader");
      catch(Exception e) {
        e.printStackTrace();

    You must cast your remote reference to the interface that the RMIServer implements.
    So remote should be FileUploaderRemoteInterface and the getting the reference should look like this:
      FileUploaderRemoteInterface remote =  null;
      try {   
        remote = (FileUploaderRemoteInterface)Naming.lookup("rmi://myserver/FileUploader");
      }  catch(Exception e) { 
         e.printStackTrace(); 
      ...That is because Naming.lookup(...) actually returns the stub object which is obviously not the server object itself. It just implements the remote interfaces that the server object does...
    Hope it helps,
    Sany

  • RMI :- how to know that rmi registry is running or not using java code

    hi
    I want to know that how to check wather rmi registry is running or not by program in java
    plz any one reply

    Simple method - try to connect to it and see if you get an exception.
    Since the registry can be running on a remote machine, the only simple way
    is to try connecting.
    If the registry is running on a local machine you can also use OS tools (like "ps" on unix) to check whether the process is running, or network tools (e.g. netstat) to check whether it's listening on its TCP/IP port.
    Genady

Maybe you are looking for

  • Report To Show SQL Used In A Report

    I am creating a set of quality reports using the apex views. I would like to create a report to check the sql used in classic reports, but can't seem to find the right view to use. If it was a interactive report I would use the SQL_QUERY column in th

  • Wls 6.0sp1, xerces 1.1

    I'm in the process of upgrading to weblogic 6.0sp1 from 5.1. My app uses xerces 1.1 for all xml parsing. My original configuration was jbuilder 4.0, weblogic 5.1, jdk1.2.2 and xerces 1.1. This configuration worked and all xml parsed fine. After upgra

  • Fpb_S_Scenario does not exist

    Hi, we running a EP 7.0 with ECC 6.0 on ESS (patch level 8) project. Currently we are facing an error in almost every travel management iviews.  Has anybody of you an idea ? thx for your help Hans Georg com.sap.dictionary.runtime.DdException: Type co

  • Disable desktop notifications for a site

    With the new update, Google Music now sends desktop notifications. Firefox asked me if I wanted to enable them, and I accepted, but now I find them very annoying. How can I turn them off? I searched in the options but I didn't find anything

  • How to bind component to template iterator/vo?

    Hi, I have a tree in my page template that needs to be accessible throughout the whole application. The application will have many hundreds of pages, so it would be quite annoying if we have to redefine iterator & vo's in each single page def. Is the