JasperServer content viewing throws index out of bound exception - jasperserver

We are trying to access the content of Jasperserver using below URL.
http://localhost:8080/jasperserver-pro/fileview/fileview/
When we try to hit this URL, we are getting below error.
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at com.jaspersoft.jasperserver.war.control.ContentRepositoryFileView.renderMergedOutputModel(ContentRepositoryFileView.java:58)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:264)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1216)
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1001)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:867)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
Can anyone help us why we are getting this error? We have reports configured in the server and we are not sure why we are getting this error .

You have to specify right URL to the specific content resource, for example:
http://localhost:8080/jasperserver-pro/fileview/fileview/public/SomeReport.pdf
where /public/SomeReport.pdf is a path to the content resource. The content resource can be any of pdf, txt, xml, csv, etc but not any of JapserServer resources like reports, adhoc views, domains and etc.

Related

Creating an attachment in SharePoint from Microsoft Forms Response - Get File Content using path not working

I am trying to add contents and an attachment from a Form to a SharePoint list. However, the Get file content using path action in my flow is failing. The error I'm receiving says "Unauthorized" and in the file content box, I receive the following message:
"status": 401,
"message": "A potentially dangerous Request.Path value was detected from the client (?).",
"source": "apidod.connectorp.svc.ms"
The file path is as follows (minus the front of the path):
sites/HSMWINGATLANTIC_Supply_Requests/Shared%20Documents/Forms/AllItems.aspx?newTargetListUrl=%2Fsites%2FHSMWINGATLANTIC%5FSupply%5FRequests%2FShared%20Documents&viewpath=%2Fsites%2FHSMWINGATLANTIC%5FSupply%5FRequests%2FShared%20Documents%2FForms%2FAllItems%2Easpx&id=%2Fsites%2FHSMWINGATLANTIC%5FSupply%5FRequests%2FShared%20Documents%2FApps%2FMicrosoft%20Forms%20Fairfax%2FVehicle%20Rental%20Request%2FSupporting%20Documents&viewid=55590b8b%2D4994%2D4e8b%2D804b%2D24f4774c21e920220815 - HSM-40 Truck Request for 15 AUG 20_Charles Power 1.pdf
c.d.power
For that Get File content using path you would need a relative path without the site url part. You can actually extract the correct path with an expression.
In the example below I retrieve the link property from the Attachment question answer value. I use a json function to turn it into an array, since Microsoft returns a string value for some reason ;)
After that I use nthindexof to determine at which forward slash (starting position of string) I need to slice with a slice function, in this case the 7th instance, which is index 6.
This should retrieve the part which we need for a get file content using path action. With a decodeUriComponent function I make sure the %20 is turned back into space characters.
Make sure you update the question id to your question id.
decodeUriComponent(slice(json(outputs('Get_response_details')?['body/re67e0cfcd95d488593347d93f2728204'])[0]['link'], nthindexof(json(outputs('Get_response_details')?['body/re67e0cfcd95d488593347d93f2728204'])[0]['link'], '/', 6)))
I found the solution to the issue. This wasn’t working because it is a group form and form responses are sent to the group’s SharePoint site; not the user’s OneDrive. Therefore, the Get file content action should be using the SharePoint connector instead of OneDrive.

/bin/aem/test.MY_SELECTOR.json is giving forbidden access message

when appending .json at the end of the path to the sling servlet http://:/bin/aem/test.MY_SELECTOR.json or similar ajax call, I get 403 forbidden access error on the page.
however, if I use: http://:/bin/aem/test.MY_SELECTOR.now
or any other string after the (.)dot, it works without issues.
Only .json seems to be the issue.
Is there something blocking from ACS commons.
We need to convert jsonResponse, which is a String to Gson.toJson(jsonResponse)

WSO2 ESB WS-Security with MTOM

