- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我创建了一个 jhipster (v3.4.0) 微服务应用程序,并希望将其部署在生产环境中,而不是部署在 tomcat 实例上。我已将其配置为不需要 jhipster-registry 或 jhipster-console 来进行日志转发。所以我想要实现的是将其作为 java app/jar 运行。
这是我使用开发配置文件运行它的日志:
hostname:myapp edmond$ ./mvnw
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Myapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.3.5.RELEASE:run (default-cli) > test-compile @ myapp >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ myapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 43 resources
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-versions) @ myapp ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.6.201602180812:prepare-agent (pre-unit-tests) @ myapp ---
[INFO] surefireArgLine set to -javaagent:/Users/edmond/.m2/repository/org/jacoco/org.jacoco.agent/0.7.6.201602180812/org.jacoco.agent-0.7.6.201602180812-runtime.jar=destfile=/Users/edmond/workspace/myapp/target/test-results/coverage/jacoco/jacoco.exec
[INFO]
[INFO] --- maven-processor-plugin:2.2.4:process (process) @ myapp ---
[WARNING] diagnostic: warning: The following options were not recognized by any processor: '[mapstruct.defaultComponentModel, mapstruct.suppressGeneratorTimestamp]'
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ myapp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 161 source files to /Users/edmond/workspace/myapp/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ myapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ myapp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 24 source files to /Users/edmond/workspace/myapp/target/test-classes
[INFO]
[INFO] <<< spring-boot-maven-plugin:1.3.5.RELEASE:run (default-cli) < test-compile @ myapp <<<
[INFO]
[INFO] --- spring-boot-maven-plugin:1.3.5.RELEASE:run (default-cli) @ myapp ---
2016-09-17 13:02:17.453 DEBUG 3087 --- [kground-preinit] org.jboss.logging : Logging Provider: org.jboss.logging.Slf4jLoggerProvider found via system property
██ ██ ██ ████████ ███████ ██████ ████████ ████████ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ████████ ██ ███████ █████ ██ ██████ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██████ ██ ██ ████████ ██ ██████ ██ ████████ ██ ██
:: JHipster 🤓 :: Running Spring Boot 1.3.5.RELEASE ::
:: http://jhipster.github.io ::
2016-09-17 13:02:19.150 WARN 3087 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/myapp/default": Connection refused; nested exception is java.net.ConnectException: Connection refused
2016-09-17 13:02:19.152 INFO 3087 --- [ main] a.p.v.myapp.MyappApp : The following profiles are active: dev
2016-09-17 13:02:24.969 WARN 3087 --- [ 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-17 13:02:26.032 DEBUG 3087 --- [ main] a.p.v.m.config.AsyncConfiguration : Creating Async Task Executor
2016-09-17 13:02:27.293 DEBUG 3087 --- [ main] a.p.v.m.config.MetricsConfiguration : Registering JVM gauges
2016-09-17 13:02:27.314 DEBUG 3087 --- [ main] a.p.v.m.config.MetricsConfiguration : Initializing Metrics JMX reporting
2016-09-17 13:02:30.606 INFO 3087 --- [ost-startStop-1] a.p.v.myapp.MyappApp : Running with Spring profile(s) : [dev]
2016-09-17 13:02:31.162 DEBUG 3087 --- [ main] a.p.v.m.config.CacheConfiguration : Configuring Hazelcast
2016-09-17 13:02:31.206 DEBUG 3087 --- [ main] a.p.v.m.config.CacheConfiguration : Configuring Hazelcast clustering for instanceId: myapp
2016-09-17 13:02:31.209 DEBUG 3087 --- [ main] a.p.v.m.config.CacheConfiguration : Application is running with the "dev" profile, Hazelcast cluster will only work with localhost instances
2016-09-17 13:02:31.341 INFO 3087 --- [ main] c.h.instance.DefaultAddressPicker : [LOCAL] [dev] [3.6.1] Picked Address[127.0.0.1]:13782, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=13782], bind any local is true
2016-09-17 13:02:31.716 INFO 3087 --- [ main] com.hazelcast.spi.OperationService : [127.0.0.1]:13782 [dev] [3.6.1] Backpressure is disabled
2016-09-17 13:02:31.746 INFO 3087 --- [ main] c.h.s.i.o.c.ClassicOperationExecutor : [127.0.0.1]:13782 [dev] [3.6.1] Starting with 2 generic operation threads and 2 partition operation threads.
2016-09-17 13:02:32.375 INFO 3087 --- [ main] com.hazelcast.system : [127.0.0.1]:13782 [dev] [3.6.1] Hazelcast 3.6.1 (20160228 - d0d2a77) starting at Address[127.0.0.1]:13782
2016-09-17 13:02:32.376 INFO 3087 --- [ main] com.hazelcast.system : [127.0.0.1]:13782 [dev] [3.6.1] Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
2016-09-17 13:02:32.376 INFO 3087 --- [ main] com.hazelcast.system : [127.0.0.1]:13782 [dev] [3.6.1] Configured Hazelcast Serialization version : 1
2016-09-17 13:02:32.386 INFO 3087 --- [ main] com.hazelcast.instance.Node : [127.0.0.1]:13782 [dev] [3.6.1] Creating TcpIpJoiner
2016-09-17 13:02:32.395 INFO 3087 --- [ main] com.hazelcast.core.LifecycleService : [127.0.0.1]:13782 [dev] [3.6.1] Address[127.0.0.1]:13782 is STARTING
2016-09-17 13:02:32.563 INFO 3087 --- [ main] c.h.n.t.n.NonBlockingIOThreadingModel : [127.0.0.1]:13782 [dev] [3.6.1] TcpIpConnectionManager configured with Non Blocking IO-threading model: 3 input threads and 3 output threads
2016-09-17 13:02:32.566 DEBUG 3087 --- [ main] c.h.n.t.n.NonBlockingIOThreadingModel : [127.0.0.1]:13782 [dev] [3.6.1] InputThreads selectNow enabled=false
2016-09-17 13:02:32.567 DEBUG 3087 --- [ main] c.h.n.t.n.NonBlockingIOThreadingModel : [127.0.0.1]:13782 [dev] [3.6.1] OutputThreads selectNow enabled=false
2016-09-17 13:02:32.585 INFO 3087 --- [ main] com.hazelcast.cluster.impl.TcpIpJoiner : [127.0.0.1]:13782 [dev] [3.6.1]
Members [1] {
Member [127.0.0.1]:13782 this
}
2016-09-17 13:02:32.662 INFO 3087 --- [ main] com.hazelcast.core.LifecycleService : [127.0.0.1]:13782 [dev] [3.6.1] Address[127.0.0.1]:13782 is STARTED
2016-09-17 13:02:32.746 DEBUG 3087 --- [ main] a.p.v.m.config.CacheConfiguration : Starting HazelcastCacheManager
2016-09-17 13:02:32.754 DEBUG 3087 --- [ main] a.p.v.m.config.DatabaseConfiguration : Configuring Datasource
2016-09-17 13:02:32.863 DEBUG 3087 --- [ cached2] s.n.www.protocol.http.HttpURLConnection : sun.net.www.MessageHeader@5268e0755 pairs: {GET /ping?version=3.6.1&m=bf74a0ee-32c7-42f6-9cd5-4bb447422f23&e=false&l=NULL&p=maven&c=672524cf-65e9-4d0a-9bf0-3f8ee7e5b89d&crsz=A&cssz=A&hdgb=0&ccpp=0&cdn=0&cjv=0&cuptm=52&nuptm=51033 HTTP/1.1: null}{User-Agent: Mozilla/5.0}{Host: phonehome.hazelcast.com}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}
2016-09-17 13:02:33.107 DEBUG 3087 --- [ cached2] s.n.www.protocol.http.HttpURLConnection : sun.net.www.MessageHeader@1e6bec8f5 pairs: {null: HTTP/1.1 200 OK}{Server: Apache-Coyote/1.1}{Content-Type: text/plain;charset=UTF-8}{Transfer-Encoding: chunked}{Date: Sat, 17 Sep 2016 11:04:42 GMT}
2016-09-17 13:02:33.322 DEBUG 3087 --- [ main] a.p.v.m.config.DatabaseConfiguration : Configuring Liquibase
2016-09-17 13:02:33.346 WARN 3087 --- [ssor-Executor-1] a.p.v.m.c.l.AsyncSpringLiquibase : Starting Liquibase asynchronously, your database might not be ready at startup!
2016-09-17 13:02:36.764 INFO 3087 --- [ main] a.p.v.m.c.h.HazelcastCacheRegionFactory : Starting up HazelcastCacheRegionFactory
2016-09-17 13:02:38.924 DEBUG 3087 --- [ssor-Executor-1] a.p.v.m.c.l.AsyncSpringLiquibase : Started Liquibase in 5577 ms
2016-09-17 13:02:45.294 DEBUG 3087 --- [ main] a.p.v.m.c.apidoc.SwaggerConfiguration : Starting Swagger
2016-09-17 13:02:45.312 DEBUG 3087 --- [ main] a.p.v.m.c.apidoc.SwaggerConfiguration : Started Swagger in 17 ms
2016-09-17 13:02:47.732 WARN 3087 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2016-09-17 13:02:47.747 WARN 3087 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2016-09-17 13:02:50.203 INFO 3087 --- [ main] a.p.v.myapp.MyappApp : Started MyappApp in 39.89 seconds (JVM running for 68.597)
2016-09-17 13:02:50.220 DEBUG 3087 --- [ main] a.p.v.myapp.MyappApp : Routing service toward RouterManager
2016-09-17 13:02:50.229 INFO 3087 --- [ main] a.p.v.myapp.MyappApp : Consumer started!
^C2016-09-17 13:02:59.462 INFO 3087 --- [.ShutdownThread] com.hazelcast.instance.Node : [127.0.0.1]:13782 [dev] [3.6.1] Running shutdown hook... Current state: ACTIVE
2016-09-17 13:02:59.462 INFO 3087 --- [.ShutdownThread] com.hazelcast.core.LifecycleService : [127.0.0.1]:13782 [dev] [3.6.1] Address[127.0.0.1]:13782 is SHUTTING_DOWN
2016-09-17 13:02:59.463 WARN 3087 --- [.ShutdownThread] com.hazelcast.instance.Node : [127.0.0.1]:13782 [dev] [3.6.1] Terminating forcefully...
2016-09-17 13:02:59.464 INFO 3087 --- [.ShutdownThread] com.hazelcast.instance.Node : [127.0.0.1]:13782 [dev] [3.6.1] Shutting down connection manager...
2016-09-17 13:02:59.586 INFO 3087 --- [ Thread-6] a.p.v.m.c.h.HazelcastCacheRegionFactory : Shutting down HazelcastCacheRegionFactory
2016-09-17 13:02:59.607 INFO 3087 --- [ Thread-6] a.p.v.m.config.CacheConfiguration : Closing Cache Manager
hostname:myapp edmond$
这是我为生产做好准备的地方:
hostname:myapp edmond$ ./mvnw package -Pprod -DskipTests
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Myapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
.
.
.
[INFO] Building war: /Users/edmond/workspace/myapp/target/myapp-0.0.1-SNAPSHOT.war
[INFO]
[INFO] --- spring-boot-maven-plugin:1.3.5.RELEASE:repackage (default) @ myapp ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.982 s
[INFO] Finished at: 2016-09-17T13:03:28+02:00
[INFO] Final Memory: 66M/481M
[INFO] ------------------------------------------------------------------------
hostname:myapp edmond$
这是我在生产环境中运行它的地方:
hostname:myapp edmond$ java -jar target/myapp-0.0.1-SNAPSHOT.war
* JHIPSTER *
:: JHipster 🤓 :: Running Spring Boot 1.3.5.RELEASE ::
:: http://jhipster.github.io ::
2016-09-17 14:04:08.512 WARN 4419 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/myapp/default": Connection refused; nested exception is java.net.ConnectException: Connection refused
2016-09-17 14:04:08.520 INFO 4419 --- [ main] a.p.v.myapp.MyappApp : The following profiles are active: prod
2016-09-17 14:04:15.893 WARN 4419 --- [ 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-17 14:04:25.844 ERROR 4419 --- [cat-startStop-1] org.apache.catalina.core.ContainerBase : A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
... 6 common frames omitted
Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.addFilter(Ljava/lang/String;Ljavax/servlet/Filter;)Ljavax/servlet/FilterRegistration$Dynamic;
at org.springframework.boot.context.embedded.AbstractFilterRegistrationBean.onStartup(AbstractFilterRegistrationBean.java:225)
at org.springframework.boot.context.embedded.FilterRegistrationBean.onStartup(FilterRegistrationBean.java:41)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.selfInitialize(EmbeddedWebApplicationContext.java:225)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.access$000(EmbeddedWebApplicationContext.java:85)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext$1.onStartup(EmbeddedWebApplicationContext.java:209)
at org.springframework.boot.context.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:55)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5240)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 6 common frames omitted
2016-09-17 14:04:25.846 ERROR 4419 --- [ main] org.apache.catalina.core.ContainerBase : A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:787)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:346)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:89)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:76)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:457)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:168)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:160)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
at com.domain.smth.myapp.MyappApp.main(MyappApp.java:76)
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.loader.MainMethodRunner.run(MainMethodRunner.java:54)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
... 1 common frames omitted
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:924)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 6 common frames omitted
2016-09-17 14:04:25.847 WARN 4419 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
2016-09-17 14:04:25.893 ERROR 4419 --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
at com.domain.smth.myapp.MyappApp.main(MyappApp.java:76)
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.loader.MainMethodRunner.run(MainMethodRunner.java:54)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:99)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:76)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:457)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:168)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:160)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130)
... 14 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardServer[-1]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:346)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:89)
... 19 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Tomcat]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:787)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 21 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 23 common frames omitted
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:924)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 25 common frames omitted
Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:62)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
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.loader.MainMethodRunner.run(MainMethodRunner.java:54)
... 1 more
Caused by: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
at com.domain.smth.myapp.MyappApp.main(MyappApp.java:76)
... 6 more
Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:99)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:76)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:457)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:168)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:160)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130)
... 14 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardServer[-1]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:346)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:89)
... 19 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Tomcat]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:787)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 21 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 23 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:924)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
... 25 more
hostname:myapp edmond$
编辑日期:2016 年 11 月 25 日
我删除了 pom.xml 中嵌入的 tomcat 的所有引用,因为我的项目不需要。
我删除了 Servlets/HTTPServlet 的所有引用。
我现在使用 SpringApplication 而不是 ApplicationContext 运行它
最佳答案
仔细查看您的日志后,我认为您的应用程序正在尝试获取应用程序的配置,即正在查找 http://localhost:8888/myapp/default 。
8888端口下运行的大多是spring clod config service (here is the documentation)。由于您不想运行注册表服务,请检查您的微服务的配置方式,例如查看应用程序配置文件夹中的 boostrap-[profile].yml。
干杯,老兄
关于java - 如何在没有tomcat的情况下启动jhipster微服务应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39550286/
我正在编写一个具有以下签名的 Java 方法。 void Logger(Method method, Object[] args); 如果一个方法(例如 ABC() )调用此方法 Logger,它应该
我是 Java 新手。 我的问题是我的 Java 程序找不到我试图用作的图像文件一个 JButton。 (目前这段代码什么也没做,因为我只是得到了想要的外观第一的)。这是我的主课 代码: packag
好的,今天我在接受采访,我已经编写 Java 代码多年了。采访中说“Java 垃圾收集是一个棘手的问题,我有几个 friend 一直在努力弄清楚。你在这方面做得怎么样?”。她是想骗我吗?还是我的一生都
我的 friend 给了我一个谜语让我解开。它是这样的: There are 100 people. Each one of them, in his turn, does the following
如果我将使用 Java 5 代码的应用程序编译成字节码,生成的 .class 文件是否能够在 Java 1.4 下运行? 如果后者可以工作并且我正在尝试在我的 Java 1.4 应用程序中使用 Jav
有关于why Java doesn't support unsigned types的问题以及一些关于处理无符号类型的问题。我做了一些搜索,似乎 Scala 也不支持无符号数据类型。限制是Java和S
我只是想知道在一个 java 版本中生成的字节码是否可以在其他 java 版本上运行 最佳答案 通常,字节码无需修改即可在 较新 版本的 Java 上运行。它不会在旧版本上运行,除非您使用特殊参数 (
我有一个关于在命令提示符下执行 java 程序的基本问题。 在某些机器上我们需要指定 -cp 。 (类路径)同时执行java程序 (test为java文件名与.class文件存在于同一目录下) jav
我已经阅读 StackOverflow 有一段时间了,现在我才鼓起勇气提出问题。我今年 20 岁,目前在我的家乡(罗马尼亚克卢日-纳波卡)就读 IT 大学。足以介绍:D。 基本上,我有一家提供簿记应用
我有 public JSONObject parseXML(String xml) { JSONObject jsonObject = XML.toJSONObject(xml); r
我已经在 Java 中实现了带有动态类型的简单解释语言。不幸的是我遇到了以下问题。测试时如下代码: def main() { def ks = Map[[1, 2]].keySet()
一直提示输入 1 到 10 的数字 - 结果应将 st、rd、th 和 nd 添加到数字中。编写一个程序,提示用户输入 1 到 10 之间的任意整数,然后以序数形式显示该整数并附加后缀。 public
我有这个 DownloadFile.java 并按预期下载该文件: import java.io.*; import java.net.URL; public class DownloadFile {
我想在 GUI 上添加延迟。我放置了 2 个 for 循环,然后重新绘制了一个标签,但这 2 个 for 循环一个接一个地执行,并且标签被重新绘制到最后一个。 我能做什么? for(int i=0;
我正在对对象 Student 的列表项进行一些测试,但是我更喜欢在 java 类对象中创建硬编码列表,然后从那里提取数据,而不是连接到数据库并在结果集中选择记录。然而,自从我这样做以来已经很长时间了,
我知道对象创建分为三个部分: 声明 实例化 初始化 classA{} classB extends classA{} classA obj = new classB(1,1); 实例化 它必须使用
我有兴趣使用 GPRS 构建车辆跟踪系统。但是,我有一些问题要问以前做过此操作的人: GPRS 是最好的技术吗?人们意识到任何问题吗? 我计划使用 Java/Java EE - 有更好的技术吗? 如果
我可以通过递归方法反转数组,例如:数组={1,2,3,4,5} 数组结果={5,4,3,2,1}但我的结果是相同的数组,我不知道为什么,请帮助我。 public class Recursion { p
有这样的标准方式吗? 包括 Java源代码-测试代码- Ant 或 Maven联合单元持续集成(可能是巡航控制)ClearCase 版本控制工具部署到应用服务器 最后我希望有一个自动构建和集成环境。
我什至不知道这是否可能,我非常怀疑它是否可能,但如果可以,您能告诉我怎么做吗?我只是想知道如何从打印机打印一些文本。 有什么想法吗? 最佳答案 这里有更简单的事情。 import javax.swin
我是一名优秀的程序员,十分优秀!