首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JHipster测试:禁用二级缓存时的NoCacheRegionFactoryAvailableException

JHipster测试:禁用二级缓存时的NoCacheRegionFactoryAvailableException
EN

Stack Overflow用户
提问于 2016-06-20 22:59:03
回答 1查看 225关注 0票数 0

当我使用jhipster生成一个应用程序时,我禁用了二级缓存。但是,当我运行"gradle test“或"run as junit test”来测试应用程序时,它失败了,因为"NoCacheRegionFactoryAvailableException“。我已经检查了目录“src/test/ application.yml /config”中的资源,并确保禁用了第二个缓存。我不知道为什么应用程序还在寻找二级缓存。有线索知道这是怎么发生的吗?或者如何完全禁用二级缓存?

除了测试失败之外,其他一切都运行得很好,应用程序可以成功运行。

src/ application.yml /resources/config中的资源

代码语言:javascript
复制
spring:
    application:
        name: EMS
    datasource:
        url: jdbc:h2:mem:EMS;DB_CLOSE_DELAY=-1
        name:
        username:
        password:
    jpa:
        database-platform: com.espion.ems.domain.util.FixedH2Dialect
        database: H2
        open-in-view: false
        show_sql: true
        hibernate:
            ddl-auto: none
            naming-strategy: org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy
        properties:
            hibernate.cache.use_second_level_cache: false
            hibernate.cache.use_query_cache: false
            hibernate.generate_statistics: true
            hibernate.hbm2ddl.auto: validate
    data:
        elasticsearch:
            cluster-name:
            cluster-nodes:
            properties:
                path:
                  logs: target/elasticsearch/log
                  data: target/elasticsearch/data
    mail:
        host: localhost
    mvc:
        favicon:
            enabled: false
    thymeleaf:
        mode: XHTML
liquibase:
    contexts: test

security:
    basic:
        enabled: false

server:
    port: 10344
    address: localhost

jhipster:
    async:
        corePoolSize: 2
        maxPoolSize: 50
        queueCapacity: 10000
    security:
        rememberMe:
            # security key (this key should be unique for your application, and kept secret)
            key: jhfasdhflasdhfasdkfhasdjkf
    metrics: # DropWizard Metrics configuration, used by MetricsConfiguration
        jmx.enabled: true
    swagger:
        title: EMS API
        description: EMS API documentation
        version: 0.0.1
        termsOfServiceUrl:
        contactName:
        contactUrl:
        contactEmail:
        license:
        licenseUrl:
        enabled: false
EN

回答 1

Stack Overflow用户

发布于 2016-11-04 09:54:18

src/test/resources/config/application.yml移至src/test/resources目录。

您可以在https://github.com/jhipster/generator-jhipster/issues/3730中找到该解决方案

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37925705

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档