aspose file tools*
The moose likes Tomcat and the fly likes Help : using RMI with Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Help : using RMI with Tomcat" Watch "Help : using RMI with Tomcat" New topic
Author

Help : using RMI with Tomcat

Sachin Joshi
Ranch Hand

Joined: Mar 23, 2004
Posts: 43
Hi
I am using Tomact 4.1.29. My application needs to connect remote machines on which RMI server is running.
I am getting AccessControlException while connecting to remote machine.
Can some guide me what changes I need to do in catalina.policy file and/or any other file ?
Thanks,
Sachin
Sachin Joshi
Ranch Hand

Joined: Mar 23, 2004
Posts: 43
Originally posted by Sachya Joshi:
Hi
I am using Tomact 4.1.29. My application needs to connect remote machines on which RMI server is running.
I am getting AccessControlException while connecting to remote machine.
Can some guide me what changes I need to do in catalina.policy file and/or any other file ?
Thanks,
Sachin


Hi,
I got my problem solved.
No reply from group this time, anyways...
sachin
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12683
    
    5
Now you really ought to tell us how you solved the problem so that if somebody else has a similar problem they can find the answer in the archives.
Bill
Sachin Joshi
Ranch Hand

Joined: Mar 23, 2004
Posts: 43
Originally posted by William Brogden:
Now you really ought to tell us how you solved the problem so that if somebody else has a similar problem they can find the answer in the archives.
Bill

Hello Bill,
I need to update my catalina.policy file for this and also need to run the tomcat with "-security" option. Now when you run the tomcat with security option, then even you need to specify permissions for your DbDriver classes. Following are the changes -->
Changes Required :
a. add "-security" option to the start tomcat command in "startup.bat" file. Like this,
"call "%EXECUTABLE%" start -security %CMD_LINE_ARGS%"

b.Update "conf/catalina.policy" file for the permissions you want to give for certain classes in contexts. Like this,
b1 >
grant codeBase "file:${catalina.home}/webapps/RmiRprt/WEB-INF/classes/-" {
permission java.security.AllPermission "", "";
};

b2> Also, in this case you have to add CONNECT permission for your Db Server Drivers classes. Like this,
grant codeBase "file:C:/Sachin/OtherJars/classes12.zip" {
permission java.net.SocketPermission "133.197.189.93:1521", "connect";
};

c. Also, modify "catalina.bat" file. Set CATALINA_OPTS variablefor security related logs. Like this,

set CATALINA_OPTS=%CATALINA_OPTS% -Djava.security.debug=access,failure

By the way, My tomcat version is 4.1.29.
I hope this would help anybody with same problem.
Thanks,
Sachin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help : using RMI with Tomcat
 
Similar Threads
BETA Properties file
Servlet as an rmi client
FilePermissionException on UNIX
RMI : rmi and t3 protocol HELP.....
RMI file service