我尝试构建并运行 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 版本的注册表。
如何建立注册表没有错误?我忘记了什么吗?
谢谢,丹尼斯