I have created datasource bean in xml file and used @Autowired to datasource. But getting datasource object value 'null'. Because of @Autowired is not woking in whole code,all objects created in code are null which throws nullPointerException. Here in java code passing dataSource to create object of SimpleJdbcCall to connect db but datasource value is null.so getting error java.lang.IllegalArgumentException: Property 'dataSource' is required.Annoted java class with @Component.
Asked
Active
Viewed 13 times
0
-
Java Code - @Component("activationStoredProcedure") public class ActivationStoredProcedure{ @Autowired @Qualifier("dataSource") DataSource dataSource; private SimpleJdbcCall simpleJdbcCall; simpleJdbcCall = new SimpleJdbcCall(dataSource); } – priya Dec 01 '21 at 08:21
-
The solution mentioned in ' Why is my Spring @Autowired field null? ' is not working. – priya Dec 01 '21 at 09:50