I m trying to do the following (running in Jetty 8):
public class FooListener implements ServletContextListener {
public void contextInitialized(ServletContextEvent event) {
event.getServletContext().getClassLoader();
}
}
这是我忘记的:
java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at org.eclipse.jetty.server.handler.ContextHandler$Context.getClassLoader(ContextHandler.java:2179)
at com.example.FooListener.contextInitialized(FooListener.java:69)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:672)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:403)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:664)
What is it about and how can be solved?