当前位置:网站首页>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
边栏推荐
- What if win11 is missing a DLL file? Win11 system cannot find DLL file repair method
- Depth first DFS and breadth first BFS -- traversing adjacency tables
- Technology cloud report won the special contribution award for the 10th anniversary of 2013-2022 of the "cloud Ding Award" of the global cloud computing conference
- "Chris Richardson microservices series" uses API gateway to build microservices
- Comment développer un plug - in d'applet
- Metaverse Ape上线倒计时,推荐活动火爆进行
- Recovery technology with checkpoints
- Solutions for unexplained downtime of MySQL services
- Microservice link risk analysis
- How can Bluetooth in notebook computer be used to connect headphones
猜你喜欢
南京:全面启用商品房买卖电子合同
Distance entre les points et les lignes
MySQL服务莫名宕机的解决方案
Overview of database recovery
700. Search in a Binary Search Tree. Sol
The difference between MVVM and MVC
Wonderful review of the digital Expo | highlight scientific research strength, and Zhongchuang computing power won the digital influence enterprise award
A trip to Suzhou during the Dragon Boat Festival holiday
IIC bus realizes client device
Opencv judgment points are inside and outside the polygon
随机推荐
Interprocess communication in the "Chris Richardson microservice series" microservice architecture
[groovy] mop meta object protocol and meta programming (Introduction to groovyobject interface | introduction to metaclass | implementation of class methods using groovyobject invokemethod)
What if the files on the USB flash disk cannot be deleted? Win11 unable to delete U disk file solution tutorial
Nacos installation and service registration
南京:全面启用商品房买卖电子合同
Analysis of the problem that the cookie value in PHP contains a plus sign (+) and becomes a space
Implementing Lmax disruptor queue from scratch (IV) principle analysis of multithreaded producer multiproducersequencer
Business learning of mall commodity module
Calculation method of boundary IOU
Overview of database recovery
700. Search in a Binary Search Tree. Sol
The statistics of leetcode simple question is the public string that has appeared once
Oracle hint understanding
航海日答题小程序之航海知识竞赛初赛
Search: Future Vision (moving sword)
Kubernetes Administrator certification (CKA) exam notes (IV)
如何开发引入小程序插件
实战:fabric 用户证书吊销操作流程
a-tree 树的全部展开和收起
Distance from point to line intersection and included angle of line