我使用JHipster生成微服务项目(uaa)。 安装后,我无法构建项目。
我尝试更改Java版本:
jdk1.8.0_211
jdk-10.0.2
java-1.11.0-openjdk-amd64
我的Maven版本
=> mvn -version
Apache Maven 3.6.0
使用了不同的JHipster版本:
6.0.1
6.0.0
5.8.2
Nodejs(我使用LTS,但之前使用过12个)
=>节点-v v10.15.2
Npm
=> npm -v
5.8.0
我的操作系统
Debian。
=> ./mvnw
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.mycompany.myapp:uaa >-----------------------
[INFO] Building Uaa 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.1.4.RELEASE:run (default-cli) > test-compile @ uaa >>>
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:copy-resources (default-resources) @ uaa ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO] Copying 13 resources
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ uaa ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO] Copying 13 resources
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-versions) @ uaa ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.3:prepare-agent (pre-unit-tests) @ uaa ---
[INFO] argLine set to -javaagent:/home/coder/.m2/repository/org/jacoco/org.jacoco.agent/0.8.3/org.jacoco.agent-0.8.3-runtime.jar=destfile=/home/coder/Desktop/jhipapp/uaa/target/jacoco/test.exec -Djava.security.egd=file:/dev/./urandom -Xmx256m
[INFO]
[INFO] --- properties-maven-plugin:1.0.0:read-project-properties (default) @ uaa ---
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ uaa ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 66 source files to /home/coder/Desktop/jhipapp/uaa/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ uaa ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ uaa ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 19 source files to /home/coder/Desktop/jhipapp/uaa/target/test-classes
[INFO]
[INFO] <<< spring-boot-maven-plugin:2.1.4.RELEASE:run (default-cli) < test-compile @ uaa <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:2.1.4.RELEASE:run (default-cli) @ uaa ---
[INFO] Attaching agents: []
The Class-Path manifest attribute in /home/coder/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jaxb-runtime-2.3.2.jar referenced one or more files that do not exist: file:/home/coder/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.xml.bind-api-2.3.2.jar,file:/home/coder/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/txw2-2.3.2.jar,file:/home/coder/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/istack-commons-runtime-3.0.8.jar,file:/home/coder/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/stax-ex-1.8.1.jar,file:/home/coder/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/FastInfoset-1.2.16.jar,file:/home/coder/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.activation-api-1.2.1.jar
??? ??? ??? ????????? ???????? ??????? ????????? ????????? ????????
??? ??? ??? ????????? ????????? ???????? ????????? ????????? ?????????
??? ????????? ??? ????????? ??????? ??? ??????? ?????????
??? ??? ????????? ??? ???????? ??????? ??? ??????? ????????
????????? ??? ??? ????????? ??? ???????? ??? ????????? ??? ????
??????? ??? ??? ????????? ??? ??????? ??? ????????? ??? ???
:: JHipster ? :: Running Spring Boot 2.1.4.RELEASE ::
:: https://www.jhipster.tech ::
2019-05-12 00:48:57.049 WARN 29889 --- [ restartedMain] o.s.c.c.c.ConsulPropertySourceLocator : Unable to load consul config from config/uaa-swagger/
com.ecwid.consul.transport.TransportException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:8500 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)
at com.ecwid.consul.transport.AbstractHttpTransport.executeRequest(AbstractHttpTransport.java:77)
at com.ecwid.consul.transport.AbstractHttpTransport.makeGetRequest(AbstractHttpTransport.java:34)
at com.ecwid.consul.v1.ConsulRawClient.makeGetRequest(ConsulRawClient.java:128)
at com.ecwid.consul.v1.kv.KeyValueConsulClient.getKVValues(KeyValueConsulClient.java:150)
at com.ecwid.consul.v1.ConsulClient.getKVValues(ConsulClient.java:534)
at org.springframework.cloud.consul.config.ConsulPropertySource.init(ConsulPropertySource.java:67)
at org.springframework.cloud.consul.config.ConsulPropertySourceLocator.create(ConsulPropertySourceLocator.java:179)
at org.springframework.cloud.consul.config.ConsulPropertySourceLocator.locate(ConsulPropertySourceLocator.java:139)
at org.springframework.cloud.consul.config.ConsulPropertySourceLocator$$FastClassBySpringCGLIB$$b35ebf8.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:91)
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:287)
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:164)
at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:118)
at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:153)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
at org.springframework.cloud.consul.config.ConsulPropertySourceLocator$$EnhancerBySpringCGLIB$$e381a286.locate(<generated>)
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:97)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:649)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:373)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
at com.mycompany.myapp.UaaApp.main(UaaApp.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:8500 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:221)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:165)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:140)
at com.ecwid.consul.transport.AbstractHttpTransport.executeRequest(AbstractHttpTransport.java:61)
... 29 common frames omitted
2019-05-12 00:48:57.125 INFO 29889 --- [ restartedMain] com.mycompany.myapp.UaaApp : The following profiles are active: dev,swagger
可能是什么原因?
答案 0 :(得分:2)
您选择为“服务发现”选项启用Consul,因此必须在启动应用程序之前将其启动。
src/main/docker/consul.yml
中提供了一个docker-compose文件,您可以使用docker-compose -f src/main/docker/consul.yml up -d
启动它