Illegal character in query URI Syntax [closed] - java

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
Illegal character in query at index 127: http://192.168.1.7:8080/service-0.0.1-SNAPSHOT/report/genReport/generateReport?reportname=REPORT&doctype=PDF&param={"StartDate":"20140604","EndDate":"20140630","Range":"10"}
can any one help me to get out of this error

You should urlencode the JSON
{"StartDate":"20140604","EndDate":"20140630","Range":"10"}
to
%7B%22StartDate%22%3A%2220140604%22%2C%22EndDate%22%3A%2220140630%22%2C%22Range%22%3A%2210%22%7D
The URL will then be
http://192.168.1.7:8080/service-0.0.1-SNAPSHOT/report/genReport/generateReport?reportname=REPORT&doctype=PDF&param=%7B%22StartDate%22%3A%2220140604%22%2C%22EndDate%22%3A%2220140630%22%2C%22Range%22%3A%2210%22%7D

You are trying to send a JSON object via your Get Request.
You should try POST method.
For HTTP Client & Post Method, Check this link

Related

Request body is showing null in swagger [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 days ago.
Improve this question
I am doing post request and hitting the request in swagger but it is showing null in request body as well as in response body . Please enter image description hereassist me
Please refer images enter image description here

Method passes an incorrect number of parameters to an SLF4J or Logj2 logging statement [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
Sonar reports this bug: Correctness - Method passes an incorrect number of parameters to an SLF4J or Slf4j2 logging statement.
log.info("{}", e);
What should i do to fix it? Thanks
I think the correct way is the following code:
log.info("{}", e.getMessage());

how to solve SqlIntegrityConstraintViolationException? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
00000182 SystemOut O ==== Inside updateValidation exceptionStackTrace = com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=XHAZMAT1;000098D401, DRIVER=4.21.29
You can try checking for any SQL constraints like indexes with name - XHAZMAT1 on the table you are updating.
You can check for the SQL error message SQLERRMC in the console which is throwing update validation error. Seems like you are updating a record in database that is having any constraints related to indexes etc.
Also, you can look for XHAZMAT1 on the table you are updating.

Error with email address [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I am unable to find issue with the format of this mail id , this is supposed to be according to the regular expression mentioned below:gt.1586#mail.dabur
^(([\w-\.]+)#((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?))$
You could try with below regular expression:
^(([^<>()\[\]\\.,;:\s#"]+(\.[^<>()\[\]\\.,;:\s#"]+)*)|(".+"))#((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$
I hope this would help you.
Your problem is with the [a-zA-Z]{2,4} section. This is trying to match the dabur section but failing because you are limiting the match to up to 4 characters and there are 5 in dabur.
Domain names used to be limited to 3 letters after the . and you have 5. This is no longer a restriction.
You can use [a-zA-Z]{2,7} or something similar but you may be better off removing that restriction entirely with [a-zA-Z]+.

Remove line breaks in csv using java [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I need to check for line breaks in csv for every entry using java. I have no idea how to do it. Can anybody help? thanks!
Try this in your java source from which you are reading the csv.
String col = columnName.replaceAll("[\r\n]", "");
reportColumn.put( "column", col );

Categories

Resources