aspose file tools*
The moose likes Applets and the fly likes Please help me in Applet RMI communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Please help me in Applet RMI communication " Watch "Please help me in Applet RMI communication " New topic
Author

Please help me in Applet RMI communication

Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 157
Hello everybody,
Well we are developing a financial project in which I have made an applet which is calling a remote method i.e Applet RMI communication has been done , well it is working well and when I made this applet.jar file signed it is working even if i mad no changes in java.ploicy file , I couldnt undertsnad how and why this applet is working when I have not given any rights in java policy file.
can you please help me in this confusion.
Thanks


jasmine kaur
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8910
    
    8

Signed applets are not restricted by the applet sandbox or the default policy file. Check out the Java Plug-In Applet Security Basics for more info.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 157
Thanks for responding well see case first when applet is calling a remote method it is not signed ,the applet RMI communication is working well and when I signed an applet and made changes in java policy file or not this signed applet shows certificates and runs well. Now thats why I get confused anbd could n't understand of the applet has been signed and policy file is not been changed then how this RMI applet communication is working .
Could u please tell me where Iam wrong .
Thansk a lot for responding.
jasmine
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8910
    
    8

Unsigned applets CAN make network connections (RMI uses sockets) back to the server which they were downloaded from. Is this the case?
Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 157
Hello thanks for responding i agreed with you whatever you have told me,well our application would run on 1000 of computers and our applet should be signed and it should work accordingly to the rights given in the policy file.Well I will show you the way I created the certificates and I followed all the steps mentioned in the java docs and I amde changes in java policy file which are following .

Fisrt step compiling my applet file
a)javac MySignedApplet.java


Second step making an jar file of applet
b)jar cvf SignedApplet.jar MySignedApplet.class

c) Generating keystores
keytool -genkey -alias MirekKey -validity 1825 -keystore MirekKeyStore.db

d)Export and Import the key
C:\jasbir\keytool -export -alias Mirekkey -keystore Mirekkeystore.db -file Mirek.cer





keystore "file:&(catalina.home)/webapps/fispro30/applet/Mirekkeystore.db ";

grant codeBase "file:$(catalina.home)/webapps/fispro30/applet/Mirekkeystore.db " ,SignedBy "jasskey"{

permission java.net.SocketPermission" "file:$(catalina.home)\\webapps\\fispro30\\Web-inf\\lib\\twweb.jar","localHost:1099","accept,connect,listen";
};


so this is the policy file where I agev rights to my signed applet.
So tell me where Iam wrong.


Thanks
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8910
    
    8

Originally posted by Jasmine kaur:

permission java.net.SocketPermission" "file:$(catalina.home)\\webapps\\fispro30\\Web-inf\\lib\\twweb.jar","localHost:1099","accept,connect,listen";
};


Wait a minute. Are you changing the policy file on the server and expecting the applet running on the client to obey that policy? It doesn't work that way. The policy file has to be changed on the client or downloaded from the server.
[ June 02, 2004: Message edited by: Joe Ess ]
Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 157
Hello,
Thanks for responding , well I agreed what ever you have mentioned , as we have to make a changes at client side policy file but at server itself there is a confusion that is when I have made a signed jar applet and when I modified policy file it is working in tomcat but when signed jar file is deleted and new applet jar file is made which is unsigned is also working .
So what is this?
Iam confused here as I have undertsood and followed the steps from docs and is Iam wrong somewhere.
Tell me the application where we have used this applet will run on 1000 computers and it is necessary or not to make a signed applet please tell me where Applet and RMI communication is there in this applet.
Iam confused alittle bit.
Thanks for helping me.
please help me tos ort this confusion also.
Thanks
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8910
    
    8

Originally posted by Jasmine kaur:
when signed jar file is deleted and new applet jar file is made which is unsigned is also working

As I've said before, unsigned applets can connect back to the server from which they were downloaded, so this is not surprizing.

Tell me the application where we have used this applet will run on 1000 computers and it is necessary or not to make a signed applet please tell me where Applet and RMI communication is there in this applet.

I really can't tell you any of these things. The limitation to the number of clients running your applet depends on how much data your server can pump out. I don't know what your applet does, so I can't say if it needs to be signed or if there is RMI in it.
Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 157
thanks,
well i will try once more and lets see what will happen.
thanks for helping me.
jasmine
Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 157
Hello Everybody,
My same problem is with Oracle application server ,well Applet(Signed applet) -RMI communication is working perfectly without maiking changes in java policy file ,well tell me what shoudl I do?
iam confused
Thanks
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8910
    
    8

As I said before:

Signed applets are not restricted by the applet sandbox or the default policy file

therefore RMI will work fine between a signed applet and any server. What part of that is confusing?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please help me in Applet RMI communication