While running Spring batch from CommandLineJobRunner datasource Driver class not identifying Iam using the command java -jar .\batchsample-0.0.1.jar JobClass JobName If i remove main-class property from bootJar then jar is running like spring boot application. No errors

Error creating bean with name 'org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration': Unsatisfied dependency expressed through field 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class

Comment From: wilkinsona

Without knowing how you've built the jar file, I don't think we can figure out for certain why this isn't working. If you're trying to use a Spring Boot fat jar and you've customized the Main-Class attribute in the manifest, Spring Boot's launcher won't be adding everything in BOOT-INF/lib to the classpath. However, if that were the case I'd expect to see a failure occur earlier than the one that you're apparently seeing. If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

Comment From: padamatavijji

Yes I am doing the spring boot fat jar and customized the main-class attribute in manifest.
As you said spring boot not adding driver classes. How to overcome this is there any way to execute spring boot with spring batch command line runner. ``` bootJar { archiveBaseName = rootProject.name.toLowerCase().replaceAll(' ', '-') archiveVersion = "$allprojects.version" mainClass= "org.springframework.batch.core.launch.support.CommandLineJobRunner" }

Comment From: wilkinsona

@padamatavijji That's still not enough for us to be able to help you. As I said above, if you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.