You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Deepak Dixit (Jira)" <ji...@apache.org> on 2025/08/21 10:24:00 UTC
[jira] [Comment Edited] (OFBIZ-13278) Repeated REST API exception results in generic 500 error instead of specific response
[ https://issues.apache.org/jira/browse/OFBIZ-13278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18015392#comment-18015392 ]
Deepak Dixit edited comment on OFBIZ-13278 at 8/21/25 10:23 AM:
----------------------------------------------------------------
Thanks [~arash]
I am able to regenerate the issue, I have set the action ="POST" in createProject service, call it as
POST [https://localhost:8443/rest/services/createProject] with empty body
Got 500 error in response.
Error from console
{code:java}
SEVERE: An exception has been thrown from an exception mapper class org.apache.ofbiz.ws.rs.spi.impl.GenericServiceExceptionMapper.
java.lang.IllegalStateException: The request object has been recycled and is no longer associated with this facade
at org.apache.catalina.connector.RequestFacade.checkFacade(RequestFacade.java:855)
{code}
was (Author: deepak.dixit):
Thanks [~arash]
I am able to regenerate the issue, I have set the action ="POST" in createProject service, call it as
POST [https://localhost:8443/rest/services/createProject] with empty body
Got 500 error in response.
> Repeated REST API exception results in generic 500 error instead of specific response
> -------------------------------------------------------------------------------------
>
> Key: OFBIZ-13278
> URL: https://issues.apache.org/jira/browse/OFBIZ-13278
> Project: OFBiz
> Issue Type: Bug
> Components: rest-api
> Affects Versions: 24.09.02
> Reporter: Arashpreet Singh
> Priority: Major
>
> When a REST API exposed via the {{rest-api}} module is called and an exception occurs during execution, OFBiz initially returns an appropriate error response. However, if the same API is called again and the exception persists, OFBiz returns a generic HTTP 500 Internal Server Error without providing the specific error message or exception details that were returned on the first call.
> *Steps to Reproduce:*
> # Call a REST API (e.g., {{{}/rest/some-endpoint{}}}) that is expected to raise an exception due to missing input, business logic failure, or invalid state.
> # Observe the first response – it contains a descriptive error message.
> # Without fixing the root cause, call the same API again.
> # The second response returns HTTP 500 Internal Server Error without the original error message.
> *Expected Behavior:*
> * The API should return a consistent and descriptive error response each time the same exception occurs, not a generic 500 error.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)