JMeter generates server error when trying to reproduce an autoComplete tag - primefaces

I am trying to load test with JMeter.
I have a program where incidents are created.
For now, when playing the recording, it logs in fine, but when saving data it generates the following error:
SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (default task-5) Error Rendering View[/alta.xhtml]: javax.el.PropertyNotFoundException: /alta.xhtml #840,111 value="#{alta.nombre}": Target Unreachable, 'null' returned null
I have noticed that maybe the error is thrown because I have auto-complete lists.
Since, an error that is also seen in the console is:
SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (default task-5) Error Rendering View[/alta.xhtml]: java.lang.NullPointerException
at org.primefaces.component.autocomplete.AutoCompleteRenderer.encodeSuggestionsAsList(AutoCompleteRenderer.java:647)
How can i fix this? Apparently in the JMeter recording all the values ​​are saved...
The autocomplete of the first error that I have put is the following:
<p:autoComplete id="via"
rendered="#{not alta.isNuevoNivel}"
dropdown="true"
widgetVar="viaWV"
placeholder="Seleccione la via"
value="#{alta.nombre}"
requiredMessage="Falta la via"
completeMethod="#{alta.completeTextPrimeraVia}"
required="true"
queryDelay="100"
cache="true"
forceSelection="true"
scrollHeight="200"
minQueryLength="0"
onfocus="if (#{null eq alta.via}) {PF('viaWV').search('');};"
onclick="PF('viaWV').search('');"
autoHighlight="false"
inputStyleClass="comboEditorAutoInput"
styleClass="comboEditorAuto"
panelStyleClass="panStyleAuto"
tabindex="24"
disabled="#{alta.isObligada() or not alta.isNueva()}" >
<p:ajax event="itemSelect"
partialSubmit="true"
delay="100"
listener="#{alta.onChangeViaEdicion()}"
update="rcCampoViaModificado :formEdicionVia:via_valor"
oncomplete="rcCampoViaModificado();"
onerror="onError();"/>
<p:ajax event="clear"
immediate="true"
delay="100"
listener="#{alta.clearVialEdicion()}"
update="rcCampoViaModificado"
oncomplete="rcCampoViaModificado();"
onerror="onError();"/>
</p:autoComplete>

Most probably your request fails due to missing or improperly implemented correlation, for modern Web 2.0 applications the chance of successful replaying recorded script is close to zero as the applications heavily rely on dynamic parameters which are used for client-side state tracking or security
When you record the actions in browser JMeter saves the values which are actual at the moment, but when you try to replay the script the values are not actual anymore so you need to extract the dynamic parameters from server response (or replicate their generation logic if they cannot be extracted) and substitute hard-coded values with their dynamic counterparts.
One of the possible ways of detecting dynamic values is recording the same scenario one more time and then comparing generated JMeter test plans - all the values which differ are a subject to correlation

Related

JMeter HTML Reporting - Why is "infinity" appearing for throughput and network speed?

