I am trying to import a json in spoon. It works just fine with a file .json but when I try it from a URL I get the Unexpected Error, followed by the java null pointer exception, when executing the transformation.
I get the same error with "JSON input", and with "Get content" followed by "extract from stream" which seems to be very alike.
For the simple test I used for URL :
http://echo.jsontest.com/name/James/age/25
I tried with the "Json INPUT", selected the checkbox field as an URL, tried with the URL above (with and without the http://). And in the fields parametre I used the same ones that worked well with a file input (instead of URL).
So the JSONPATH are $.name and $.age
I also tried starting from the sample data "Json input - read incoming stream" and switching it to URL like it was described in this post :
http://forums.pentaho.com/showthread.php?135741-Issues-with-JSON-Input-step
I am working on a distant server running on debian (jessie version).
I use pentaho 6.1
I feel like I've tried everything but I might be missing something obvious.
I apologize for my poor level of english. If more information is needed just ask. Thank you.
I started it all over again. It works now I have no idea why though.
Related
I build a custom connector in PowerApss. I use two requests. One is Post it's working fine, but the other one is not working. It is a get request.
I use the following string. It don't gives any error back, but I also shows no text in the Powerapps text field:
ClearCollect(colMetadata; ForAll(Table(ParseJSON(MetadatenserviceTest.GETBYMandantId("UserAccount"; "application/json"; "application/json").key));{ a: Key }))
Maybe you can help me to solve the problem.
Best regards
Matthias
I am using Talend Open Studio to call the Commerzbank API with a POST request to get a refresh token.
I get the error message "Missing form parameter: grant_type", which confuses me, as my tREST component looks like this:
In Postman everything worked well using this config:
Do I maybe need to place Content type "application/x-www-form-urlencoded" in a different way/place?
Thank you in advance for any hint :)
I was confusing things here: x-www-form-urlencoded does not ask for a json body, but something in the format like param1=value1¶m2=value2
You can view code in the right level at Postman an get the java code from there .
https://learning.postman.com/docs/sending-requests/generate-code-snippets/#:~:text=In%20Postman%2C%20select%20the%20request,copy%20your%20generated%20code%20snippet.
Then you can paste the wanted code in a tjava .
The last step is to call it in query or body in tREST .
I was going through some website and stumbled upon following bug in it, while playing with different combinations for url parameters.
When I append ?&=& to any valid url on this website I get following error: /p is part of url (java.lang.ArrayIndexOutOfBoundsException).
Chrome parses the string as below:
But this exception is not raised when I append ?&& instead of ?&=&. Chrome parses both string into same thing.
How is "?&=&" actually parsed and how is it different from "?&&"? As chrome parses them into same thing why does it generate an exception only in former case?
What kind of bug does this website might have?
Can such bug be used to do some kind of attack on this website?
Note:
I do not own this website so I am just curious to know what might have caused this bug.
Issue is seen consistently on both chrome and firefox.
builtwith.com says this website uses ngix server.
Let me know if this is offtopic here. Didnt find any such info.
Edit:
I understand what this exception means. I just want to know if these 2 kind of parameter are parsed differently. What are the possible cause of such a bug.
A java.lang.ArrayOutOfBoundsException caused by the Java backend of the page.
This exception occurs when a java application is trying to access an element in a Java Array that does not exist.
How and why exactly this occurs or how the url parameters are processed is impossible to say without having access to the source code of the backend.
It is not caused by the frontend code or by your browser.
I am trying to contact an API by posting the parameters in the URL. I am unsure whether it will respond in XML or JSON, but it is one of the two, however, it says there is an error.
This is an example of what I'm submitting. I am receiving this in response:
This page contains the following errors:
error on line 1 at column 1: Document is empty
Below is a rendering of the page up to the first error.
I do not know what is going on... I followed the syntax of the POST I believe, my only remaining question about the syntax would be whether the ? is in the right spot. The page API does work when I POST using PHP...
Or maybe it is working, the browser just isn't capable of understanding an XML or JSON response? (I'm using chrome so I do not think this is the issue)
Otherwise, if anyone has any insight on this, I'd be greatful
A different browser yields this error:
XML Parsing Error: syntax error
Location:
Line Number 1, Column 1:Array
^
While the syntax of the URL does seem to be fine, you imply that the API expects the parameters in POST. Adding them to the actual URL means the parameters are passed in GET, rather than POST.
You could try to test this by making a little HTML form containing all the relevant parameters and passing them to this API via POST, and see if that gives you the expected result.
your issue is how their being sent to the api it should be url-encoded
http://api.example.com/api/?apikey=asdfa23462=example&ip=208.74.76.5
should be
http://api.example.com/api/?apikey=asdfa23462&=example&ip=208.74.76.5
also another issue i see is that you have ?apikey=asdfasfsdafsd&=example
the =example could well be the issue all together.
just some thoughts from what i see.
I am using HTML and trying to get a JSON response from a URL.
I ran in to cross domain issues.
I then tried using a callback function in order to avoid this problem.
When I do so, and the control passes to the function. I see a "Invalid Label" error in firebug and it shows the JSON response that i get back.
When i did some reading i found a few articles which said the invalid label error could occur because the first word of the JSON response is thought of as a Javascript label and it should be wrapped as a string.
However it did not work because firebug throws the error before even it hits the first line of the function. I also tried debugging in chrome and I get the same result.
Any input would be greatly appreciated.
Found something that might help for you here
Quote from there:
The problem occurs because eval is
interpreting the first item in the
JSON string as a JavaScript Label. The
solution is to wrap the JSON string in
parenthesis.
See this link
I'd suggest using jQuery's .json method to retrieve json, because it hides this implementation.
Thanks for the replies.
I tried the changes and still was facing the same issue. THe solution of wrapping the json string in parenthesis does not solve the problem because this issue is faced even before the code hits that portion.
The problem was that the API was not call back enabled. ( Grrr :() I know! But that was the issue. once the API callback was enabled, the code worked like a charm.