org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchDatabaseInitializer': Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.CannotReadScriptException: Cannot read SQL script from class path resource [org/springframework/batch/core/schema-h2.sql ]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/batch/core/schema-h2.sql ] cannot be opened because it does not exist

GitHub | zhongyang0316 | 3 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to poroszd . Or join the community to write better ones.
  1. 0
    samebug tip
    You need to deploy aspectJ (aspectjweaver.jar) together with your application. Add it to your pom.xml
  2. 0

    Spring Boot: Unable to start embeded container

    Stack Overflow | 10 months ago | Kamil Potoczny
    org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
  3. 0

    App only works after Tomcat restart

    Stack Overflow | 1 year ago | user3227576
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'broker': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/NestedRuntimeException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Exception while running Spring boot cassandra project

    Stack Overflow | 1 year ago | ak123
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'session' defined in class path resource [org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfiguration.class]: Invocation of init method failed; nested exception is com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table schema_keyspaces))
  6. 0

    Exception while running Spring boot cassandra project - heapoverflow.me

    heapoverflow.me | 12 months ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'session' defined in class path resource [org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfiguration.class]: Invocation of init method failed; nested exception is com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table schema_keyspaces))
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.io.FileNotFoundException

    class path resource [org/springframework/batch/core/schema-h2.sql ] cannot be opened because it does not exist

    at org.springframework.core.io.ClassPathResource.getInputStream()
  2. Spring Core
    EncodedResource.getReader
    1. org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172)[spring-core-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    2. org.springframework.core.io.support.EncodedResource.getReader(EncodedResource.java:140)[spring-core-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    2 frames
  3. org.springframework.jdbc
    DatabasePopulatorUtils.execute
    1. org.springframework.jdbc.datasource.init.ScriptUtils.readScript(ScriptUtils.java:281)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    2. org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript(ScriptUtils.java:450)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    3. org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.populate(ResourceDatabasePopulator.java:231)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    4. org.springframework.jdbc.datasource.init.DatabasePopulatorUtils.execute(DatabasePopulatorUtils.java:48)[spring-jdbc-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    4 frames
  4. Spring Boot AutoConfigure
    BatchDatabaseInitializer.initialize
    1. org.springframework.boot.autoconfigure.batch.BatchDatabaseInitializer.initialize(BatchDatabaseInitializer.java:65)[spring-boot-autoconfigure-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    1 frame
  5. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0]
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0]
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0]
    4. java.lang.reflect.Method.invoke(Method.java:483)[na:1.8.0]
    4 frames
  6. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:365)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    2. org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:310)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    3. org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    8. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    9. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    10. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    11. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    12. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:776)[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    12 frames
  7. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    2 frames
  8. Spring Boot
    SpringApplication.run
    1. org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    2. org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    3. org.springframework.boot.SpringApplication.run(SpringApplication.java:313)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    4. org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    5. org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)[spring-boot-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    5 frames
  9. org.csii.batch
    BatchServiceApplication.main
    1. org.csii.batch.service.BatchServiceApplication.main(BatchServiceApplication.java:20)[classes/:na]
    1 frame
  10. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0]
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0]
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0]
    4. java.lang.reflect.Method.invoke(Method.java:483)[na:1.8.0]
    4 frames
  11. org.springframework.boot
    RestartLauncher.run
    1. org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)[spring-boot-devtools-1.4.0.RELEASE.jar:1.4.0.RELEASE]
    1 frame