JHipster注册表:构建错误

时间:2018-02-16 16:58:54

标签: jhipster-registry

我尝试构建并运行jhipster注册表,但是我收到错误:

mvn package -Pprod

我在测试中遇到以下错误:

Tests in error: 
  SwaggerBasePathRewritingFilterTest.<init>:20 »  Unresolved compilation problem...
  SwaggerBasePathRewritingFilterTest.<init>:20 »  Unresolved compilation problem...
  SwaggerBasePathRewritingFilterTest.<init>:20 »  Unresolved compilation problem...
  SwaggerBasePathRewritingFilterTest.<init>:20 »  Unresolved compilation problem...
  AccountResourceTest.setup:33 » NoClassDefFound HttpServletRequest
  AccountResourceTest.setup:33 » NoClassDefFound HttpServletRequest
  AccountResourceTest.setup:33 » NoClassDefFound HttpServletRequest
  AccountResourceTest.setup:33 » NoClassDefFound HttpServletRequest
  UserJWTControllerTest.setup:39 » NoClassDefFound HttpServletResponse
  UserJWTControllerTest.setup:39 » NoClassDefFound HttpServletResponse
  UserJWTControllerTest.setup:39 » NoClassDefFound HttpServletResponse
  ExceptionTranslatorTest.setup:37 » NoClassDefFound HttpServletRequest
  ExceptionTranslatorTest.setup:37 » NoClassDefFound HttpServletRequest
  ExceptionTranslatorTest.setup:37 » NoClassDefFound HttpServletRequest
  ExceptionTranslatorTest.setup:37 » NoClassDefFound HttpServletRequest
  ExceptionTranslatorTest.setup:37 » NoClassDefFound HttpServletRequest

如果我跳过测试,构建就可以了,但是当我启动时遇到了同样的错误:

./mvnw -Pdev

2018-02-16 17:52:22.011  WARN 5354 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'undertowEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedUndertow.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webConfigurer' defined in file [/home/denis/ngworkspace/jhipster-registry/target/classes/io/github/jhipster/registry/config/WebConfigurer.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.github.jhipster.registry.config.WebConfigurer$$EnhancerBySpringCGLIB$$a8d0938a]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: 
        The import io.undertow.UndertowOptions cannot be resolved
        ServletContext cannot be resolved to a type
        ServletException cannot be resolved to a type
        DispatcherType cannot be resolved to a type
        DispatcherType cannot be resolved to a variable
        DispatcherType cannot be resolved to a variable
        DispatcherType cannot be resolved to a variable
        The type io.undertow.Undertow$Builder cannot be resolved. It is indirectly referenced from required .class files
        This lambda expression refers to the missing type Undertow$Builder
        UndertowOptions cannot be resolved to a variable
        ServletContext cannot be resolved to a type
        DispatcherType cannot be resolved to a type
        FilterRegistration cannot be resolved to a type
        ServletContext cannot be resolved to a type
        DispatcherType cannot be resolved to a type
        FilterRegistration cannot be resolved to a type
        ServletRegistration cannot be resolved to a type

2018-02-16 17:52:22.032 ERROR 5354 --- [  restartedMain] o.s.boot.SpringApplication               : Application startup failed

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'undertowEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedUndertow.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webConfigurer' defined in file [/home/denis/ngworkspace/jhipster-registry/target/classes/io/github/jhipster/registry/config/WebConfigurer.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.github.jhipster.registry.config.WebConfigurer$$EnhancerBySpringCGLIB$$a8d0938a]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: 
        The import io.undertow.UndertowOptions cannot be resolved
        ServletContext cannot be resolved to a type
        ServletException cannot be resolved to a type
...

奇怪的是,当我执行

mvn clean package -Pprod

构建没问题,但它没有启动(同样的错误)。

我在Linux上使用从github克隆的3.2.4版中的注册表。

如何构建注册表而不会出错?我忘了什么吗?

谢谢,丹尼斯

3 个答案:

答案 0 :(得分:11)

我找到了解决方案。我在pom.xml中添加了这些依赖项:

;WITH years
   AS (
        SELECT COMPANYID, MARKETID, INDUSTRY, YEAR_ATTENDED = Year(attdate)
          FROM v_marketatt
          WHERE MARKETID IN (835, 1032, 1101)
           AND MARKETCODE LIKE 'SM1%' -- not sure about this one, the example isn't very clear
         GROUP BY COMPANYID, MARKETID, INDUSTRY, Year(attdate)
       ),
     last_ones
  AS (
        SELECT row_nbr = ROW_NUMBER() OVER ( PARTITION BY  COMPANYID, MARKETID, INDUSTRY ORDER BY YEAR_ATTENDED DESC),
               COMPANYID, MARKETID, INDUSTRY, 
               LAST_YEAR_ATTENDED = YEAR_ATTENDED,
               PREV_YEAR_ATTENDED = LEAD(YEAR_ATTENDED, 1, NULL) OVER (PARTITION BY COMPANYID, MARKETID, INDUSTRY ORDER BY YEAR_ATTENDED DESC)
          FROM years
     )

SELECT COMPANYID, MARKETID, INDUSTRY, 
      LAST_YEAR_ATTENDED,
      PREV_YEAR_ATTENDED
 FROM last_ones
WHERE row_nbr = 1

所有工作。然而,这些依赖关系是传递性的,我不知道为什么我必须明确添加。有人有回应吗?

丹尼斯

答案 1 :(得分:2)

如果您正在使用Eclipse运行: 在Eclipse中,选择“项目属性”->“ Maven”->“活动Maven概要文件”(以逗号分隔),然后将其设置为dev 这会触发项目的Maven更新,并且一切都会编译 无需将依赖项放入pom

答案 2 :(得分:0)

那是工作

var previousTime;
myPlayer.controlBar.progressControl.on('mousedown', function(event) {
  console.log("previous: " + previousTime + " current:" + myPlayer.currentTime());
});

myPlayer.on("timeupdate", function(e) {
  previousTime = myPlayer.currentTime();
});

@Atatorus