Announcement Announcement Module
Collapse
No announcement yet.
security.AccessControlException: access denied (java.lang.RuntimePermission getClassL Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    nevermind..needed the following in servers server.policy

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

    Comment


    • #3
      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.

      Comment


      • #4
        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?

        Comment


        • #5
          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.

          Comment

          Working...
          X