当前位置:网站首页>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
边栏推荐
- Blocking of concurrency control
- Analysis of the problem that the cookie value in PHP contains a plus sign (+) and becomes a space
- Some tutorials install the database on ubantu so as not to occupy computer memory?
- [error record] file search strategy in groovy project (src/main/groovy/script.groovy needs to be used in the main function | groovy script directly uses the relative path of code)
- Postman core function analysis - parameterization and test report
- Interview questions for famous enterprises: Coins represent a given value
- 数博会精彩回顾 | 彰显科研实力,中创算力荣获数字化影响力企业奖
- Oracle triggers
- Win11缺少dll文件怎么办?Win11系统找不到dll文件修复方法
- 元宇宙中的三大“派系”
猜你喜欢
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
Recovery technology with checkpoints
Pl/sql basic syntax
Concurrency control of performance tuning methodology
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
Implementation technology of recovery
How can Bluetooth in notebook computer be used to connect headphones
CA certificate trampled pit
Cobaltstrike builds an intranet tunnel
Win11 runs CMD to prompt the solution of "the requested operation needs to be promoted"
随机推荐
Golang writes the opening chapter of selenium framework
[Chongqing Guangdong education] National Open University autumn 2018 0088-21t Insurance Introduction reference questions
thinkphp5.1跨域问题解决
Microservice link risk analysis
Oracle hint understanding
Database tuning solution
Draw a red lantern with MATLAB
What if the files on the USB flash disk cannot be deleted? Win11 unable to delete U disk file solution tutorial
Overview of database recovery
Promql demo service
Index optimization of performance tuning methodology
Platform bus
How to add new fields to mongodb with code (all)
The countdown to the launch of metaverse ape is hot
Postman core function analysis - parameterization and test report
Blocking of concurrency control
Lightweight dynamic monitorable thread pool based on configuration center - dynamictp
Metaverse Ape获Negentropy Capital种子轮融资350万美元
Analyse des risques liés aux liaisons de microservices
[groovy] mop meta object protocol and meta programming (Introduction to groovyobject interface | introduction to metaclass | implementation of class methods using groovyobject invokemethod)