jHipster无法生成Gateway Docker Images。
我已经成功构建了micorservice应用程序,但在制作微服务网关时,我在Running' gulp.js test --no-notification'中遇到了ERROR [karma]。我已经尝试了很多时间来解决但未能找到两个错误的来源:
请有人帮忙吗?
在Mac OSX 10.11.6上,使用jHipster 3.6.1,也完成了微服务网关(JWT,SQL,MySQL,H2,HazelCast,ElasticSearch,International,Gatling和Protractor)。
......... 在完成npm install和bower安装后,继续构建docker镜像:
Emacs-MacBook-Pro:网关Emac $ ./mvnw -Pprod包docker:build
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Gateway 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:copy-resources (default-resources) @ gateway ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO] Copying 17 resources
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ gateway ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO] Copying 17 resources
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-versions) @ gateway ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.7.201606060606:prepare-agent (pre-unit-tests) @ gateway ---
[INFO] surefireArgLine set to -javaagent:/Users/Emac/.m2/repository/org/jacoco/org.jacoco.agent/0.7.7.201606060606/org.jacoco.agent-0.7.7.201606060606-runtime.jar=destfile=/Users/Emac/microservices/gateway/target/test-results/coverage/jacoco/jacoco.exec
[INFO]
[INFO] --- maven-processor-plugin:2.2.4:process (process) @ gateway ---
[INFO]
[INFO] --- frontend-maven-plugin:1.0:install-node-and-npm (install node and npm) @ gateway ---
[INFO] Installing node version v4.4.7
[INFO] Unpacking /Users/Emac/.m2/repository/com/github/eirslett/node/4.4.7/node-4.4.7-darwin-x64.tar.gz into /Users/Emac/microservices/gateway/node/tmp
[INFO] Copying node binary from /Users/Emac/microservices/gateway/node/tmp/node-v4.4.7-darwin-x64/bin/node to /Users/Emac/microservices/gateway/node/node
[INFO] Installed node locally.
[INFO] Installing npm version 3.10.5
[INFO] Unpacking /Users/Emac/.m2/repository/com/github/eirslett/npm/3.10.5/npm-3.10.5.tar.gz into /Users/Emac/microservices/gateway/node/node_modules
[INFO] Installed npm locally.
[INFO]
[INFO] --- frontend-maven-plugin:1.0:npm (npm install) @ gateway ---
[INFO] Running 'npm install' in /Users/Emac/microservices/gateway
[INFO]
[INFO] > gateway@0.0.0 postinstall /Users/Emac/microservices/gateway
[INFO] > webdriver-manager update
[INFO]
[INFO] [22:37:12] I/update - selenium standalone: file exists /Users/Emac/microservices/gateway/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar
[INFO] [22:37:12] I/update - selenium standalone: v2.53.1 up to date
[INFO] [22:37:12] I/update - chromedriver: file exists /Users/Emac/microservices/gateway/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.22mac32.zip
[INFO] [22:37:13] I/update - chromedriver: unzipping chromedriver_2.22mac32.zip
[INFO] [22:37:14] I/update - chromedriver: setting permissions to 0755 for /Users/Emac/microservices/gateway/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.22
[INFO] [22:37:14] I/update - chromedriver: v2.22 up to date
[INFO]
[INFO] --- frontend-maven-plugin:1.0:bower (bower install) @ gateway ---
[INFO] Running 'bower install --no-color' in /Users/Emac/microservices/gateway
[INFO]
[INFO] --- frontend-maven-plugin:1.0:gulp (gulp build) @ gateway ---
[INFO] Running 'gulp.js build --no-notification' in /Users/Emac/microservices/gateway
[INFO] [22:38:18] Using gulpfile ~/microservices/gateway/gulpfile.js
[INFO] [22:38:18] Starting 'clean'...
[INFO] [22:38:18] Finished 'clean' after 7.82 ms
[INFO] [22:38:18] Starting 'build'...
[INFO] [22:38:18] Starting 'copy:i18n'...
[INFO] [22:38:18] Starting 'copy:fonts'...
[INFO] [22:38:18] Starting 'copy:common'...
[INFO] [22:38:18] Starting 'inject:vendor'...
[INFO] [22:38:19] Starting 'ngconstant:prod'...
[INFO] [22:38:19] Starting 'copy:languages'...
[INFO] [22:38:19] Finished 'ngconstant:prod' after 320 ms
[INFO] [22:38:19] Finished 'copy:languages' after 196 ms
[INFO] [22:38:19] Finished 'copy:common' after 415 ms
[INFO] [22:38:19] gulp-inject 23 files into index.html.
[INFO] [22:38:19] Finished 'inject:vendor' after 438 ms
[INFO] [22:38:19] Finished 'copy:fonts' after 516 ms
[INFO] [22:38:19] Finished 'copy:i18n' after 594 ms
[INFO] [22:38:19] Starting 'copy'...
[INFO] [22:38:19] Finished 'copy' after 19 μs
[INFO] [22:38:19] Starting 'inject:app'...
[INFO] [22:38:20] gulp-inject 103 files into index.html.
[INFO] [22:38:20] Finished 'inject:app' after 564 ms
[INFO] [22:38:20] Starting 'inject:troubleshoot'...
[INFO] [22:38:20] gulp-inject 1 files into index.html.
[INFO] [22:38:20] Finished 'inject:troubleshoot' after 51 ms
[INFO] [22:38:20] Starting 'images'...
[INFO] [22:38:20] Starting 'styles'...
[INFO] [22:38:20] Starting 'html'...
[INFO] [22:38:20] Starting 'copy:swagger'...
[INFO] [22:38:20] Starting 'copy:images'...
[INFO] [22:38:20] Finished 'copy:images' after 28 ms
[INFO] [22:38:20] Finished 'styles' after 70 ms
[INFO] [22:38:20] Finished 'html' after 726 ms
[INFO] [22:38:20] Finished 'copy:swagger' after 754 ms
[INFO] [22:38:21] gulp-imagemin: Minified 3 images (saved 0 B - 0%)
[INFO] [22:38:21] Finished 'images' after 1.49 s
[INFO] [22:38:21] Starting 'assets:prod'...
[INFO] [22:38:44] Finished 'assets:prod' after 23 s
[INFO] [22:38:44] Finished 'build' after 26 s
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ gateway ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 104 source files to /Users/Emac/microservices/gateway/target/classes
[WARNING] /Users/Emac/microservices/gateway/src/main/java/com/emodak/buji/gateway/responserewriting/SwaggerBasePathRewritingFilter.java: /Users/Emac/microservices/gateway/src/main/java/com/emodak/buji/gateway/responserewriting/SwaggerBasePathRewritingFilter.java uses or overrides a deprecated API.
[WARNING] /Users/Emac/microservices/gateway/src/main/java/com/emodak/buji/gateway/responserewriting/SwaggerBasePathRewritingFilter.java: Recompile with -Xlint:deprecation for details.
[WARNING] /Users/Emac/microservices/gateway/src/main/java/com/emodak/buji/gateway/TokenRelayFilter.java: Some input files use unchecked or unsafe operations.
[WARNING] /Users/Emac/microservices/gateway/src/main/java/com/emodak/buji/gateway/TokenRelayFilter.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ gateway ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ gateway ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 8 source files to /Users/Emac/microservices/gateway/target/test-classes
[WARNING] /Users/Emac/microservices/gateway/src/test/java/com/emodak/buji/gateway/responserewriting/SwaggerBasePathRewritingFilterTest.java: /Users/Emac/microservices/gateway/src/test/java/com/emodak/buji/gateway/responserewriting/SwaggerBasePathRewritingFilterTest.java uses or overrides a deprecated API.
[WARNING] /Users/Emac/microservices/gateway/src/test/java/com/emodak/buji/gateway/responserewriting/SwaggerBasePathRewritingFilterTest.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ gateway ---
[INFO] Surefire report directory: /Users/Emac/microservices/gateway/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
objc[46612]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/jre/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
Running com.emodak.buji.gateway.responserewriting.SwaggerBasePathRewritingFilterTest
2016-09-10 22:39:07.302 WARN --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2016-09-10 22:39:08.537 DEBUG --- [ main] c.e.b.g.r.SwaggerBasePathRewritingFilter : Swagger-docs: rewritten Base URL with correct micro-service route: /service1
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.437 sec - in com.emodak.buji.gateway.responserewriting.SwaggerBasePathRewritingFilterTest
Running com.emodak.buji.security.SecurityUtilsUnitTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.269 sec - in com.emodak.buji.security.SecurityUtilsUnitTest
Running com.emodak.buji.service.UserServiceIntTest
██ ██ ██ ████████ ███████ ██████ ████████ ████████ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ████████ ██ ███████ █████ ██ ██████ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██████ ██ ██ ████████ ██ ██████ ██ ████████ ██ ██
:: JHipster :: Running Spring Boot 1.4.0.RELEASE ::
:: http://jhipster.github.io ::
2016-09-10 22:39:18.809 WARN 46612 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/gateway/default": Connection refused; nested exception is java.net.ConnectException: Connection refused
2016-09-10 22:39:18.853 INFO 46612 --- [ main] c.e.buji.service.UserServiceIntTest : No active profile set, falling back to default profiles: default
2016-09-10 22:39:24.098 WARN 46612 --- [ main] o.s.c.a.ConfigurationClassPostProcessor : Cannot enhance @Configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2016-09-10 22:39:25.121 DEBUG 46612 --- [ main] c.emodak.buji.config.AsyncConfiguration : Creating Async Task Executor
2016-09-10 22:39:27.595 DEBUG 46612 --- [ main] c.e.buji.config.MetricsConfiguration : Registering JVM gauges
2016-09-10 22:39:27.650 DEBUG 46612 --- [ main] c.e.buji.config.MetricsConfiguration : Monitoring the datasource
2016-09-10 22:39:27.651 DEBUG 46612 --- [ main] c.e.buji.config.MetricsConfiguration : Initializing Metrics JMX reporting
2016-09-10 22:39:28.834 DEBUG 46612 --- [ main] c.e.buji.config.DatabaseConfiguration : Configuring Liquibase
2016-09-10 22:39:28.861 DEBUG 46612 --- [ main] c.e.b.c.liquibase.AsyncSpringLiquibase : Starting Liquibase synchronously
2016-09-10 22:39:33.557 DEBUG 46612 --- [ main] c.e.b.c.liquibase.AsyncSpringLiquibase : Started Liquibase in 4695 ms
2016-09-10 22:39:33.952 DEBUG 46612 --- [ main] c.emodak.buji.config.CacheConfiguration : Configuring Hazelcast
2016-09-10 22:39:34.110 DEBUG 46612 --- [ main] c.emodak.buji.config.CacheConfiguration : Configuring Hazelcast clustering for instanceId: gateway
2016-09-10 22:39:34.347 WARN 46612 --- [ main] c.h.instance.DefaultAddressPicker : [LOCAL] [dev] [3.6.1] Could not find a matching address to start with! Picking one of non-loopback addresses.
2016-09-10 22:39:45.031 INFO 46612 --- [ main] com.emodak.buji.GatewayApp : Running with Spring profile(s) : []
2016-09-10 22:39:48.315 WARN 46612 --- [ main] org.elasticsearch.env : [Cardiac] max file descriptors [10240] for elasticsearch process likely too low, consider increasing to at least [65536]
2016-09-10 22:40:00.397 DEBUG 46612 --- [ main] c.e.b.c.e.IndexReinitializer : ElasticSearch indexes reset in 12 ms
2016-09-10 22:40:11.100 DEBUG 46612 --- [ main] c.emodak.buji.config.CacheConfiguration : Starting HazelcastCacheManager
2016-09-10 22:40:20.884 WARN 46612 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2016-09-10 22:40:21.974 INFO 46612 --- [ main] c.e.buji.service.UserServiceIntTest : Started UserServiceIntTest in 72.623 seconds (JVM running for 79.635)
Hibernate: select authority0_.name as name1_0_0_ from jhi_authority authority0_ where authority0_.name=?
Hibernate: insert into jhi_user (id, created_by, created_date, last_modified_by, last_modified_date, activated, activation_key, email, first_name, lang_key, last_name, login, password_hash, reset_date, reset_key) values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2016-09-10 22:40:23.482 DEBUG 46612 --- [ main] com.emodak.buji.service.UserService : Created Information for User: User{login='johndoe', firstName='John', lastName='Doe', email='john.doe@localhost', activated='false', langKey='en-US', activationKey='80060923054997847003'}
......
Hibernate: select authoritie0_.user_id as user_id1_3_0_, authoritie0_.authority_name as authorit2_4_0_, authority1_.name as name1_0_1_ from jhi_user_authority authoritie0_ inner join jhi_authority authority1_ on authoritie0_.authority_name=authority1_.name where authoritie0_.user_id=?
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.317 sec - in com.emodak.buji.web.rest.UserResourceIntTest
2016-09-10 22:40:29.743 WARN 46612 --- [.ShutdownThread] com.hazelcast.instance.Node : [192.168.11.5]:5701 [dev] [3.6.1] Terminating forcefully...
2016-09-10 22:40:30.287 WARN 46612 --- [ Thread-6] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2016-09-10 22:40:30.537 INFO 46612 --- [ Thread-6] c.emodak.buji.config.CacheConfiguration : Closing Cache Manager
Results :
Tests run: 32, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.7.201606060606:report (post-unit-test) @ gateway ---
[INFO] Loading execution data file /Users/Emac/microservices/gateway/target/test-results/coverage/jacoco/jacoco.exec
[INFO] Analyzed bundle 'Gateway' with 120 classes
[INFO]
[INFO] --- frontend-maven-plugin:1.0:gulp (gulp test) @ gateway ---
[INFO] Running 'gulp.js test --no-notification' in /Users/Emac/microservices/gateway
[INFO] [22:41:35] Using gulpfile ~/microservices/gateway/gulpfile.js
[INFO] [22:41:35] Starting 'inject:test'...
[INFO] [22:41:35] Starting 'ngconstant:dev'...
[INFO] [22:41:35] Finished 'ngconstant:dev' after 142 ms
[INFO] [22:41:35] gulp-inject 22 files into karma.conf.js.
[INFO] [22:41:35] Finished 'inject:test' after 655 ms
[INFO] [22:41:35] Starting 'test'...
[INFO] 10 09 2016 22:41:47.224:INFO [karma]: Karma v1.1.2 server started at http://localhost:9876/
[INFO] 10 09 2016 22:41:47.287:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
[INFO] 10 09 2016 22:41:47.402:INFO [launcher]: Starting browser PhantomJS
[INFO] 10 09 2016 22:41:47.500:ERROR [karma]: { [Error: spawn EACCES] code: 'EACCES', errno: 'EACCES', syscall: 'spawn' }
[INFO] Error: spawn EACCES
[INFO] at exports._errnoException (util.js:873:11)
[INFO] at ChildProcess.spawn (internal/child_process.js:298:11)
[INFO] at exports.spawn (child_process.js:362:9)
[INFO] at Object._execCommand (/Users/Emac/microservices/gateway/node_modules/karma/lib/launchers/process.js:63:21)
[INFO] at Object._start (/Users/Emac/microservices/gateway/node_modules/karma-phantomjs-launcher/index.js:76:10)
[INFO] at Object.<anonymous> (/Users/Emac/microservices/gateway/node_modules/karma/lib/launchers/process.js:14:10)
[INFO] at emitOne (events.js:82:20)
[INFO] at Object.emit (events.js:169:7)
[INFO] at Object.start (/Users/Emac/microservices/gateway/node_modules/karma/lib/launchers/base.js:42:10)
[INFO] at Object.j (/Users/Emac/microservices/gateway/node_modules/karma/lib/launcher.js:108:17)
[INFO] at Object.setTimeout.bind.j (/Users/Emac/microservices/gateway/node_modules/karma/node_modules/qjobs/qjobs.js:143:18)
[INFO] at Timer.listOnTimeout (timers.js:92:15)
[INFO] [22:41:47] 'test' errored after 12 s
[INFO] [22:41:47] Error: 1
[INFO] at formatError (/Users/Emac/microservices/gateway/node_modules/gulp/bin/gulp.js:169:10)
[INFO] at Gulp.<anonymous> (/Users/Emac/microservices/gateway/node_modules/gulp/bin/gulp.js:195:15)
[INFO] at emitOne (events.js:77:13)
[INFO] at Gulp.emit (events.js:169:7)
[INFO] at Gulp.Orchestrator._emitTaskDone (/Users/Emac/microservices/gateway/node_modules/gulp/node_modules/orchestrator/index.js:264:8)
[INFO] at /Users/Emac/microservices/gateway/node_modules/gulp/node_modules/orchestrator/index.js:275:23
[INFO] at finish (/Users/Emac/microservices/gateway/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
[INFO] at cb (/Users/Emac/microservices/gateway/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3)
[INFO] at removeAllListeners (/Users/Emac/microservices/gateway/node_modules/karma/lib/server.js:379:7)
[INFO] at Server.<anonymous> (/Users/Emac/microservices/gateway/node_modules/karma/lib/server.js:390:9)
[INFO] at Server.g (events.js:260:16)
[INFO] at emitNone (events.js:72:20)
[INFO] at Server.emit (events.js:166:7)
[INFO] at emitCloseNT (net.js:1537:8)
[INFO] at nextTickCallbackWith1Arg (node.js:431:9)
[INFO] at process._tickCallback (node.js:353:17)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 08:53 min
[INFO] Finished at: 2016-09-10T22:42:47+08:00
[INFO] Final Memory: 67M/314M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.0:gulp (gulp test) on project gateway: Failed to run task: 'gulp.js test --no-notification' failed. (error code 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Emacs-MacBook-Pro:网关Emac $
提前致谢,Sam8881
答案 0 :(得分:0)
对我来说(./mvnw -Pprod);