异常 java.security.AccessControlException: access denied (javax.management.MBeanTrustPermission regist

在servlet中注册jms监听器,tomcat启动异常

  java.security.AccessControlException: access denied (javax.management.MBeanTrustPermission register)
 at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
 at java.lang.SecurityManager.checkPermission(SecurityManager.java:568)
 at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1824)
 at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:310)
 at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
 at org.apache.tomcat.util.modeler.Registry.registerComponent(Registry.java:805)
 at org.apache.catalina.connector.Connector.start(Connector.java:1152)
 at org.apache.catalina.core.StandardService.start(StandardService.java:531)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

 

解决方式:

在tomcat所用的jre/lib/security/java.policy文件中新增

permission javax.management.MBeanTrustPermission "register";

 

你可能感兴趣的:(异常)