I extend the ProxyServlet
public class QProxyServlet extends ProxyServlet {
@Override
public void init() throws ServletException {
super.init();
}
@Override
protected void initTarget() {
}
@Override
protected HttpResponse doExecute(HttpServletRequest servletRequest, HttpServletResponse servletResponse, HttpRequest proxyRequest) throws IOException {
return super.doExecute(servletRequest, servletResponse, proxyRequest);
}
@Override
protected String getConfigParam(String key) {
return null;
}
public static String getHostAttrName() {
return ATTR_TARGET_HOST;
}
@Override
public HttpHost getTargetHost(HttpServletRequest request) {
return super.getTargetHost(request);
}
@Override
public String getTargetUri(HttpServletRequest request) {
return request.getServletPath();
}
}
When I initiate a request, the following exception occurs:
java.lang.NullPointerException: null
at org.mitre.dsmiley.httpproxy.ProxyServlet.getCookieNamePrefix(ProxyServlet.java:655)
at org.mitre.dsmiley.httpproxy.ProxyServlet.getProxyCookieName(ProxyServlet.java:611)
at org.mitre.dsmiley.httpproxy.ProxyServlet.createProxyCookie(ProxyServlet.java:591)
at org.mitre.dsmiley.httpproxy.ProxyServlet.copyProxyCookie(ProxyServlet.java:578)
at org.mitre.dsmiley.httpproxy.ProxyServlet.copyResponseHeader(ProxyServlet.java:562)
at org.mitre.dsmiley.httpproxy.ProxyServlet.copyResponseHeaders(ProxyServlet.java:547)
at org.mitre.dsmiley.httpproxy.ProxyServlet.service(ProxyServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
Following up on this exception, I found that sevletConfig is empty, but my service has been running on the Linux server for a while. Today, a request suddenly caused this exception, and other requests were normal.
I extend the ProxyServlet
When I initiate a request, the following exception occurs:
Following up on this exception, I found that sevletConfig is empty, but my service has been running on the Linux server for a while. Today, a request suddenly caused this exception, and other requests were normal.