(axis-axis2-java-core) 01/02: AXIS2-6086 AxisServlet - processAxisFault - does not guard against NumberFormatException

2025-03-21 Thread robertlazarski
This is an automated email from the ASF dual-hosted git repository.

robertlazarski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git

commit e236604edd512f910fef4fc661d6d5312a82
Author: Robert Lazarski 
AuthorDate: Fri Mar 21 03:38:51 2025 -1000

AXIS2-6086 AxisServlet - processAxisFault - does not guard against 
NumberFormatException
---
 .../java/org/apache/axis2/transport/http/AxisServlet.java | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/modules/transport/http/src/main/java/org/apache/axis2/transport/http/AxisServlet.java
 
b/modules/transport/http/src/main/java/org/apache/axis2/transport/http/AxisServlet.java
index e73e4a..0f346efacf 100644
--- 
a/modules/transport/http/src/main/java/org/apache/axis2/transport/http/AxisServlet.java
+++ 
b/modules/transport/http/src/main/java/org/apache/axis2/transport/http/AxisServlet.java
@@ -417,11 +417,16 @@ public class AxisServlet extends HttpServlet {
 String status =
 (String) 
msgContext.getProperty(Constants.HTTP_RESPONSE_STATE);
 if (status == null) {
-log.error("processAxisFault() on error message: " + 
e.getMessage() + " , found a null HTTP status from the MessageContext instance, 
setting HttpServletResponse status to 
HttpServletResponse.SC_INTERNAL_SERVER_ERROR", e);
+log.info("processAxisFault() on error message: " + 
e.getMessage() + " , found a null HTTP status from the MessageContext instance, 
setting HttpServletResponse status to 
HttpServletResponse.SC_INTERNAL_SERVER_ERROR", e);
 
res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
 } else {
-log.error("processAxisFault() found an HTTP status from 
the MessageContext instance, setting HttpServletResponse status to: " + status);
-res.setStatus(Integer.parseInt(status));
+log.debug("processAxisFault() found an HTTP status from 
the MessageContext instance, setting HttpServletResponse status to: " + status);
+try {
+res.setStatus(Integer.parseInt(status));
+} catch (Exception ex) {
+log.error("Invalid http status, setting status to http 
error state: " + ex.getMessage(), ex);
+
res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+}
 return;
 }
 



(axis-axis2-java-core) 02/02: AXIS2-6086 AxisServlet - processAxisFault - does not guard against NumberFormatException

2025-03-21 Thread robertlazarski
This is an automated email from the ASF dual-hosted git repository.

robertlazarski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git

commit 5dd7c75d89fbf051b618be092ad763e986e7ee48
Author: Robert Lazarski 
AuthorDate: Fri Mar 21 03:50:17 2025 -1000

AXIS2-6086 AxisServlet - processAxisFault - does not guard against 
NumberFormatException
---
 .../src/main/java/org/apache/axis2/transport/http/AxisServlet.java| 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/modules/transport/http/src/main/java/org/apache/axis2/transport/http/AxisServlet.java
 
b/modules/transport/http/src/main/java/org/apache/axis2/transport/http/AxisServlet.java
index 0f346efacf..77875126ec 100644
--- 
a/modules/transport/http/src/main/java/org/apache/axis2/transport/http/AxisServlet.java
+++ 
b/modules/transport/http/src/main/java/org/apache/axis2/transport/http/AxisServlet.java
@@ -417,7 +417,9 @@ public class AxisServlet extends HttpServlet {
 String status =
 (String) 
msgContext.getProperty(Constants.HTTP_RESPONSE_STATE);
 if (status == null) {
-log.info("processAxisFault() on error message: " + 
e.getMessage() + " , found a null HTTP status from the MessageContext instance, 
setting HttpServletResponse status to 
HttpServletResponse.SC_INTERNAL_SERVER_ERROR", e);
+   // don't change the logging status from debug, 
+   // see AXIS2-6065 and AXIS2-6086
+log.debug("processAxisFault() on error message: " + 
e.getMessage() + " , found a null HTTP status from the MessageContext instance, 
setting HttpServletResponse status to 
HttpServletResponse.SC_INTERNAL_SERVER_ERROR", e);
 
res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
 } else {
 log.debug("processAxisFault() found an HTTP status from 
the MessageContext instance, setting HttpServletResponse status to: " + status);