[ 
https://issues.apache.org/jira/browse/SLING-7492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tomasz updated SLING-7492:
--------------------------
    Description: 
Constructing a fully correct request that implements HttpServletRequest means 
that it won't have an attribute of SlingRequestProgressTracker. There is no 
chance to instantiate it. 
 When developer invokes method processRequest from SlingRequestProcessor using 
mentioned, created request it writes lots of warnings in logs.
 That's because constructor of org.apache.sling.engine.impl.request.RequestData 
contains given lines: 

Object o = request.getAttribute(RequestProgressTracker.class.getName());
 if(o instanceof SlingRequestProgressTracker)

{     this.requestProgressTracker = (SlingRequestProgressTracker)o; }

else

{     this.log.warn("SlingRequestProgressTracker not found in request 
attributes");     this.requestProgressTracker = new 
SlingRequestProgressTracker(request); }

Steps to reproduce:
 # Create new class, let's call it MockRequest, that implements 
HttpServletRequest.
 # Create an object of MockRequest.
 # Instantiate or inject an object of SlingRequestProcessor.
 # On SlingRequestProcessor object invoke method processRequest(), where, as a 
request parameter, provide a MockRequest object.
 # Check logs. You will see lot's of warnings like given one:
 26.01.2018 01:25:48.607 *WARN* [pool-331-thread-3] 
org.apache.sling.engine.impl.request.RequestData SlingRequestProgressTracker 
not found in request attributes

Expected: warnings does not appear in logs or there is a way to avoid them.

  was:
Constructing a fully correct request that implements HttpServletRequest means 
that it won't have an attribute of SlingRequestProgressTracker. There is no 
chance to instantiate it. 
 When developer invokes method processRequest from SlingRequestProcessor using 
mentioned, created request it writes lots of warnings in logs.
 That's because constructor of org.apache.sling.engine.impl.request.RequestData 
contains given lines: 

 Object o = request.getAttribute(RequestProgressTracker.class.getName());
 if(o instanceof SlingRequestProgressTracker) { 
    this.requestProgressTracker = (SlingRequestProgressTracker)o; 
}
else {
    this.log.warn("SlingRequestProgressTracker not found in request 
attributes");
    this.requestProgressTracker = new SlingRequestProgressTracker(request);
}

Steps to reproduce:
 # Create new class, let's call it MockRequest, that implements 
HttpServletRequest.
 # Create an object of MockRequest.
 # Instantiate or inject an object of SlingRequestProcessor.
 # On SlingRequestProcessor object invoke method processRequest(), where, as a 
request parameter, provide a MockRequest object.
 # Check logs. You will see lot's of warnings like given one:
 26.01.2018 01:25:48.607 *WARN* [pool-331-thread-3] 
org.apache.sling.engine.impl.request.RequestData SlingRequestProgressTracker 
not found in request attributes

Expected: warnings does not appear in logs or there is a way to avoid such logs.


> Lots of logs on missing SlingRequestProgressTracker
> ---------------------------------------------------
>
>                 Key: SLING-7492
>                 URL: https://issues.apache.org/jira/browse/SLING-7492
>             Project: Sling
>          Issue Type: Bug
>    Affects Versions: Engine 2.6.6
>         Environment: Using Adobe Experience Manager
>            Reporter: Tomasz
>            Priority: Major
>
> Constructing a fully correct request that implements HttpServletRequest means 
> that it won't have an attribute of SlingRequestProgressTracker. There is no 
> chance to instantiate it. 
>  When developer invokes method processRequest from SlingRequestProcessor 
> using mentioned, created request it writes lots of warnings in logs.
>  That's because constructor of 
> org.apache.sling.engine.impl.request.RequestData contains given lines: 
> Object o = request.getAttribute(RequestProgressTracker.class.getName());
>  if(o instanceof SlingRequestProgressTracker)
> {     this.requestProgressTracker = (SlingRequestProgressTracker)o; }
> else
> {     this.log.warn("SlingRequestProgressTracker not found in request 
> attributes");     this.requestProgressTracker = new 
> SlingRequestProgressTracker(request); }
> Steps to reproduce:
>  # Create new class, let's call it MockRequest, that implements 
> HttpServletRequest.
>  # Create an object of MockRequest.
>  # Instantiate or inject an object of SlingRequestProcessor.
>  # On SlingRequestProcessor object invoke method processRequest(), where, as 
> a request parameter, provide a MockRequest object.
>  # Check logs. You will see lot's of warnings like given one:
>  26.01.2018 01:25:48.607 *WARN* [pool-331-thread-3] 
> org.apache.sling.engine.impl.request.RequestData SlingRequestProgressTracker 
> not found in request attributes
> Expected: warnings does not appear in logs or there is a way to avoid them.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to