小编典典

尝试使用Netbeans将Web应用程序重新部署到Tomcat时出现AccessControlException

tomcat

尝试从Netbeans 6.8内在Tomcat上重新部署Web应用程序时,出现以下错误。这可能与保存和热交换功能上的新部署有关。任何想法如何解决这个问题?

INFO: Error registering wrapper with jmx StandardEngine[Catalina].StandardHost[localhost].StandardContext[/CubeAdSaSim2] Catalina:j2eeType=WebModule,name=//localhost/CubeAdSaSim2,J2EEApplication=none,J2EEServer=none java.security.AccessControlException: access denied (javax.management.MBeanTrustPermission register)
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.core.StandardContext.registerJMX(StandardContext.java:5281)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4482)
        at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1249)
        at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:377)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:196)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:619)

阅读 338

收藏
2020-06-16

共1个答案

小编典典

尝试编辑conf/catalina.policy以包括以下行:

grant {
   permission javax.management.MBeanTrustPermission "register";
};

然后添加到您CATALINA_OPTS的以下VM参数:

-Djava.security.policy=/path/to/your/catalina.policy

2020-06-16