ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacques Le Roux (Jira)" <j...@apache.org>
Subject [jira] [Comment Edited] (OFBIZ-11246) The createTaskContent request does not work
Date Sat, 25 Jan 2020 14:06:00 GMT

    [ https://issues.apache.org/jira/browse/OFBIZ-11246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17023544#comment-17023544
] 

Jacques Le Roux edited comment on OFBIZ-11246 at 1/25/20 2:05 PM:
------------------------------------------------------------------

Thanks for sharing error logs [~jleroux],

I am able to replicate the same on latest trunk and also did my research around it.

Here are the details:

-- *createWorkEffortContent* is being triggers on file upload, and the request object is getting
parsed using *ServletFileUpload* two times,

1.  Inside UtilHttp.getMultiPartParameterMap() while making combined map object from request
object using method UtilHttp.getCombinedMap(request).

2. from *createWorkEffortContent* event, inside LayoutWorker.uploadImageAndParameters() 

So before calling *createWorkEffortContent* event, from #1, the uploaded file is getting
removed from the parse method on request object:

{code}

uploadedItems = UtilGenerics.cast(upload.parseRequest(request));

{code}

It seems that same request can not be parsed multiple times if it has multi part object in
it as the parse method remove it after that.

Found one stackoverflow link around the same:

[https://stackoverflow.com/questions/13881272/servletfileuploadparserequestrequest-returns-an-empty-list] 

I believe that all places/uploads using this workflow should resulting the same issue.



was (Author: ankush.upadhyay):
Thanks for sharing error logs [~jleroux],

I am able to replicate the same on latest trunk and also did my research around it.

Here are the details:

-- *createWorkEffortContent* is being triggers on file upload, and the request object is getting
parsed using *ServletFileUpload* two times,

1.  Inside UtilHttp.getMultiPartParameterMap() while making combined map object from request
object using method UtilHttp.getCombinedMap(request).

2. from *createWorkEffortContent* event, inside LayoutWorker.uploadImageAndParameters() 

So before calling *createWorkEffortContent* event, from #1, the uploaded file is getting
removed from the parse method on request object:

{code}

uploadedItems = UtilGenerics.cast(upload.parseRequest(request));

{code}

It seems that same request can not be parsed multiple times if it has multi part object in
it as the parse method remove it after that.

Found one stackoverflow link around the same:

[https://stackoverflow.com/questions/13881272/servletfileuploadparserequestrequest-returns-an-empty-list]

 

I believe that all places/uploads using this workflow should resulting the same issue.

 

 

 

> The createTaskContent request does not work
> -------------------------------------------
>
>                 Key: OFBIZ-11246
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-11246
>             Project: OFBiz
>          Issue Type: Bug
>          Components: projectmgr, workeffort
>    Affects Versions: Trunk
>            Reporter: Jacques Le Roux
>            Assignee: Jacques Le Roux
>            Priority: Major
>
> While working on OFBIZ-11123 I found that the createTaskContent request does not work.
> If you get to [https://demo-trunk.ofbiz.apache.org/projectmgr/control/EditTaskContents?workEffortId=9002]
and enter values, the 1st error you get in log is
> {noformat}
> 2019-10-11 10:01:12,097 |ajp-nio-8009-exec-8  |UtilProperties                |W| layoutEvents.no_files_uploaded
is missing in ContentErrorUiLabels for locale en
> 2019-10-11 10:01:12,097 |ajp-nio-8009-exec-8  |UtilProperties                |W| layoutEvents.no_files_uploaded
is missing in ContentErrorUiLabels for locale en
> 2019-10-11 10:01:12,097 |ajp-nio-8009-exec-8  |ServiceUtil                   |E| {errorMessage=layoutEvents.no_files_uploaded,
responseMessage=error}
> {noformat}
> The error above comes from LayoutWorker::uploadImageAndParameters with the below stack
> {noformat}
> org.apache.ofbiz.content.layout.LayoutWorker.uploadImageAndParameters(javax.servlet.http.HttpServletRequest,
java.lang.String) line: 56	
> sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object,
java.lang.Object[]) line: not available [native method]	
> sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line:
62	
> sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[])
line: 43	
> java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 498	
> org.apache.ofbiz.minilang.MiniLangUtil.callMethod(org.apache.ofbiz.minilang.method.MethodOperation,
org.apache.ofbiz.minilang.method.MethodContext, java.util.List<org.apache.ofbiz.minilang.method.MethodObject<?>>,
java.lang.Class<?>, java.lang.Object, java.lang.String, org.apache.ofbiz.base.util.collections.FlexibleMapAccessor<java.lang.Object>)
line: 131	
> org.apache.ofbiz.minilang.method.callops.CallClassMethod.exec(org.apache.ofbiz.minilang.method.MethodContext)
line: 93	
> org.apache.ofbiz.minilang.SimpleMethod.runSubOps(java.util.List<org.apache.ofbiz.minilang.method.MethodOperation>,
org.apache.ofbiz.minilang.method.MethodContext) line: 310	
> org.apache.ofbiz.minilang.SimpleMethod.exec(org.apache.ofbiz.minilang.method.MethodContext)
line: 457	
> org.apache.ofbiz.minilang.SimpleMethod.runSimpleMethod(java.lang.String, java.lang.String,
org.apache.ofbiz.minilang.method.MethodContext) line: 274	
> org.apache.ofbiz.minilang.SimpleMethod.runSimpleEvent(java.lang.String, java.lang.String,
javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 257	
> org.apache.ofbiz.webapp.event.SimpleEventHandler.invoke(org.apache.ofbiz.webapp.control.ConfigXMLReader$Event,
org.apache.ofbiz.webapp.control.ConfigXMLReader$RequestMap, javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) line: 70	
> org.apache.ofbiz.webapp.control.RequestHandler.runEvent(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, org.apache.ofbiz.webapp.control.ConfigXMLReader$Event,
org.apache.ofbiz.webapp.control.ConfigXMLReader$RequestMap, java.lang.String) line: 784	
> org.apache.ofbiz.webapp.control.RequestHandler.doRequest(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, java.lang.String, org.apache.ofbiz.entity.GenericValue,
org.apache.ofbiz.entity.Delegator) line: 507	
> org.apache.ofbiz.webapp.control.ControlServlet.doGet(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) line: 212	
> org.apache.ofbiz.webapp.control.ControlServlet.doPost(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) line: 85	
> org.apache.ofbiz.webapp.control.ControlServlet(javax.servlet.http.HttpServlet).service(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) line: 665	
> org.apache.ofbiz.webapp.control.ControlServlet(javax.servlet.http.HttpServlet).service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 750	
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 231	
> org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 166	
> org.apache.tomcat.websocket.server.WsFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse,
javax.servlet.FilterChain) line: 53	
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 193	
> org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 166	
> org.apache.ofbiz.webapp.control.ContextFilter.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 187	
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 193	
> org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 166	
> org.apache.ofbiz.webapp.control.ControlFilter.doFilter(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) line: 156	
> org.apache.ofbiz.webapp.control.ControlFilter(javax.servlet.http.HttpFilter).doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 127	
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 193	
> org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 166	
> org.apache.logging.log4j.web.Log4jServletFilter.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 71	
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 193	
> org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) line: 166	
> org.apache.catalina.core.StandardWrapperValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) line: 202	
> org.apache.catalina.core.StandardContextValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) line: 96	
> org.apache.catalina.authenticator.NonLoginAuthenticator(org.apache.catalina.authenticator.AuthenticatorBase).invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) line: 526	
> org.apache.catalina.core.StandardHostValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) line: 139	
> org.apache.catalina.valves.ErrorReportValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) line: 92	
> org.apache.catalina.core.StandardEngineValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) line: 74	
> org.apache.catalina.valves.AccessLogValve(org.apache.catalina.valves.AbstractAccessLogValve).invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) line: 678	
> org.apache.catalina.connector.CoyoteAdapter.service(org.apache.coyote.Request, org.apache.coyote.Response)
line: 343	
> org.apache.coyote.http11.Http11Processor.service(org.apache.tomcat.util.net.SocketWrapperBase<?>)
line: 408	
> org.apache.coyote.http11.Http11Processor(org.apache.coyote.AbstractProcessorLight).process(org.apache.tomcat.util.net.SocketWrapperBase<?>,
org.apache.tomcat.util.net.SocketEvent) line: 66	
> org.apache.coyote.AbstractProtocol$ConnectionHandler<S>.process(org.apache.tomcat.util.net.SocketWrapperBase<S>,
org.apache.tomcat.util.net.SocketEvent) line: 860	
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun() line: 1589	
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor(org.apache.tomcat.util.net.SocketProcessorBase<S>).run()
line: 49	
> org.apache.tomcat.util.threads.ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor).runWorker(java.util.concurrent.ThreadPoolExecutor$Worker)
line: 1149	
> java.util.concurrent.ThreadPoolExecutor$Worker.run() line: 624	
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run() line: 61	
> org.apache.tomcat.util.threads.TaskThread(java.lang.Thread).run() line: 748	
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message