尝试使用Netbeans将webapp重新部署到Tomcat时出现AccessControlException

时间:2010-03-10 12:30:41

标签: tomcat netbeans tomcat6 netbeans6.8 accesscontrolexception

我在Netbeans 6.8中尝试在Tomcat上重新部署webapp时遇到以下错误。它可能与保存和热交换功能的新部署有关。有任何想法如何解决这个问题?

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)

1 个答案:

答案 0 :(得分:4)

尝试修改conf/catalina.policy以包含此行:

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

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

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