我正在尝试通过使用将我的spring boot应用程序上传到Heroku
Heroku插件部署。
一旦我运行以下命令:mvn heroku:deploy
构建成功完成,但应用程序不再启动!。
注意:我没有Procfile,因为我正在使用Heroku插件。
使用Procfile
时,我仍然会遇到相同的错误! (这需要将代码推送到git并将代码推送到Heroku,以不同的方式...但是也会遇到相同的错误!。)
我在日志中收到此错误:
2018-09-29T14:47:09.466787+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1322) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.466788+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1288) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.466789+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1215) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.466791+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1093) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.466792+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory$DependencyObjectProvider.getIfAvailable(DefaultListableBeanFactory.java:1706) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.466794+00:00 app[web.1]: at org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration.<init>(DataSourceHealthIndicatorAutoConfiguration.java:77) ~[spring-boot-actuator-autoconfigure-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.466795+00:00 app[web.1]: at org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration$$EnhancerBySpringCGLIB$$a0096270.<init>(<generated>) ~[spring-boot-actuator-autoconfigure-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.466796+00:00 app[web.1]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.466798+00:00 app[web.1]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.466799+00:00 app[web.1]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.466800+00:00 app[web.1]: at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.466802+00:00 app[web.1]: at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:170) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.466803+00:00 app[web.1]: at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.466804+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:275) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.466806+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1267) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.466807+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1124) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.466809+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.466810+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.466811+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.466815+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467047+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467049+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467050+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:372) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467055+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1247) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467057+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1096) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467058+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467059+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467060+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467062+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467063+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467064+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467066+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:514) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467067+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:502) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467068+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1198) ~[spring-context-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467069+00:00 app[web.1]: at org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorBeansComposite.get(HealthIndicatorBeansComposite.java:46) ~[spring-boot-actuator-autoconfigure-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467071+00:00 app[web.1]: at org.springframework.boot.actuate.autoconfigure.health.HealthEndpointConfiguration.healthEndpoint(HealthEndpointConfiguration.java:38) ~[spring-boot-actuator-autoconfigure-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467072+00:00 app[web.1]: at org.springframework.boot.actuate.autoconfigure.health.HealthEndpointConfiguration$$EnhancerBySpringCGLIB$$4dc5c6cd.CGLIB$healthEndpoint$0(<generated>) ~[spring-boot-actuator-autoconfigure-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467082+00:00 app[web.1]: at org.springframework.boot.actuate.autoconfigure.health.HealthEndpointConfiguration$$EnhancerBySpringCGLIB$$4dc5c6cd.healthEndpoint(<generated>) ~[spring-boot-actuator-autoconfigure-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467081+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:365) ~[spring-context-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467080+00:00 app[web.1]: at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467084+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.467078+00:00 app[web.1]: at org.springframework.boot.actuate.autoconfigure.health.HealthEndpointConfiguration$$EnhancerBySpringCGLIB$$4dc5c6cd$$FastClassBySpringCGLIB$$d5ba48f1.invoke(<generated>) ~[spring-boot-actuator-autoconfigure-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467105+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.467199+00:00 app[web.1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.467201+00:00 app[web.1]: at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.467203+00:00 app[web.1]: at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467204+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:582) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467205+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1247) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467206+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1096) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467208+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467209+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467210+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467211+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467213+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467214+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467216+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1089) ~[spring-context-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467217+00:00 app[web.1]: at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.createEndpointBean(EndpointDiscoverer.java:143) ~[spring-boot-actuator-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467218+00:00 app[web.1]: at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.createEndpointBeans(EndpointDiscoverer.java:132) ~[spring-boot-actuator-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467219+00:00 app[web.1]: at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.discoverEndpoints(EndpointDiscoverer.java:122) ~[spring-boot-actuator-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467221+00:00 app[web.1]: at org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer.getEndpoints(EndpointDiscoverer.java:116) ~[spring-boot-actuator-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467222+00:00 app[web.1]: at org.springframework.boot.actuate.autoconfigure.endpoint.web.ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.servletEndpointRegistrar(ServletEndpointManagementContextConfiguration.java:75) ~[spring-boot-actuator-autoconfigure-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467223+00:00 app[web.1]: at org.springframework.boot.actuate.autoconfigure.endpoint.web.ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration$$EnhancerBySpringCGLIB$$e75968c5.CGLIB$servletEndpointRegistrar$0(<generated>) ~[spring-boot-actuator-autoconfigure-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467225+00:00 app[web.1]: at org.springframework.boot.actuate.autoconfigure.endpoint.web.ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration$$EnhancerBySpringCGLIB$$e75968c5$$FastClassBySpringCGLIB$$b10d5d4d.invoke(<generated>) ~[spring-boot-actuator-autoconfigure-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467226+00:00 app[web.1]: at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467231+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:365) ~[spring-context-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467419+00:00 app[web.1]: at org.springframework.boot.actuate.autoconfigure.endpoint.web.ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration$$EnhancerBySpringCGLIB$$e75968c5.servletEndpointRegistrar(<generated>) ~[spring-boot-actuator-autoconfigure-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467422+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.467423+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.467424+00:00 app[web.1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.467427+00:00 app[web.1]: at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467426+00:00 app[web.1]: at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.467428+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:582) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467430+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1247) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467432+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467431+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1096) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467434+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467435+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467436+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467438+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467439+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204) ~[spring-beans-5.0.9.RELEASE.jar!/:5.0.9.RELEASE]
2018-09-29T14:47:09.467440+00:00 app[web.1]: at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:226) ~[spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467441+00:00 app[web.1]: at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:214) ~[spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467443+00:00 app[web.1]: at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addServletContextInitializerBeans(ServletContextInitializerBeans.java:91) ~[spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467444+00:00 app[web.1]: at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:80) ~[spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467445+00:00 app[web.1]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:250) ~[spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467446+00:00 app[web.1]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:237) ~[spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467448+00:00 app[web.1]: at org.springframework.boot.web.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:54) ~[spring-boot-2.0.5.RELEASE.jar!/:2.0.5.RELEASE]
2018-09-29T14:47:09.467449+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5245) ~[tomcat-embed-core-8.5.34.jar!/:8.5.34]
2018-09-29T14:47:09.467452+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.34.jar!/:8.5.34]
2018-09-29T14:47:09.467468+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420) ~[tomcat-embed-core-8.5.34.jar!/:8.5.34]
2018-09-29T14:47:09.467470+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410) ~[tomcat-embed-core-8.5.34.jar!/:8.5.34]
2018-09-29T14:47:09.467471+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.467473+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.467474+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.467476+00:00 app[web.1]: at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_181-heroku]
2018-09-29T14:47:09.467477+00:00 app[web.1]:
2018-09-29T14:47:09.632814+00:00 heroku[web.1]: State changed from starting to crashed
2018-09-29T14:47:09.616643+00:00 heroku[web.1]: Process exited with status 1
2018-09-29T14:47:11.329023+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/UserManagementsMS/v1/login/UserInfo" host=springtest2018.herokuapp.com request_id=38b49b15-b1a4-4c24-99b3-0a09c045b75c fwd="89.138.131.176" dyno= connect= service= status=503 bytes= protocol=https
2018-09-29T14:47:11.924356+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=springtest2018.herokuapp.com request_id=502fb75e-91b7-4926-b5c4-0cdf1fc6cfe1 fwd="89.138.131.176" dyno= connect= service= status=503 bytes= protocol=https
2018-09-29T14:51:27.771084+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=springtest2018.herokuapp.com request_id=007000a2-22d6-4d45-b818-3a37dcbf5129 fwd="89.138.131.176" dyno= connect= service= status=503 bytes= protocol=https
^COsaids-MacBook-Pro:user-managment-ms-v1 osaidwattad$ mvn heroku:deploy
我的POM.XML:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ims.ms</groupId>
<artifactId>user-managment-ms-v1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>user-managment-ms-v1</name>
<description>user-managment-ms-v1</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<full-artifact-name>target/${project.artifactId}-${project.version}.jar</full-artifact-name>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- this changes for Heroku connection , building and connection to DB -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.jscience</groupId>
<artifactId>jscience</artifactId>
<version>4.3.1</version>
</dependency>
<!-- end of Heroku configurations -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.4.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.heroku.sdk</groupId>
<artifactId>heroku-maven-plugin</artifactId>
<configuration>
<appName>springtest2018</appName>
<includeTarget>false</includeTarget>
<includes>
<include>${basedir}/${full-artifact-name}</include>
</includes>
<jdkVersion>1.8</jdkVersion>
<processTypes>
<web>java $JAVA_OPTS -jar ${full-artifact-name}</web>
</processTypes>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
答案 0 :(得分:1)
尝试将带有heroku / jvm的buildpack部分添加到您的插件配置中:
<buildpacks>
<buildpack>heroku/jvm</buildpack>
</buildpacks>
然后将server.port设置为$ PORT heroku env变量,如下例所示:
<processTypes>
<web>java -Dserver.port=$PORT -jar ${full-artifact-name}</web>
</processTypes>
所有更改之后,看起来应该像这样:
<plugin>
<groupId>com.heroku.sdk</groupId>
<artifactId>heroku-maven-plugin</artifactId>
<configuration>
<appName>springtest2018</appName>
<includeTarget>false</includeTarget>
<buildpacks>
<buildpack>heroku/jvm</buildpack>
</buildpacks>
<includes>
<include>${basedir}/${full-artifact-name}</include>
</includes>
<jdkVersion>1.8</jdkVersion>
<processTypes>
<web>java -Dserver.port=$PORT -jar ${full-artifact-name}</web>
</processTypes>
</configuration>
</plugin>