Results 1 to 5 of 5

Thread: security.AccessControlException: access denied (java.lang.RuntimePermission getClassL

  1. #1
    Join Date
    Nov 2007
    Posts
    7

    Default security.AccessControlException: access denied (java.lang.RuntimePermission getClassL

    Hi,

    I am using Sun App Server 8.2

    When i try to add spring.jar file in server class path and deploy my application I am getting the following error in my server log file

    Code:
    Exception sending context initialized event to listener instance of class utils.ApplicationInitializer
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'UsageIfaceDAO' defined in ServletContext resource [/WEB-INF/classes/spring-for-ibatis.xml]: Instantiation of bean failed; nested exception is java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
    Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
    	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
    	at java.security.AccessController.checkPermission(AccessController.java:427)
    	at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    	at java.lang.ClassLoader.getParent(ClassLoader.java:1224)
    	at org.springframework.beans.CachedIntrospectionResults.isCacheSafe(CachedIntrospectionResults.java:191)
    	at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:138)
    	at org.springframework.beans.BeanWrapperImpl.setIntrospectionClass(BeanWrapperImpl.java:239)
    	at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:197)
    	at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:180)
    	at org.springframework.beans.BeanWrapperImpl.<init>(BeanWrapperImpl.java:133)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:702)
    could someone please guide me as to how I can add spring.jar to my server's classpath?

    When i take out spring.jar from the classpath then I can deploy the application w/out any problems.

  2. #2
    Join Date
    Nov 2007
    Posts
    7

    Default

    nevermind..needed the following in servers server.policy

    grant codeBase "file:C:\\<your-file-name>" {
    permission java.security.AllPermission;
    };

  3. #3
    Join Date
    Nov 2005
    Posts
    3

    Default

    Hi,

    What should be placed for <your-file-name>? Can someone give an example? I am very new to the permission settings for sun server, so appreciate any help. Thanks.

  4. #4
    Join Date
    May 2012
    Posts
    3

    Default

    When I change the permissions on the tomcat server and restart it, it resets the Catalina.policy to remove this permission code that i added. How can i make the change permanent?

  5. #5
    Join Date
    May 2012
    Posts
    3

    Default

    I found out the problem. I had to change the policy in /etc/tomcat6/policy.d/04webapps.policy, where as I was changing it in the /work directory catalina.policy file which get recreated from the this webapps.policy file every time i restart the tomcat server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •