我有一个使用Spring Boot Actuator的Java后端,但它不会在DigitalOcean Ubuntu VPS上启动。同样的应用程序在我的苹果电脑和其他Ubuntu电脑上运行良好。
szabolcs@SmartUpProd:~/smartup$ java -Xmx1536m -jar build/libs/smartup-backend-0.1.0.jar
它开始初始化,但每次都在同一点停止(没有例外,只是挂起)。如果我尝试在此时用^C
停止它,它将无法恢复shell。
这是Outoput:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.1.5.RELEASE)
2014-09-04 04:19:27.697 INFO 1724 --- [ main] com.smartup.SmartUpConfiguration : Starting SmartUpConfiguration on SmartUpProd with PID 1724 (/home/szabolcs/smartup/build/libs/smartup-backend-0.1.0.jar started by szabolcs in /home/szabolcs/smartup)
2014-09-04 04:19:27.783 INFO 1724 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@464e53bb: startup date [Thu Sep 04 04:19:27 EDT 2014]; root of context hierarchy
2014-09-04 04:19:28.911 INFO 1724 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'beanNameViewResolver': replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
2014-09-04 04:19:30.225 INFO 1724 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'smartUpConfiguration' of type [class com.smartup.SmartUpConfiguration$$EnhancerBySpringCGLIB$$ec37524d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-09-04 04:19:30.254 INFO 1724 --- [ main] o.s.j.d.DriverManagerDataSource : Loaded JDBC driver: com.mysql.jdbc.Driver
2014-09-04 04:19:30.266 INFO 1724 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [class org.springframework.jdbc.datasource.DriverManagerDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-09-04 04:19:30.293 INFO 1724 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2014-09-04 04:19:30.440 INFO 1724 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
2014-09-04 04:19:30.452 INFO 1724 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {4.0.1.Final}
2014-09-04 04:19:30.457 INFO 1724 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2014-09-04 04:19:30.459 INFO 1724 --- [ main] org.hibernate.cfg.Environment : HHH000021: Bytecode provider name : javassist
2014-09-04 04:19:30.486 INFO 1724 --- [ main] org.hibernate.ejb.Ejb3Configuration : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2014-09-04 04:19:30.826 INFO 1724 --- [ main] o.h.s.j.c.i.ConnectionProviderInitiator : HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
2014-09-04 04:19:31.175 INFO 1724 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
2014-09-04 04:19:31.188 INFO 1724 --- [ main] o.h.e.jdbc.internal.LobCreatorBuilder : HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
2014-09-04 04:19:31.208 INFO 1724 --- [ main] o.h.e.t.i.TransactionFactoryInitiator : HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory
2014-09-04 04:19:31.218 INFO 1724 --- [ main] o.h.h.i.ast.ASTQueryTranslatorFactory : HHH000397: Using ASTQueryTranslatorFactory
2014-09-04 04:19:31.657 INFO 1724 --- [ main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000228: Running hbm2ddl schema update
[...]
2014-09-04 04:19:31.768 INFO 1724 --- [ main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000232: Schema update complete
2014-09-04 04:19:31.947 INFO 1724 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'entityManagerFactory' of type [class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-09-04 04:19:32.092 INFO 1724 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$7460673f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-09-04 04:19:32.119 INFO 1724 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'transactionAttributeSource' of type [class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-09-04 04:19:32.148 INFO 1724 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'transactionInterceptor' of type [class org.springframework.transaction.interceptor.TransactionInterceptor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-09-04 04:19:32.167 INFO 1724 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.config.internalTransactionAdvisor' of type [class org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2014-09-04 04:19:32.574 INFO 1724 --- [ main] .t.TomcatEmbeddedServletContainerFactory : Server initialized with port: 8080
2014-09-04 04:19:32.803 INFO 1724 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2014-09-04 04:19:32.805 INFO 1724 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/7.0.54
2014-09-04 04:19:32.956 INFO 1724 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2014-09-04 04:19:32.957 INFO 1724 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 5178 ms
2014-09-04 04:19:35.202 INFO 1724 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: Ant [pattern='/css/**'], []
2014-09-04 04:19:35.203 INFO 1724 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: Ant [pattern='/js/**'], []
2014-09-04 04:19:35.203 INFO 1724 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: Ant [pattern='/images/**'], []
2014-09-04 04:19:35.203 INFO 1724 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: Ant [pattern='/**/favicon.ico'], []
2014-09-04 04:19:35.203 INFO 1724 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: Ant [pattern='/info'], []
2014-09-04 04:19:35.203 INFO 1724 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: Ant [pattern='/health'], []
2014-09-04 04:19:35.203 INFO 1724 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: Ant [pattern='/error'], []
2014-09-04 04:19:35.252 INFO 1724 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: org.springframework.security.web.util.matcher.AnyRequestMatcher@1, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@5c4b8904, org.springframework.security.web.context.SecurityContextPersistenceFilter@36b59af2, org.springframework.security.web.header.HeaderWriterFilter@71880af1, org.springframework.security.web.authentication.logout.LogoutFilter@1cd26cc7, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@10e5d335, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6c2a1c3a, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@5c58c840, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@166e5d45, org.springframework.security.web.session.SessionManagementFilter@49040d09, org.springframework.security.web.access.ExceptionTranslationFilter@2d18c028, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@5dc9dca8]
2014-09-04 04:19:35.257 INFO 1724 --- [ost-startStop-1] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: OrRequestMatcher [requestMatchers=[Ant [pattern='/dump'], Ant [pattern='/dump/'], Ant [pattern='/dump.*'], Ant [pattern='/env'], Ant [pattern='/env/'], Ant [pattern='/env.*'], Ant [pattern='/configprops'], Ant [pattern='/configprops/'], Ant [pattern='/configprops.*'], Ant [pattern='/autoconfig'], Ant [pattern='/autoconfig/'], Ant [pattern='/autoconfig.*'], Ant [pattern='/mappings'], Ant [pattern='/mappings/'], Ant [pattern='/mappings.*'], Ant [pattern='/trace'], Ant [pattern='/trace/'], Ant [pattern='/trace.*'], Ant [pattern='/metrics'], Ant [pattern='/metrics/'], Ant [pattern='/metrics.*'], Ant [pattern='/beans'], Ant [pattern='/beans/'], Ant [pattern='/beans.*']]], [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@73762e60, org.springframework.security.web.context.SecurityContextPersistenceFilter@3d8b310e, org.springframework.security.web.header.HeaderWriterFilter@5ef9f4c9, org.springframework.security.web.authentication.logout.LogoutFilter@2fa7040e, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@3ae20f72, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@1bd98f6, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@10736bb4, org.springframework.security.web.session.SessionManagementFilter@4bde96b2, org.springframework.security.web.access.ExceptionTranslationFilter@56ed5cfd, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@2df2e9b6]
2014-09-04 04:19:35.391 INFO 1724 --- [ost-startStop-1] o.s.b.c.e.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2014-09-04 04:19:35.395 INFO 1724 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'metricFilter' to: [/*]
2014-09-04 04:19:35.396 INFO 1724 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*]
2014-09-04 04:19:35.396 INFO 1724 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2014-09-04 04:19:35.396 INFO 1724 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'applicationContextIdFilter' to: [/*]
2014-09-04 04:19:35.396 INFO 1724 --- [ost-startStop-1] o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'webRequestLoggingFilter' to: [/*]
这是^C
之后的输出:
^C2014-09-04 04:34:46.560 INFO 1724 --- [ Thread-2] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@464e53bb: startup date [Thu Sep 04 04:19:27 EDT 2014]; root of context hierarchy
2014-09-04 04:34:46.573 WARN 1724 --- [ Thread-2] ationConfigEmbeddedWebApplicationContext : Exception thrown from LifecycleProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@464e53bb: startup date [Thu Sep 04 04:19:27 EDT 2014]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:359)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:888)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.doClose(EmbeddedWebApplicationContext.java:152)
at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:809)
2014-09-04 04:34:46.601 INFO 1724 --- [ Thread-2] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
有人面临过同样的问题吗?你们能帮帮我吗?
这里你有线程转储(当它挂起来的时候):
szabolcs@SmartUpProd:~$ jstack 2616
2014-09-04 07:33:30
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode):
"Attach Listener" #14 daemon prio=9 os_prio=0 tid=0x00007fb678001000 nid=0xaae waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"localhost-startStop-1" #13 daemon prio=5 os_prio=0 tid=0x00007fb65000d000 nid=0xa46 runnable [0x00007fb662fec000]
java.lang.Thread.State: RUNNABLE
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:246)
at sun.security.provider.SeedGenerator$URLSeedGenerator.getSeedBytes(SeedGenerator.java:539)
at sun.security.provider.SeedGenerator.generateSeed(SeedGenerator.java:144)
at sun.security.provider.SecureRandom$SeederHolder.<clinit>(SecureRandom.java:192)
at sun.security.provider.SecureRandom.engineNextBytes(SecureRandom.java:210)
- locked <0x00000000f15173a0> (a sun.security.provider.SecureRandom)
at java.security.SecureRandom.nextBytes(SecureRandom.java:457)
- locked <0x00000000f15176c0> (a java.security.SecureRandom)
at java.security.SecureRandom.next(SecureRandom.java:480)
at java.util.Random.nextInt(Random.java:329)
at org.apache.catalina.util.SessionIdGenerator.createSecureRandom(SessionIdGenerator.java:246)
at org.apache.catalina.util.SessionIdGenerator.getRandomBytes(SessionIdGenerator.java:183)
at org.apache.catalina.util.SessionIdGenerator.generateSessionId(SessionIdGenerator.java:153)
at org.apache.catalina.session.ManagerBase.startInternal(ManagerBase.java:573)
at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:485)
- locked <0x00000000f1395fc0> (a org.apache.catalina.session.StandardManager)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- locked <0x00000000f1395fc0> (a org.apache.catalina.session.StandardManager)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5476)
- locked <0x00000000f675e1a8> (a org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedContext)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- locked <0x00000000f675e1a8> (a org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedContext)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
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)
"Tomcat-startStop-1" #12 daemon prio=5 os_prio=0 tid=0x00007fb65f35b000 nid=0xa45 waiting on condition [0x00007fb6801d8000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000f675e178> (a java.util.concurrent.FutureTask)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:429)
at java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
- locked <0x00000000f6705460> (a org.apache.catalina.core.StandardHost)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:799)
- locked <0x00000000f6705460> (a org.apache.catalina.core.StandardHost)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- locked <0x00000000f6705460> (a org.apache.catalina.core.StandardHost)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
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)
"DestroyJavaVM" #10 prio=5 os_prio=0 tid=0x00007fb6a0009800 nid=0xa39 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"main" #9 prio=5 os_prio=0 tid=0x00007fb6a01cf800 nid=0xa44 waiting on condition [0x00007fb6808ef000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000f6705430> (a java.util.concurrent.FutureTask)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:429)
at java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
- locked <0x00000000f675c598> (a org.apache.catalina.core.StandardEngine)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
- locked <0x00000000f675c598> (a org.apache.catalina.core.StandardEngine)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- locked <0x00000000f675c598> (a org.apache.catalina.core.StandardEngine)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
- locked <0x00000000f675c598> (a org.apache.catalina.core.StandardEngine)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- locked <0x00000000f675bc98> (a org.apache.catalina.core.StandardService)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:731)
- locked <0x00000000f675c340> (a [Lorg.apache.catalina.Service;)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
- locked <0x00000000f675bd68> (a org.apache.catalina.core.StandardServer)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:341)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:85)
- locked <0x00000000f6bbad18> (a org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:74)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:289)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:146)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:159)
- locked <0x00000000a0d8f098> (a org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:132)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:476)
- locked <0x00000000a0d8f2c8> (a java.lang.Object)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:952)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:941)
at com.smartup.SmartUpConfiguration.main(SmartUpConfiguration.java:78)
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:483)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
at java.lang.Thread.run(Thread.java:745)
"Service Thread" #7 daemon prio=9 os_prio=0 tid=0x00007fb6a0152000 nid=0xa42 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C1 CompilerThread1" #6 daemon prio=9 os_prio=0 tid=0x00007fb6a0132800 nid=0xa41 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread0" #5 daemon prio=9 os_prio=0 tid=0x00007fb6a012f800 nid=0xa40 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Signal Dispatcher" #4 daemon prio=9 os_prio=0 tid=0x00007fb6a012d800 nid=0xa3f runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" #3 daemon prio=8 os_prio=0 tid=0x00007fb6a00ff000 nid=0xa3e in Object.wait() [0x00007fb69041e000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000a0487660> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
- locked <0x00000000a0487660> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)
"Reference Handler" #2 daemon prio=10 os_prio=0 tid=0x00007fb6a00fd000 nid=0xa3d in Object.wait() [0x00007fb69051f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000a04876a0> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:502)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)
- locked <0x00000000a04876a0> (a java.lang.ref.Reference$Lock)
"VM Thread" os_prio=0 tid=0x00007fb6a00f6000 nid=0xa3c runnable
"GC task thread#0 (ParallelGC)" os_prio=0 tid=0x00007fb6a001f000 nid=0xa3a runnable
"GC task thread#1 (ParallelGC)" os_prio=0 tid=0x00007fb6a0020800 nid=0xa3b runnable
"VM Periodic Task Thread" os_prio=0 tid=0x00007fb6a0154000 nid=0xa43 waiting on condition
JNI global references: 48
公认的答案对我不起作用。所以我找到了这个答案:
Spring启动应用程序不会在docker内启动
apt-get install haveged -y
localhost试图创建一个新的SecureRandom实例,但在尝试从熵源读取数据时卡住了。这通常是因为源已经耗尽。默认的熵源是/dev/随机
。它被称为阻塞源,因为当试图读取随机数据而没有可用数据时,它会阻塞。Linux的另一个来源是/dev/urandom
。它比/dev/随机
的主要好处是它是非阻塞的。关于使用/dev/urandom
是否会降低安全性,存在一些争论。这篇文章可能会感兴趣。
总之,使用/dev/uradom
可以避免您看到的问题,但可能会降低安全性。您可以通过系统属性将Spring Boot的嵌入式Tomcat实例配置为使用/dev/uradom
:
-Djava。安全egd=文件:/dev//铀矿
我在intellij上启动spring boot应用程序时遇到问题,它失败了,并显示以下消息:与目标VM断开连接,地址:'127.0.0.1:49784',传输:'socket' 过程结束,退出代码为255。以前有人遇到过这种情况吗?
我正在尝试将Spring Boot应用程序作为WAR部署到tomcat服务器。我可以很好地构建war并将其部署到tomcat服务器。但是,当我启动服务器时,我的spring应用程序从未运行。服务器启动得很好。Spring要我做的我都做了, http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-creat
我正在docker容器中运行一个简单的spring boot应用程序。在启动时,是否从或应用程序将始终在以下时间点挂起: 这里有一个问题,我只能在数字海洋(1CPU,1GB MEM)的Ubuntu 14.04盒子上重现这个,即使它在容器中运行。在我的本地机器上,一切都运行良好。 Dockerfile文件: 我尝试过的事情 给JVM更多内存(占机器总数的75%) 按这里建议的方式停止库 我能接触到的
问题内容: 我使用JSP构建Web应用程序,并且在我的servlet中,我具有: 到现在为止,当JSP页面调用like时,我的serlvet都被调用了。我想要的是每当应用程序启动时也要执行的servlet。我可以在第一页上有一个类似“ START”的按钮,并在那里调用servlet。但是,我可以避免这种情况吗? 问题答案: 无论您想在启动时做什么,都应该由实现的类完成,因此您应该编写这样的类,例如
我下面介绍了spring的RESTAPI,但我无法让它在tomcat服务器上运行(尝试了tomcat 7和9)。在eclipse中,我确实以- 编辑 尝试在项目上安装mvn,然后java-jarproject.jar 编辑2 我将项目导出到一个可运行的jar(并将所需的库打包到生成的jar中),但是 提供 编辑3 我没有删除我的m2,因为那里有很多东西,但我现在通过eclipse的spring工具
问题内容: 我一直在研究Spring / Spring MVC应用程序,并且希望添加性能指标。我遇到过Spring Boot Actuator,它看起来是一个不错的解决方案。但是我的应用程序不是Spring Boot应用程序。我的应用程序在传统容器Tomcat 8中运行。 我添加了以下依赖 我创建了以下配置类。 我什至可以按照StackOverflow另一篇文章的建议在每个配置类上添加 问题答案: