Solution to java.lang.IllegalArgumentException: Property’dataSource’ is required

java.lang.IllegalArgumentException: Property’dataSource’ is required 

When I was working on a travel website today, I encountered an exception. The console showed that there was an error when creating the JdbcTemplate object. After inspection, it was found that the code in the custom JDBCUtils tool class
InputStream is = JDBCUtils.class.getClassLoader( ).getResourceAsStream(“druid.properties”);
Add one more / to the configuration file path inside, just remove /; or the durid.properties file is placed in the wrong location, the correct one is to put it in the src directory, not The directory of the project.


Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *