我正在尝试将 GAE-Shiro 和 Resteasy 组合在一起。所以我试着做一个快速端口。但是我收到此错误:
[ERROR] java.lang.RuntimeException: java.lang.InstantiationException: com.cilogi.shiro.guice.ServeModule
[ERROR] at org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener.getModules(GuiceResteasyBootstrapServletContextListener.java:83)
[ERROR] at org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener.contextInitialized(GuiceResteasyBootstrapServletContextListener.java:27)
[ERROR] at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
[ERROR] at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
[ERROR] at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
[ERROR] at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
[ERROR] at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
[ERROR] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
[ERROR] at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
[ERROR] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
[ERROR] at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
[ERROR] at org.mortbay.jetty.Server.doStart(Server.java:224)
[ERROR] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
[ERROR] at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:228)
[ERROR] at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:255)
[ERROR] at com.google.appengine.tools.development.AbstractServer.startup(AbstractServer.java:79)
[ERROR] at com.google.appengine.tools.development.DevAppServerImpl$Servers.startup(DevAppServerImpl.java:451)
[ERROR] at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:198)
[ERROR] at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:97)
[ERROR] at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
[ERROR] at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
[ERROR] at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
[ERROR] at com.google.gwt.dev.DevMode.main(DevMode.java:311)
[ERROR] Caused by: java.lang.InstantiationException: com.cilogi.shiro.guice.ServeModule
[ERROR] at java.lang.Class.newInstance0(Class.java:359)
[ERROR] at java.lang.Class.newInstance(Class.java:327)
[ERROR] at org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener.getModules(GuiceResteasyBootstrapServletContextListener.java:70)
[ERROR] ... 22 more
这是我当前的 web.xml 配置
<context-param>
<param-name>resteasy.guice.modules</param-name>
<!-- <param-value>org.jboss.errai.ui.demo.server.MyServletModule</param-value> -->
<param-value>com.cilogi.shiro.guice.ServeModule</param-value>
</context-param>
<listener>
<listener-class>
org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener
</listener-class>
</listener>
<context-param>
<param-name>resteasy.servlet.mapping.prefix</param-name>
<param-value>/</param-value>
</context-param>
<servlet>
<servlet-name>Resteasy</servlet-name>
<servlet-class>
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Resteasy</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>user-base-url</param-name>
<param-value>/user/admin</param-value>
</context-param>
<context-param>
<param-name>static-base-url</param-name>
<param-value></param-value>
</context-param>
<listener>
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
</listener>
<listener>
<listener-class>com.cilogi.shiro.guice.ServeContextListener</listener-class>
</listener>
<mime-mapping>
<extension>manifest</extension>
<mime-type>text/cache-manifest</mime-type>
</mime-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>