Tag Archives: 【Spring】

Batch error reporting in Java spring

1、 Questions

Error in starting batch task:

ERROR [com.alibaba.druid.pool.DruidDataSource]
 - {dataSource-1} init error java.sql.SQLException: oracle.jdbc.OracleDriver

2、 Solution

1. The reason is that I don’t have the jar package driven by JDBC, so I found a few on the Internet and asked me to download Ojdbc14 or ojdbc7. 14 is finished, but it’s useless. Ojdbc7 is the wrong version. Later, I opened the library and found that there are problems with both downloads;

You can only delete these invalid jar packages, and then find a JDBC 6 jar package to put on. The result is OK;

No matching editors or conversion strategy found

1、 Questions

Recently, I’ve been building the batch framework of spring, and frequent errors have been reported. It’s a trip to the pit;

Cannot convert value of type 'java.lang.String' to 
required type 'javax.sql.DataSource' for property 'dataSource': 
no matching editors or conversion strategy found

2、 Solution

The reason is that [ref] is wrongly written as [value] in the XML configuration of persistence layer;

[spring] springboot failed to install cli, unsupportclassversionerror 52.0

1、 Error information

Install springboot cli yesterday:
1. Download and unzip it directly from the official website;
2. Add the bin directory absolute path of the unzipped folder to the environment variable path;
3. Enter “ spring -- version " in the CMD to verify whether the installation is successful;

However, an error was reported during verification. The error information is as follows:

UnsupportClassVersionError:org/springframework/boot/loader/JarLauncher:Unsupporyed major.minor version 52.0
......
Could not find the main class

2、 Solutions

2.1. You need to set the JDK version

2.2. There are two ways to modify the language level, one is to click project structure, which is the button in the upper right corner of idea;

Modify JDK version and language level in project:

Modify the language level in modules:

3、 Results

Then there is no problem

[Java] spring transaction control configuration error, application- persstence.xml Transaction manager report red in file

A, problem,
When configuring the Spring persistence layer XML configuration file, < tx:annotation-driven> ansaction-manager a>bute is always red, obviously there is a problem;

Second, the solution
1. Simply add to the configuration file:

xmlns:tx="
http://www.springframework.org/schema/cache"
xmlns:tx="http://www.springframework.org/schema/tx"

Configuration information;


=
=
=
=