我正在使用 Java 中的 Google App Engine (1.8.7) 进行开发。我的 web.xml 文件中有以下过滤器...
<filter>
<filter-name>MultiReadRequestFilter</filter-name>
<filter-class>com.fitc.general.MultiReadRequestFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>MultiReadRequestFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
For info 过滤器包装 For info 文件允许通过缓存请求多次读取 HttpRequest :
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
/* wrap the request in order to read the inputstream multiple times
MultiReadHttpServletRequest multiReadRequest = new MultiReadHttpServletRequest((HttpServletRequest) request);
chain.doFilter(multiReadRequest, response);
}
反正。一切都在我的localhost
开发服务器上正常运行,但是当我部署到 GAE 时出现问题。我在 GAE 日志中收到以下错误:
Error for /_ah/spi/BackendService.getApiConfigs java.lang.NoClassDefFoundError:
Could not initialize class com.fitc.general.MultiReadHttpServletRequest at
com.fitc.general.MultiReadRequestFilter.doFilter(MultiReadRequestFilter.java:23)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at
com.googlecode.objectify.cache.AsyncCacheFilter.doFilter(AsyncCacheFilter.java:59)
(...as so on!)
有谁知道可能会发生什么导致这种情况?我还有其他几个过滤器,它们在部署时运行良好。我想知道是否可能是这些使用过的罐子,所以我制作了我的MultiReadHttpServletRequest
班级的罐子并将其粘贴在构建路径和lib/
目录上......不走运。