Включена зависимость com.intuit.karate, вызывающая ошибку contextRoner SpringRunner - PullRequest
2 голосов
/ 17 мая 2019

Mac Mojave 10.14.4
при запуске этой команды maven

mvn clean install   

Я использую Spring Boot 2.1.5-Release и имею простой тест contextLoad, который завершается неудачно, как только я включаю конкретную версию com.intuit.karate 0.9.2 в качестве зависимости в pom.xml, как только Я включил эту версию (0.9.2), чтобы я мог разрабатывать тесты вокруг нее, существующий Тест не проходит

   <dependency>
        <groupId>com.intuit.karate</groupId>
        <artifactId>karate-apache</artifactId>
        <version>0.9.2</version>
        <scope>test</scope>
    </dependency>
    <!-- karate test deps -->
    <dependency>
        <groupId>com.intuit.karate</groupId>
        <artifactId>karate-junit5</artifactId>
        <version>0.9.2</version>
        <scope>test</scope>
    </dependency>

Я опустился до версии 0.9.1, и проблема исчезла. Также, изменив файл pom.xml, чтобы исключить его, работает также

    <dependency>
        <groupId>com.intuit.karate</groupId>
        <artifactId>karate-apache</artifactId>
        <version>0.9.2</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-controls</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <!-- karate test deps -->
    <dependency>
        <groupId>com.intuit.karate</groupId>
        <artifactId>karate-junit5</artifactId>
        <version>0.9.2</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-controls</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

Кажется, что оно сужено до этого транзитивного включения зависимостей, которое, когда исключено, позволяет ему нормально работать. Я не вижу каких-либо отношений, которые могли бы привести к сбою в тесте SpringRunner, если только он не находится в файлах libXXX.dylib

      <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-controls</artifactId>
        <version>12-ea+9</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-graphics</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
@RunWith(SpringRunner.class)
@SpringBootTest
public class JugToursApplicationTests {

    @Test
    public void contextLoads() {
    }
}

Журналы:

    2019-05-17 13:14:50.311  INFO 2885 --- [           main] c.s.e.s.JugToursApplicationTests         : Starting JugToursApplicationTests on svuslp00099.local with PID 2885 (started by chesterpressler in /Users/chesterpressler/development/spring-react)
    2019-05-17 13:14:50.314  INFO 2885 --- [           main] c.s.e.s.JugToursApplicationTests         : No active profile set, falling back to default profiles: default
    2019-05-17 13:14:51.766  INFO 2885 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
    2019-05-17 13:14:51.842  INFO 2885 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 65ms. Found 2 repository interfaces.
    2019-05-17 13:14:52.403  INFO 2885 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$e99c3d5a] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2019-05-17 13:14:52.757  INFO 2885 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
    2019-05-17 13:14:53.008  INFO 2885 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
    2019-05-17 13:14:53.098  INFO 2885 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
            name: default
            ...]
    2019-05-17 13:14:53.171  INFO 2885 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate Core {5.3.10.Final}
    2019-05-17 13:14:53.174  INFO 2885 --- [           main] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
    2019-05-17 13:14:53.428  INFO 2885 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
    2019-05-17 13:14:53.587  INFO 2885 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
    2019-05-17 13:14:53.964  WARN 2885 --- [           main] o.s.w.c.s.GenericWebApplicationContext   : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.cfg.beanvalidation.IntegrationException: Error activating Bean Validation integration
    2019-05-17 13:14:53.965  INFO 2885 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
    2019-05-17 13:14:53.970  INFO 2885 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
    2019-05-17 13:14:53.986  INFO 2885 --- [           main] ConditionEvaluationReportLoggingListener : 

    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
    2019-05-17 13:14:54.000 ERROR 2885 --- [           main] o.s.boot.SpringApplication               : Application run failed

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.cfg.beanvalidation.IntegrationException: Error activating Bean Validation integration
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE]
            at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
            at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
            at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
            at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:127) [spring-boot-test-2.1.5.RELEASE.jar:2.1.5.RELEASE]
            at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99) [spring-test-5.1.7.RELEASE.jar:5.1.7.RELEASE]

1 Ответ

1 голос
/ 18 мая 2019

Хорошо, с вашим отчетом ясно, что у нас есть странная проблема с зависимостями JavaFX и Spring / Boot.

Мы открыли тикет: https://github.com/intuit/karate/issues/780

Спасибо за информацию об исключении. Если вы сможете создать минимальный быстрый запуск, который может воспроизвести это (и указать вашу версию JDK), это поможет.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...