[JBoss JIRA] (GTNPORTAL-3257) REST MOP Import doesn't detect errors on commit
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/GTNPORTAL-3257?page=com.atlassian.jira.pl... ]
RH Bugzilla Integration commented on GTNPORTAL-3257:
----------------------------------------------------
Toshiya Kobayashi <tkobayas(a)redhat.com> made a comment on [bug 1004213|https://bugzilla.redhat.com/show_bug.cgi?id=1004213]
Description of problem:
Platform BZ for https://issues.jboss.org/browse/GTNPORTAL-3257
Steps to Reproduce:
1. Call REST MOP Import (e.g. curl command in GTNPORTAL-3257)
2. Throw an Exception on JCR commit (e.g. using Byteman)
Actual results:
Transaction is rolled back. But REST response is 200 OK.
Expected results:
Transaction is rolled back. REST response is 500 (or something appropriate?).
> REST MOP Import doesn't detect errors on commit
> -----------------------------------------------
>
> Key: GTNPORTAL-3257
> URL: https://issues.jboss.org/browse/GTNPORTAL-3257
> Project: GateIn Portal
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: REST API
> Affects Versions: 3.6.0.Final
> Reporter: Toshiya Kobayashi
>
> When you call REST MOP Import:
> {noformat}
> curl -v -u root:gtn -X PUT -H 'Content-type: application/zip' --upload-file portal_classic_2013-06-10_15-16-53.zip http://localhost:8080/rest/private/managed-components/mop?importMode=over...
> {noformat}
> It returns 200 OK even if it fails on JCR commit (for example, cache replication timeout).
> Because JCR commit happens in RequestLifeCycle.end() after requestHandler.handleRequest() which flushes http response.
> https://github.com/exoplatform/ws/blob/master/exo.ws.rest.core/src/main/j...
> {code:java}
> protected void onService(ExoContainer container, HttpServletRequest httpRequest, HttpServletResponse httpResponse)
> throws IOException, ServletException
> {
> ...
> try
> {
> EnvironmentContext.setCurrent(env);
> ServletContainerRequest request = new ServletContainerRequest(httpRequest);
> ContainerResponse response = new ContainerResponse(new ServletContainerResponseWriter(httpResponse));
> requestHandler.handleRequest(request, response);
> }
> ...
> finally
> {
> EnvironmentContext.setCurrent(null);
> RequestLifeCycle.end();
> }
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 7 months
[JBoss JIRA] (GTNPORTAL-3257) REST MOP Import doesn't detect errors on commit
by Toshiya Kobayashi (JIRA)
Toshiya Kobayashi created GTNPORTAL-3257:
--------------------------------------------
Summary: REST MOP Import doesn't detect errors on commit
Key: GTNPORTAL-3257
URL: https://issues.jboss.org/browse/GTNPORTAL-3257
Project: GateIn Portal
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: REST API
Affects Versions: 3.6.0.Final
Reporter: Toshiya Kobayashi
When you call REST MOP Import:
{noformat}
curl -v -u root:gtn -X PUT -H 'Content-type: application/zip' --upload-file portal_classic_2013-06-10_15-16-53.zip http://localhost:8080/rest/private/managed-components/mop?importMode=over...
{noformat}
It returns 200 OK even if it fails on JCR commit (for example, cache replication timeout).
Because JCR commit happens in RequestLifeCycle.end() after requestHandler.handleRequest() which flushes http response.
https://github.com/exoplatform/ws/blob/master/exo.ws.rest.core/src/main/j...
{code:java}
protected void onService(ExoContainer container, HttpServletRequest httpRequest, HttpServletResponse httpResponse)
throws IOException, ServletException
{
...
try
{
EnvironmentContext.setCurrent(env);
ServletContainerRequest request = new ServletContainerRequest(httpRequest);
ContainerResponse response = new ContainerResponse(new ServletContainerResponseWriter(httpResponse));
requestHandler.handleRequest(request, response);
}
...
finally
{
EnvironmentContext.setCurrent(null);
RequestLifeCycle.end();
}
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 7 months