https://bz.apache.org/bugzilla/show_bug.cgi?id=62579
Bug ID: 62579
Summary: After update to Apache 9.0.10 gets a double error
Product: Tomcat 9
Version: 9.0.10
Hardware: Other
OS: Linux
Status: NEW
Severity: critical
Priority: P2
Component: Catalina
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: -----
Created attachment 36056
--> https://bz.apache.org/bugzilla/attachment.cgi?id=36056&action=edit
Logs and apache tomcat configuration files.
Fist of all we decided to update the Apache version from Apache Tomcat 7.0.62
to Apache Tomcat 9.0.10. This project is a web application based on AngularJS +
Apache Tomcat + Java + Spring Framework + MySQL
We had never seen an error like this. The most approximation we found in Google
about this is: https://github.com/jenkinsci/stashnotifier-plugin/issues/84
Where the solution is update the httpcore jar, that we did it and not work for
us.
Note: full error trace at the end.
Our application works fine except at this point, where we get two errors, the
first error is:
Handler dispatch failed; nested exception is java.lang.NoSuchMethodError:
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.setValidateAfterInactivity(I)V
After this if you refresh the page in the browser you get this second error:
Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError:
Could not initialize class org.apache.http.client.fluent.Executor
You can see this at this URL in our application:
https://registro.servidorddg.com/api/services/events/62/online-payment?temporalDataId=20008&amount=5.0&paymentGatewayId=19&lang=es
Remember that this not happen in Apache Tomcat 7.0.62.
Basically, this section of the code of our application differs of the rest
because here we do a POST call to a external service (URL) from the BACK-END.
Java>
JSONObject json = postToApi( formAction, parameters );
/**
* initiates HTTP POST toward the API (via {@link HttpClient})
(outgoing request)
*
* @param url
* @param paramMap
* @return the response as a parsed JSONObject
*
* @throws PostToApiException
*/
public static JSONObject postToApi(final String url, final Map<String,
String> paramMap) throws PostToApiException {
final List<NameValuePair> paramList;
final String apiResponseStr;
try {
Utilities.log( "postToApi paramMap ---" );
for (Entry<String, String> entry : paramMap.entrySet())
{
Utilities.log(entry.getKey() + "=" + entry.getValue());
}
Utilities.log( paramMap.toString() );
Utilities.logObject( paramMap );
paramList = getForm(paramMap).build();
} catch (Exception e) {
throw new PostToApiException("cannot build bodyForm for
the HTTP request", e);
}
try {
Utilities.log( "Before apiResponse");
/*HttpResponse apiResponse =
Request.Post(url).bodyForm(paramList).execute().returnResponse();*/
Request request = Request.Post(url);
Request request2 = request.bodyForm(paramList);
Response response = request2.execute();
HttpResponse apiResponse = response.returnResponse();
Utilities.log( "After apiResponse");
Utilities.log( "Before apiResponseStr");
apiResponseStr = new
BasicResponseHandler().handleResponse(apiResponse);
Utilities.log( "After apiResponseStr" + apiResponseStr
);
} catch (Exception e) {
throw new PostToApiException("HTTP POST error", e);
}
try {
return new JSONObject(apiResponseStr);
} catch (Exception e) {
throw new PostToApiException("failed to parse API call
response (not JSON?)", e);
}
}
Remember, our application only fails with Apache Tomcat 9.0.10
Another important thing: Normally when there's an exception in the application,
it is logged in the logs of TOMCAT (catalina.out), but these two doesn't appear
there (you can see the logs attached).
----------------------------------------------------------------------------
Full errors trace:
Estado HTTP 500 – Internal Server Error
Tipo Informe de Excepción
mensaje Handler dispatch failed; nested exception is
java.lang.NoSuchMethodError:
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.setValidateAfterInactivity(I)V
descripción El servidor encontró un error interno que hizo que no pudiera
rellenar este requerimiento.
excepción
org.springframework.web.util.NestedServletException: Handler dispatch failed;
nested exception is java.lang.NoSuchMethodError:
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.setValidateAfterInactivity(I)V
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:982)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
causa raíz
java.lang.NoSuchMethodError:
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.setValidateAfterInactivity(I)V
org.apache.http.client.fluent.Executor.<clinit>(Executor.java:99)
org.apache.http.client.fluent.Request.execute(Request.java:177)
com.desafioguerreros.infrastructure.payments.universalpay.UniversalPayPaymentsServices.postToApi(UniversalPayPaymentsServices.java:160)
com.desafioguerreros.infrastructure.payments.universalpay.UniversalPayPaymentsServices.buildPaymentForm(UniversalPayPaymentsServices.java:242)
com.desafioguerreros.events.core.EventRestFacade.onlinePaymentForm(EventRestFacade.java:1405)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
nota La traza completa de la causa de este error se encuentra en los archivos
de diario del servidor.
Apache Tomcat/9.0.10
Estado HTTP 500 – Internal Server Error
Tipo Informe de Excepción
mensaje Handler dispatch failed; nested exception is
java.lang.NoClassDefFoundError: Could not initialize class
org.apache.http.client.fluent.Executor
descripción El servidor encontró un error interno que hizo que no pudiera
rellenar este requerimiento.
excepción
org.springframework.web.util.NestedServletException: Handler dispatch failed;
nested exception is java.lang.NoClassDefFoundError: Could not initialize class
org.apache.http.client.fluent.Executor
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:982)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
causa raíz
java.lang.NoClassDefFoundError: Could not initialize class
org.apache.http.client.fluent.Executor
org.apache.http.client.fluent.Request.execute(Request.java:177)
com.desafioguerreros.infrastructure.payments.universalpay.UniversalPayPaymentsServices.postToApi(UniversalPayPaymentsServices.java:160)
com.desafioguerreros.infrastructure.payments.universalpay.UniversalPayPaymentsServices.buildPaymentForm(UniversalPayPaymentsServices.java:242)
com.desafioguerreros.events.core.EventRestFacade.onlinePaymentForm(EventRestFacade.java:1405)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
nota La traza completa de la causa de este error se encuentra en los archivos
de diario del servidor.
Apache Tomcat/9.0.10
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]