- 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/
我希望在某些环境中使用用户名和密码保护某个角色,但在其他环境中甚至不需要提示。如果我在 tomcat web.xml 中有一个 auth-constraint,我可以创建一个具有“匿名”访问权限的角色
我正在使用 Tomcat jmxproxy 和状态来监视 Web 应用程序,但是 jmxproxy 页面中有很多无用的信息,并且其中没有任何信息,例如事件连接数。有谁知道如何过滤 jmxproxy 页
是否可以通过执行 JSP 来重启 Tomcat6? 这是因为我想通过使用网络服务器远程部署应用程序的更改。 部署脚本是用 bash 编写的,它从 svn 中 check out 最新版本,然后将其打包
我有一个包含 2 个子项目(后端和 ui)的 gradle 项目。 Ui由gradle tomcatRunWar完美启动.后端有我们在生产地点的配置描述符/conf/Catalina/localhos
发现 XAMPP 控件认为 tomcat 正在运行但无法停止它的问题。 在catalina下的tomcat logs目录下可以找到如下错误 “严重:无法联系 localhost:8005。Tomcat
PuppetLabs 在 PuppetForge 上有一个模块,用于部署 Tomcat 及其配置。 https://forge.puppet.com/puppetlabs/tomcat Tomcat
我有一个部署到 Tomcat 实例中的 Web 应用程序。我希望能够将 tomcat 配置为在 Tomcat 本身启动时不自动启动该应用程序。但是,我确实希望启动 Tomcat 管理器,以便我可以根据
操作系统:windows XP。 我已经安装了 Tomcat 7.0.25,文件夹“manager”位于 webapps 文件夹中。 我已阅读此处的文档:http://tomcat.apache.or
我们在 server.xml 文件中启用了以下访问日志模式 pattern="%h %H %l %u %t "%r" %s %b location: %{location}o"。 有人可以帮助理解模式
我最近开始使用 tomcat,我有一个关于 Tomcat 请求路由/映射的查询。 假设我在 tomcat 服务器中部署了四个应用程序 A、B、C 和 D,当有请求到来时,tomcat 如何知道要调用哪
我在我的计算机上使用 Tomcat,它可以通过端口 8080 访问。我想要的是我应该能够使用我的计算机的 IP 地址访问我的 Tomcat 服务器页面。我以前读过很多主题,但找不到一个可以帮助我的主题
我有一个 tomcat 7 服务器和一个 postgreSQL 9.0 数据库。我用它来为地理网络元数据编辑器设置开发环境。一切都是根据 geonetwork 网站教程设置的。我在将服务器与数据库连接
我的服务器有 物理 ip 和 虚拟 ip 由网络管理员设置。在我安装的服务器内部 Apache tomcat 7.0.29并创建一个网络应用程序。当我运行 wget http://:8080/xxx或
我有多个应用程序在不同的端口上运行(tomcat 实例) 都有相同的CATALINA_HOME 目前我必须在所有实例中部署和安装psi 探针,并在不同的窗口中分别监控每个端口。 我如何在一个单一的探测
based on this question 我尝试将 Tomcat 控制台输出重定向到一个文本文件,它对我的 Web 应用程序工作正常,但问题是,每次 Tomcat 启动时它都会被覆盖。我需要创
我需要阐明我的问题。问题是:有什么方法可以影响 Tomcat 为特定部署的应用程序分配多少堆内存?更多详细信息 - 我如何为已部署的应用程序设置特定的 Java 选项(考虑我想为每个应用程序设置特殊的
应用服务器内部的类加载机制是开发人员常见的困惑来源;这就是为什么我想问一个关于 tomcat 7 服务器中这个机制的问题:我有一个网络应用程序 sample.war,它依赖于 jgroups 库, 放
尝试将嵌入式 Tomcat 5 迁移到嵌入式 Tomcat 7。在启动过程中获取 NPE。 我扩展了 Embedded 类并按照正确的顺序执行所有建议的初始化。 NPE 发生在这里: Caused b
我可以使用随附的 start.sh 文件启动 tomcat,但是是否有任何参数可以用来执行以下操作: 在指定的根目录启动 Tomcat 服务 强制 Tomcat 在浏览器中拉出指定的主页 谢谢 最佳答
我在两台 diff 机器 tomcat 服务器上做一个简单的集群配置。每次我启动 tomcat 时,我都会收到一个错误,就像集群组中没有事件成员一样。我正在附加集群配置
我是一名优秀的程序员,十分优秀!