Having WSO2 ESB 4.9.0, is it possible to enable the client WS-Security, set-up a policy for the endpoint, where the external (backend) service returns the MTOM attachment?
requirement: the external backend service requires the request to be signed and returns (optionally) MTOM response, which is not signed (plain).
As soon the Rampart module is engaged and an inbound policy is in force, the response doesn't get through a simple proxy with following exception:
Caused by: org.apache.ws.security.WSSecurityException: Error in converting SOAP Envelope to Document; nested exception is:
org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: Expected xop:Include as the sole child of an element information item (see section 3.2 of http://www.w3.org/TR/xop10/)
at org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.java:149)
at org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:268)
... 11 more
Caused by: org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: Expected xop:Include as the sole child of an element information item (see section 3.2 of http://www.w3.org/TR/xop10/)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
at org.apache.axiom.om.impl.llom.OMSerializableImpl.build(OMSerializableImpl.java:78)
at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:722)
at org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.java:84)
... 12 more
Caused by: javax.xml.stream.XMLStreamException: Expected xop:Include as the sole child of an element information item (see section 3.2 of http://www.w3.org/TR/xop10/)
at org.apache.axiom.util.stax.xop.XOPDecodingStreamReader.next(XOPDecodingStreamReader.java:187)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
... 15 more
However - there is the Include element:
<inc:Include href="cid:30545cee-7014-4149-8b77-7014e3e12a8c#xxxxxxx" xmlns:inc="http://www.w3.org/2004/08/xop/include"/>
Trying to test the service locally (creating a mockup service similar to the external service) I've got an exception:
Caused by: org.apache.axiom.om.OMException: Part content ID cannot be blank for non root MIME parts
at org.apache.axiom.attachments.Attachments.getNextPartDataHandler(Attachments.java:648)
at org.apache.axiom.attachments.Attachments.getDataHandler(Attachments.java:350)
which I assume is related to the issue https://wso2.org/jira/browse/ESBJAVA-3585. Is it related or I have wrong mockup service? Does MTOM works with security policy enabled?
Seems there are two issues involved:
Caused by: javax.xml.stream.XMLStreamException: Expected xop:Include as the sole child of an element information item (see section 3.2 of http://www.w3.org/TR/xop10/)
This is caused by the "pretty print" feature of the backend service. Axis 2 enforces the specification strictly, where the xop:Include element must be the sole and only child, therefore no whitespaces are allowed.
org.apache.axiom.om.OMException: Part content ID cannot be blank for non root MIME parts
This seems to be a bug, not yet solved at this time.
https://wso2.org/jira/browse/ESBJAVA-3585
Workaround could be change the message type to text/xml (effectively inserting base64 payload to the XML element), good for small/reasonable attachment sizes.
If the attachments can be bigger or the load is high, it is to be considered to store the attachment as a file and pass back only the file name.

SSRS report hang in loading

I have accidentally deleted a data source from the SSRS Report Server. After I have re-created the data source and have deployed all the reports again to the report server (I have deleted all reports and re-deployed them), all the reports hang in "Loading ...". Also, I found the following error message in the SSRS log file:
Unhandled exception:
Microsoft.Reporting.WebForms.HttpHandlerInputException: Missing URL
parameter: IterationId at
Microsoft.Reporting.WebForms.HandlerOperation.GetAndEnsureParam(NameValueCollection
urlQuery, String paramName) at
Microsoft.Reporting.WebForms.ReportImageOperation.PerformOperation(NameValueCollection
urlQuery, HttpResponse response) at
Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext
context) at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)
Anyone have any idea what it means and how I can fix this problem?
Its clear from the error message that your URL is missing a parameter named IterationId.
You might want to refer to this where it suggests concatenating &IterationId=0 at the end of the URL.
What that actually does is adding &IterationID=0 to the end of the URL
HttpContext.Current.RewritePath(u.PathAndQuery + "&IterationId=0");

Magento Undefined index: url

I got an error in my Magento 1.5.1 installation, that I don't know how to track down.
It says: "undefined index: url in /app/code/core/Mage/Core/Model/Email/Template/Filter.php on line 283"
I checked all email templates, but everything seems ok. Even with all email templates removed, the error still comes up.
Any hints on that?
Thanks in advance
Which means there is the url key missing in $params and $construction[2] when calling Mage_Core_Model_Email_Template_Filter::mediaDirective().
My guess would be that you got some CMS block, email template, translation .csv file, etc. using a mediaDirective which fails to assign its url value correctly.
Scan your files for
{{media url=
occurrences to see, which one fails to assign its url.
A proper one looks similiar to this:
{{media url="path/to/image.jpg"}}