当前位置:网站首页>Record several frequently asked questions (202207)
Record several frequently asked questions (202207)
2022-07-05 22:25:00 【zhangbeizhen18】
Record :282
scene : Several common questions :
Java Code execution SQL Statement causes the thread to get stuck , No more execution .
CLIENT_PUGIN_AUTH is required.
Communications link failure.
java.lang.ClassNotFoundException.
edition :Spring Boot 2.6.3
One 、 Case scenario
1.Java Code execution SQL Statement causes the thread to get stuck , No more execution
problem :Java Thread pool 10 Threads , Concurrent in Oracle Table of database T_DEMO Implementation UPDATE sentence . however 10 All threads are stuck , This leads to the accumulation of tasks , and try catch No exceptions were caught .
reason :Oracle Table of database T_DEMO, stay PL/SQL The client executes on the whole table FOR UPDATE Lock the watch , Not submit . Lead to Java The code is executing UPDATE When the sentence is , Cannot get database table operation , Been waiting . And no exception is thrown .
solve : Set the timeout in the data source class , for example .
DruidDataSource dataSource = new DruidDataSource();
dataSource.setQueryTimeout(60);
The phenomenon : Overtime , It throws an exception .
Caused by: java.sql.SQLTimeoutException: ORA-01013: The user requested to cancel the current operation
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:630)
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:564)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1151)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:771)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:299)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:498)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:152)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1052)
at oracle.jdbc.driver.OracleStatement.executeSQLStatement(OracleStatement.java:1531)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1311)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3746)
at oracle.jdbc.driver.OraclePreparedStatement.executeLargeUpdate(OraclePreparedStatement.java:3918)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3897)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:992)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeUpdate(DruidPooledPreparedStatement.java:255)
at org.springframework.jdbc.core.JdbcTemplate.lambda$update$2(JdbcTemplate.java:965)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:651)
... 9 more
Caused by: Error : 1013, Position : 0,......
2. Report errors :CLIENT_PUGIN_AUTH is required
Report errors :java.sql.SQLNontransientConnectionException: CLIENT_PUGIN_AUTH is required
reason : In this case MySQL The database version is 5.6.29, And in the pom.xml Introduced in 8.0.23 drive
solve :MySQL Drive reduced version .
2.1 pom.xml change
Higher version :
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>>8.0.23</version>
</dependency>
Changed to: :
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.49</version>
</dependency>
2.2 application.yml change
MySQL Drive class :
Higher version :
com.mysql.cj.jdbc.Driver
Changed to: :
com.mysql.jdbc.Driver
3. Report errors :404 Not Found: [no body]
Report errors :
org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [no body]
at org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:113)
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:168)
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:122)
at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63)
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:819)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:777)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711)
at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:437)
solve : This example is the server of access Controller The way of doing this has changed , Re determine the server access path .
4. Report errors :Communications link failure
Report errors :
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure.
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
solve : The database connection information is incorrect .
5. Report errors :ClassNotFoundException
Report errors :
Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpSessionIdListener
reason :
be based on Spring Boot 2.6.3 Of web engineering :
stay Tomcat 7 Of servlet-api.java There is no HttpSessionIdListener.
stay Tomcat 8 Of javax.servlet-api-4.0.1.jar There is HttpSessionIdListener.
solve :war The package deployment environment is changed to Tomcat 8.
above , thank .
2022 year 7 month 4 Japan
边栏推荐
- C language - structural basis
- Go language learning tutorial (XV)
- Livelocks and deadlocks of concurrency control
- What about data leakage? " Watson k'7 moves to eliminate security threats
- 2022-07-05: given an array, you want to query the maximum value in any range at any time. If it is only established according to the initial array and has not been modified in the future, the RMQ meth
- U盘的文件无法删除文件怎么办?Win11无法删除U盘文件解决教程
- Performance testing of software testing
- Implementation technology of recovery
- How to create a thread
- 微服務鏈路風險分析
猜你喜欢
boundary IoU 的计算方式
Oracle advanced query
CA certificate trampled pit
Calculation method of boundary IOU
Post-90s tester: "after joining Ali, this time, I decided not to change jobs."
Metaverse ape ape community was invited to attend the 2022 Guangdong Hong Kong Macao Great Bay metauniverse and Web3.0 theme summit to share the evolution of ape community civilization from technology
Technology cloud report: how many hurdles does the computing power network need to cross?
Nacos 的安装与服务的注册
What about data leakage? " Watson k'7 moves to eliminate security threats
IIC bus realizes client device
随机推荐
2022 Software Test Engineer salary increase strategy, how to reach 30K in three years
Alternating merging strings of leetcode simple questions
Win11缺少dll文件怎么办?Win11系统找不到dll文件修复方法
Serializability of concurrent scheduling
What if the files on the USB flash disk cannot be deleted? Win11 unable to delete U disk file solution tutorial
科技云报道:算力网络,还需跨越几道坎?
[error record] groovy function parameter dynamic type error (guess: groovy.lang.missingmethodexception: no signature of method)
How to develop and introduce applet plug-ins
等到产业互联网时代真正发展成熟,我们将会看待一系列的新产业巨头的出现
Understand the basic concept of datastore in Android kotlin and why SharedPreferences should be stopped in Android
Postman核心功能解析-参数化和测试报告
Official clarification statement of Jihu company
344. Reverse String. Sol
Comment développer un plug - in d'applet
南京:全面启用商品房买卖电子合同
QT creator 7 beta release
What if win11 is missing a DLL file? Win11 system cannot find DLL file repair method
Nacos installation and service registration
The simple problem of leetcode is to split a string into several groups of length K
Leetcode simple question: the minimum cost of buying candy at a discount