Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI problem when using Tomcat

 
Andreas Bystrom
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Regards,
// Andreas
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Bill
 
Alex Sharkoff
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic