I am trying to use sql by the help of jstl but getting exception - jstl

enter image description here
HTTP Status 500 – Internal Server Error
Type Exception Report
Message /sql.jsp (line: [17], column: 1) According to TLD, tag [sql:setDataSource] must be empty, but is not
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.apache.jasper.JasperException: /sql.jsp (line: [17], column: 1) According to TLD, tag [sql:setDataSource] must be empty, but is not
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:292)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:98)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1652)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1016)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1291)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1470)
org.apache.jasper.compiler.Parser.parse(Parser.java:144)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:206)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:386)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:362)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:346)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:605)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:400)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Note The full stack trace of the root cause is available in the server logs.
Apache Tomcat/9.0.37

Related

Thymeleaf with springboot, error trying to check if list is empty now working

i'm trying to check if my list called listPersons is empty or not, but when i check i got an error like this:
Caused by: org.attoparser.ParseException: Exception evaluating
SpringEL expression: .... Caused by:
org.thymeleaf.exceptions.TemplateProcessingException: Exception
evaluating SpringEL expression: "#lists.isEmpty(listPersons"
(template: "index" - line 15, col 8)
I have tried this:
<h2 th:if="${#lists.isEmpty(listPersons)}">No hay personas</h2>
<div th:if="${#!lists.isEmpty(listPersons)}">
and this:
${listPersons.isEmpty()}
But none of the options are working. I'm using thymeleaf-3.0.15 and springboot version 2.7.2
In my Java method i have this line:
model.addAttribute("listPersons", personaService.getAll());
You are not using the conditional statements correctly, hence you are getting the SPEL error
<div th:if="${#!lists.isEmpty(listPersons)}">
Use the below for your condition
<div th:if="${not #lists.isEmpty(listPersons)}">
Refer https://www.thymeleaf.org/doc/tutorials/2.1/usingthymeleaf.html#conditional-evaluation
to get more insights.

What does mean the ElasticSearch exceptions: "all shards failed" and "No search context found for id"?

I'm working with ELS using the Scroll API and the following errors is persisting:
09:21:12.118] elastic-qlik-event-job [main] ERROR com.valemobi.ImportExportController - Não foi possivel recuperar pagina:
org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]
at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:177)
at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:1793)
at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:1770)
at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1527)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1484)
at
Suppressed: org.elasticsearch.client.ResponseException: method [POST], host [http://database.elasticsearch.*.prod:8088], URI [/_search/scroll], status line [HTTP/1.1 404 Not Found]
{"error":{"root_cause":[{"type":"search_context_missing_exception","reason":"No search context found for id [15068451]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":-1,"index":null,"reason":{"type":"search_context_missing_exception","reason":"No search context found for id [15068451]"}}],"caused_by":{"type":"search_context_missing_exception","reason":"No search context found for id [15068451]"}},"status":404}
at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:283)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:261)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:235)
at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1514)
... 15 common frames omitted
Caused by: org.elasticsearch.ElasticsearchException: Elasticsearch exception [type=search_context_missing_exception, reason=No search context found for id [15068451]]
at org.elasticsearch.ElasticsearchException.innerFromXContent(ElasticsearchException.java:496)
at org.elasticsearch.ElasticsearchException.fromXContent(ElasticsearchException.java:407)
at org.elasticsearch.ElasticsearchException.innerFromXContent(ElasticsearchException.java:437)
at org.elasticsearch.ElasticsearchException.failureFromXContent(ElasticsearchException.java:603)
at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:169)
... 18 common frames omitted
Does anybody have any idea what may be causing this and how do I fix it?

i cant find why missing comma errors in mapper

Mapper Query:
insert into w_carinfo values(car_number=#{car_number}, company=#{company},
car_model=#{car_model}, color=#{color}, fuel=#{fuel}, gear=#{gear}, price=#{price},
user_name=#{user_name}, location=#{location}, type=#{type}, driving=#{driving}, made_date=#{made_date})
Error:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:
Error updating database. Cause: java.sql.SQLSyntaxErrorException: ORA-00917: missing comma
The error may involve mapper.myMapper.putCarInfo-Inline
The error occurred while setting parameters
SQL: insert into w_carinfo values(car_number=?, company=?, car_model=?, color=?, fuel=?, gear=?, price=?, user_name=?, location=?, type=?, driving=?, made_date=?)
Cause: java.sql.SQLSyntaxErrorException: ORA-00917: missing comma
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00917: missing comma
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:948)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

Illegal 'sec-websocket-protocol' header: Invalid input 'EOI', expected sec-websocket-protocol

I'm trying to connect on Kubernetes websocket API but I get this error message:
java.lang.IllegalStateException: Message failed with status code 400 Bad Request; Error info: ErrorInfo(Illegal 'sec-websocket-protocol' header: Invalid input 'EOI', expected sec-websocket-protocol (line 1, column 1),
^)
at akka.http.impl.engine.ws.WebSocketClientBlueprint$UpgradeStage$1$$anon$1.onPush(WebSocketClientBlueprint.scala:107)
at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:747)
at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:649)
at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:471)
at akka.stream.impl.fusing.GraphInterpreterShell.receive(ActorGraphInterpreter.scala:410)
at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:603)
at akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:618)
at akka.actor.Actor.aroundReceive(Actor.scala:502)
at akka.actor.Actor.aroundReceive$(Actor.scala:500)
at akka.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:529)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
at akka.actor.ActorCell.invoke(ActorCell.scala:495)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
at akka.dispatch.Mailbox.run(Mailbox.scala:224)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
I must be missing some configuration, do you knwo where this comes from?
Cheers
Got over it by defining subprotocol to channel.k8s.io:
WebSocketRequest(
uri,
extraHeaders = List(token),
subprotocol = Option("channel.k8s.io")
)

When I am sending get method request in jmeter its giving me an error java.net.URISyntaxException: Illegal character in path at index

When I am sending GET method request in jmeter its giving me an error
Response:
java.net.URISyntaxException: Illegal character in path at index 63: http://52.30.181.28:9000/PlatformServices/api/v2.0/kartCharges/{"pincode":560001,"gatewayPaymentMode":"NA","kartInfo":[{"sellerId":"S10014","qty":30,"unitPrice":1999,"sku":"SKU0100"}]}
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.checkChars(URI.java:3021)
at java.net.URI$Parser.parseHierarchical(URI.java:3105)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.<init>(URI.java:588)
at java.net.URL.toURI(URL.java:939)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:286)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1146)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1135)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)
at java.lang.Thread.run(Thread.java:745)
Request:
GET http://52.30.181.28:9000/PlatformServices/api/v2.0/kartCharges/{"pincode":560001,"gatewayPaymentMode":"NA","kartInfo":[{"sellerId":"S10014","qty":30,"unitPrice":1999,"sku":"SKU0100"}]}
[no cookies]
Your request body is in json format.
So in HTTP Header Manager add content-type as application/json.
Then put below part in url:
http://52.30.181.28:9000/PlatformServices/api/v2.0/kartCharges/
And put rest in body part.
={"pincode":560001,"gatewayPaymentMode":"NA","kartInfo":[{"sellerId":"S10014","qty":30,"unitPrice":1999,"sku":"SKU0100"}]}

Resources