wood burning stoves
The moose likes Servlets and the fly likes RMI problem when using Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "RMI problem when using Tomcat" Watch "RMI problem when using Tomcat" New topic

RMI problem when using Tomcat

Andreas Bystrom
Ranch Hand

Joined: Mar 05, 2003
Posts: 32
Hi all!

I have a pice of java code that works fine when I'm just using it standalone. This application uses a RMI connection to another computer.

The problem comes when I add this code into a servlet and run it with tomcat (5.0.25). Now I get this exception when I try to send data to the remote computer.

java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: access denied to class loader
Caused by: java.lang.ClassNotFoundException: access denied to class loader
Caused by: java.security.AccessControlException: access denied (java.io.FilePermission /C:/java/jaka
rta-tomcat-5.0.25/webapps/energis/WEB-INF/classes/- read)

Anyone have an idea of what I done wrong?

// Andreas
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
I don't know if this is related but I had security policy problems when trying to get a servlet to talk to a JavaSpace with Tomcat 5.0.19 - backed up to Tomcat 4.1.30 and it worked.
Alex Sharkoff
Ranch Hand

Joined: Apr 11, 2004
Posts: 209
Hi Andreas,

William already mentioned that it has to do with the security policy your application uses. It looks like your web app has restricted permissions (eg, cannot access certain files)

Security policy is defined in the .policy files and can be passed as a parameter to the JVM at the start-up time (this is applicable to the standalone applications).

The default security policy used in the Tomcat is defined in the catalina.policy file that you will find in <tomcat_home>\conf folder. I suggest that you look into this file as it explains how to define security policy for a particular web application.

Hope it helps.

Alex (SCJP 1.4, SCBCD 1.3, SCWCD 1.4, SCJD 1.4)
I agree. Here's the link: http://aspose.com/file-tools
subject: RMI problem when using Tomcat
jQuery in Action, 3rd edition