提问者:小点点

用户缺少权限或找不到对象:对象


我遵循了以下基本的Spring批量教程https://spring.io/guides/gs/batch-processing/ .

>

  • 我正在使用IntelliJ 14并创建了一个Spring批处理项目

    我在用Mavin。我还有pom。xml文件。

    Mvn clean install运行良好,即使应用程序。java告诉我“无法自动连线。找不到JdbcTemplate类型的bean”@Autowired JdbcTemplate JdbcTemplate;

    Spring配置有以下功能

        <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
    

    http://www.springframework.org/schema/beans/spring-beans.xsd"

    >

  • 当我尝试执行mvn spring-boot: run时,我收到一个错误

    原因由显示引起:org.hsqldb.HsqlException:用户缺乏权限或未找到对象:PEOLES

    我错过了什么?谢谢你的帮助。


  • 共2个答案

    匿名用户

    您应该在src/main/resources中设置模式初始化。Spring批处理自动运行schema-@@platform@@@。sql在启动期间,并且-all告诉它适用于所有平台,如自述中所述。github上的adoc

    接下来,您编写一个SQL脚本来创建一个表来存储数据。

    src/main/resources/schema all。sql

    链接:initial/src/main/resources/schema all。sql

    注意:Spring Boot运行架构-@@platform@@@。sql在启动期间自动执行-all是所有平台的默认值。

    匿名用户

    如果希望在没有数据库配置的情况下运行Spring批处理,那么可以使用

    @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
    

    更多细节可以在线程Spring Batch上找到,而无需将元数据持久化到数据库?