This appeared for two larger requests, neither of which failed/errored, in a test case with a single user run.
However, this does not appear for the five-user run of the same test case.
I haven't been able to find any documentation on Apache regarding the appearance of infinity during test runs.
Has anyone faced this? If so, did you find a way to get the reporting tool list the true numeric value?
Example of "infinity" appearing in the statistics.json 1
If you have "Infinity" in the statistics.json it means that the relevant Sampler has failed somewhere somehow (it hasn't been executed for some reason).
The reason can be found in:
.jtl results file, take a look at "responseMessage" column
jmeter.log file
If you want to see where the values are coming from and how the statistics are being built and processed - increase JMeter's logging verbosity for the HTML Reporting Dashboard packages by adding the next line to log4j2.xml file:
<Logger name="org.apache.jmeter.report.dashboard" level="debug" />
The easiest way to reproduce the issue is just creating a "bad" request, for example adding a HTTP Request sampler like this:
it won't be executed because you cannot have :// characters in the DNS hostname and this transaction will be having "Infinity" values in the statistics.json

Why my Soffid JSON REST Web Services Connector does not update an object in the target system?

I am trying to connect my Soffid 3 server with our custom web application named Schrift. I am using а JSON REST Web Services Connector for this purpose. I added REST Web service plugin and then configured an agent with JSON/XML/SOAP Rest webservice type.
Loading of objects is working fine. My REST connector connects to the web service successfully and gets data of the accounts.
The problem is when I am trying to update some data (for example, I am trying to lock an account), nothing happens. And unfortunately I don't know what should be happening. When should REST connector send updated data to the managed system and in which way? I didn't find any log entries saying that REST connector was trying to update an object on managed system. Maybe I did smth wrong or missed something.
I would appreciate for any help. I can post any conf or log details if you need.
Update#1
(I did some investigation after the first answer)
I checked the agent settings: Read only and Manual account creation are set to no
The account was set to unmanaged type, but I succeeded in changing its type to shared and then to single without getting an error. Now it is set to single
The task queue is empty.
Also I've checked that update method is present and update properties are set correctly. updateParams is not set (it means that all attributes should be sent to the managed system).
But when I change status of the account (from Enable to Disable), nothing happens.
In the console log I can see only these lines
14-Sep-2021 13:26:29.708 INFO [BPM-Scheduler:192.168.7.121:1] com.soffid.iam.bpm.job.JobExecutorThread.run No job to execute
When I manually run the task Analize impact for changes on Schrift, Execution log shows
Changes detected for accounts
=============================
NO CHANGE DETECTED
Changes detected for roles
=============================
NO CHANGE DETECTED
Update#2
After many attempts I made some progress. Now when I make some changes in the account, the task named UpdateAccount baklykov#irf.com.ua#Schrift appears, but runs with an error.
At first it was 415 Unsupported Media Type error as I wrote in comments, but now it looks a little different
Throws exception updating object : Extensible object [type = account]
EmployeeEmail: baklykov#irf.com.ua
IsLockedOut: true (log truncated) ...
caused by Unexpected response, Content-Type: null
Update#3
I found out that soffid's request for updating the object was in improper format (all the parameters were passed in the html request instead of putting them in json body)
After researching I found a method's property called Encoding and set it to application/json value.
Now the parameters are passed in json body (that's what I need), but now the problem is that soffid puts all the parameters in json body, including the key parameter by which the object for updating should be determined. My guess this is the reason why the object in the target system is still not updated.
In other words my application expects a request like this:
https://myapp.mysite.com/api/v1/Soffid/Employees?EmployeeEmail=baklykov%40irf.com.ua :
{"EmployeeLastName":"Baklykov","EmployeeFirstName":"Ivan"}
but Soffid sends this:
https://myapp.mysite.com/api/v1/Soffid/Employees:
{"EmployeeLastName":"Baklykov","EmployeeFirstName":"Ivan","EmployeeEmail":"baklykov#irf.com.ua"}
The system should have created a UpdateAccount task in the task queue. Please, verify:
The task engine is in automatic mode. In read-only or manual mode, no task will be created.
If you are updating an account, check the account is not set as unmanaged. In that case, no tasks is created.
Finally, verify the task queue has not held the task up.
Have you checked the engine mode? Look at Main Menu > Administration > Configure Soffid > Integration engine > Smart engine settings
It should be set to automatic.

Error receiving large report using Reporting Services Execution Web service

I have an application which stores photo data in database. An SSRS report is used to generate reports of photos related to a specific entity. The information required to generate this report is stored in a separate database and very simply links a ReportId with a number of photos. The Reporting Services Execution Web service is used to render a report in Word format and output a byte array which is then used by the application.
The issue is, there is a very clear and repeatable size limit beyond which the report is not received by the application. In each case the report is rendered successfully but the response is never sent as per the RS logs:
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: HttpPipelineCallback::SendResponse(): failed writing response.
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: Failed with win32 error 0x0057, pipeline=0x0000027542592740.
httpruntime!ReportServer_0-1!1bfc!03/14/2018-21:46:48:: e ERROR: Failed in
BaseWorkerRequest::SendHttpResponse(bool), exception=System.ArgumentException: Value does not fall within the expected range.
at Microsoft.ReportingServices.HostingInterfaces.IRsHttpPipeline.SendResponse(Void* response, Boolean finalWrite, Boolean closeConn)
at ReportingServicesHttpRuntime.BaseWorkerRequest.SendHttpResponse(Boolean finalFlush)
library!ReportServer_0-1!1bfc!03/14/2018-21:46:48:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerHttpRuntimeInternalException: RsWorkerRequest::FlushResponse., Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerHttpRuntimeInternalException: An internal or system error occurred in the HTTP Runtime object for application domain ReportServer_SSRS_0-1-131655000672564770. ---> System.ArgumentException: Value does not fall within the expected range.
at ReportingServicesHttpRuntime.BaseWorkerRequest.SendHttpResponse(Boolean finalFlush)
at ReportingServicesHttpRuntime.RsWorkerRequest.FlushResponse(Boolean finalFlush)
--- End of inner exception stack trace ---;
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: HttpPipelineCallback::SendResponse(): failed writing response.
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: Failed with win32 error 0x10DD, pipeline=0x0000027542592740.
This appears to be directly related to some size limit of the service http response for the following reasons:
The request itself is very small, just a Report Id i.e. httpRuntime maxRequestLength is not related, this has been tested.
The error happens within a few minutes of the request i.e. httpRuntime executionTimeout is not related, this has been tested.
I can reliably and repeatably add one photo too many to the report and it will fail, remove one photo and it renders and sends with no issues, add one photo and it will fail...
The times to render vary so again it appears more related to size than some timeout.
The report server execution logs show that the rendering is successful every time, regardless of whether the report is sent or not.
I have reproduced the error using both the application which normally calls the report and a separate console app that simply generates a web service client and tries to render and receive the report as a byte array using the Render2 method.
I have reproduced this error using SQL Server 2012 and SQL Server 2016, on several different report servers, including setting up a report server locally and running the server and request on the same machine.
Regardless of the combination of photos, the report always renders successfully but fails to send around a bytecount of ~238,000,000 i.e. not related to some bad data.
In all cases I am able to generate reports of the same size or greater through the Report Server portal with no issues.
Has anyone experienced similar behaviour using the RS web service? I have searched online extensively without any luck. Any suggestions on how to address this issue would be greatly appreciated.
Microsoft finally identified HttpSendResponseEntityBody as the source of the error. The function sends entity-body data associated with an HTTP response, and as per MSDN has the following parameter:
EntityChunkCount [in] A number of structures in the array pointed to by pEntityChunks. This count cannot exceed 9999.
Microsoft don't have any SSRS documentation that addresses report size limits. At this stage all they have done is suggest that "we can use other tools for this data extracting" and that "generally we suggest put the data smaller than 100MB or the row counts less than 1,000,000".

How to control triggering of email for the same error in ssis using event handlers?

I am using ssis event handler to trigger an email whenever an error occured in the entire package(PACKAGE+ONEEROR). Here number of emails triggered is equal to number of errors generated.How can I restrict it to one mail eventhough the same error occured 10 times.
Please suggest....
You have a few options. The problem with setting an ONERROR email at the package level is that it will send an email for each error the package encounters. This gets ugly if you have a deep level transform fail, which will error as it fails back up to the package level.
I suggest that you either:
1) Setup ONERROR events at the task level and remove the package level event. Usually this will be good enough. Most tasks will only have one error to report. Be careful with Data Flows, they can act in a similar fashion as the package level events.
2) Setup some sort of advance logging. I’ve seen this done several ways. I’ve seen some people setup Script tasks to log the errors (at the task level) to a variable, and then send a final email containing the variable in the body (at control flow level). I have also seen people call stored procedures (at the task level and package level) for each error that occurs. The sproc would log errors to the DB and allow the package to continue on to the next step/container. The logged errors can then be dumped into a csv and emailed as an attachment.
If you like your current setup, you can try changing the error properties for each container/task. I haven't ever done this, but I do know you can change the way tasks handle errors! I don't like this option because you would possibly be missing errors (maybe? kind of guessing).
update From another solution - If you want to keep your current email ONERROR and simply prevent certain errors from "bubbling" up and sending emails, you can follow this link to learn how to gracefully handle errors. You could prevent certain tasks errors from reaching your ONERROR event at the package level. good luck.

How to get query parameters in ExceptionHandler?

In our project (JBoss 7.0.2, JSF 2), we work on a solution to catch all exceptions during user navigation and redirect them to nice error pages.
I used an ExceptionHandler, inspired by a lot of examples and tutorials online.
I managed to do a redirection feature without too much difficulty: in the ExceptionHandler.handle() method, for some exceptions (expired view/session, unauthenticated user asking a denied page, ...) I redirect the user on the login page through a good old
FacesContext.getCurrentInstance().getExternalContext().redirect(myRedirectPage);
with an additional query parameter containing the original url base64 encoded, and after a successful authentication I use the same redirection mechanism to send the user back to their page.
The problem is with ViewExpiredException on JSF actions, by example when the user click after their view has expired on any button or link with action or actionListener, synchronous or ajax-style, like
<h:commandButton action="#{myBean.myAction}" value="do that" />
or
<h:commandLink value="do that too">
<f:ajax render=":aZone" execute="#form" listener="#{myBean.myOtherAction}" />
</h:commandLink>
I cannot manage to obtain the query parameters in my ExceptionHandler.handle() method.
I tried to put my parameters in a f:metadata section, like
<f:metadata>
<f:viewParam name="myParam" value="#{myBean.myParam}" />
</f:metadata>
and to include them in the action, so in the method bound to button action I returned
"myPage.xhtml?includeViewParams=true"
but it changed nothing :-/
Am I doing something wrong? Where am I supposed to find the query paremeters? Is it in
FacesContext.getCurrentInstance().getExternalContext().getRequest()
** UPDATE **
As said in comments, view params are no more available after a ViewExpiredException (quite obvious, in fact), so params are to be stored elsewhere (#BalusC quickly suggested in a request scope or through cookie).
The request parameters are available by ExternalContext#getRequestParameterMap().
Map<String, String> params = externalContext.getRequestParameterMap();
// ...
Or if your application uses same parameter name with multiple values (which is usually the case for <h:selectManyXxx> components), use ExternalContext#getRequestParameterValuesMap() instead
Map<String, String[]> params = externalContext.getRequestParameterValuesMap();
// ...
Please note that this only returns the parameters of the current request, not of the initial request in case of postbacks.
As to the ExternalContext#getRequest(), it returns in case of JSF applications running on a servlet container an instance of HttpServletRequest which you'd need to cast, but you should rarely have the need to get it. The ExternalContext, while following the Facade design pattern, has a lot of methods which are delegating to the underlying raw HTTP servlet request, session and context. You'd namely ultimately like to end up with zero javax.servlet imports in your backing beans.
Update as per your comment, you actually want to get only the view parameters which are been registered by <f:viewParam>. You can get them by ViewMetadata#getViewParameters() wherein you pass the current UIViewRoot.
Collection<UIViewParameter> viewParameters = ViewMetadata.getViewParameters(FacesContext.getCurrentInstance().getViewRoot());
// ...