Heroku上的Springboot应用程序

时间:2018-04-13 17:01:37

标签: tomcat spring-boot heroku

我正在尝试在Heroku上部署Spring启动应用程序,这会在部署应用程序后抛出以下错误。

Report Descriptor: (length is 273)
        Item(Global): Usage Page, data= [ 0x0c ] 12
                        Consumer
        Item(Local ): Usage, data= [ 0x01 ] 1
                        Consumer Control
        Item(Main  ): Collection, data= [ 0x01 ] 1
                        Application
        Item(Global): Report ID, data= [ 0x01 ] 1
        Item(Global): Usage Page, data= [ 0x0c ] 12
                        Consumer
        Item(Global): Logical Minimum, data= [ 0x00 ] 0
        Item(Global): Logical Maximum, data= [ 0x01 ] 1
        Item(Local ): Usage, data= [ 0xea ] 234
                        Volume Decrement
        Item(Local ): Usage, data= [ 0xe9 ] 233
                        Volume Increment
        Item(Local ): Usage, data= [ 0xe2 ] 226
                        Mute
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x03 ] 3
        Item(Main  ): Input, data= [ 0x02 ] 2
                        Data Variable Absolute No_Wrap Linear
                        Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x05 ] 5
        Item(Main  ): Input, data= [ 0x01 ] 1
                        Constant Array Absolute No_Wrap Linear
                        Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Main  ): End Collection, data=none
        Item(Global): Usage Page, data= [ 0x00 0xff ] 65280
                        (null)
        Item(Local ): Usage, data= [ 0x01 ] 1
                        (null)
        Item(Main  ): Collection, data= [ 0x01 ] 1
                        Application
        Item(Global): Report ID, data= [ 0x02 ] 2
        Item(Local ): Usage, data= [ 0x01 ] 1
                        (null)
        Item(Global): Logical Minimum, data= [ 0x00 ] 0
        Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
        Item(Global): Report Size, data= [ 0x08 ] 8
        Item(Global): Report Count, data= [ 0x20 ] 32
        Item(Main  ): Output, data= [ 0x02 0x01 ] 258
                        Data Variable Absolute No_Wrap Linear
                        Preferred_State No_Null_Position Non_Volatile Buffered Bytes
        Item(Local ): Usage, data= [ 0x01 ] 1
                        (null)
        Item(Global): Logical Minimum, data= [ 0x00 ] 0
        Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
        Item(Global): Report Size, data= [ 0x08 ] 8
        Item(Global): Report Count, data= [ 0x20 ] 32
        Item(Main  ): Input, data= [ 0x02 0x01 ] 258
                        Data Variable Absolute No_Wrap Linear
                        Preferred_State No_Null_Position Non_Volatile Buffered Bytes
        Item(Global): Report ID, data= [ 0x04 ] 4
        Item(Global): Usage Page, data= [ 0x30 0xff ] 65328
                        (null)
        Item(Global): Logical Minimum, data= [ 0x00 ] 0
        Item(Global): Logical Maximum, data= [ 0x01 ] 1
        Item(Local ): Usage, data= [ 0x20 ] 32
                        (null)
        Item(Local ): Usage, data= [ 0x97 ] 151
                        (null)
        Item(Local ): Usage, data= [ 0x2b ] 43
                        (null)
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x03 ] 3
        Item(Main  ): Input, data= [ 0x23 ] 35
                        Constant Variable Absolute No_Wrap Linear
                        No_Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Local ): Usage, data= [ 0x2f ] 47
                        (null)
        Item(Local ): Usage, data= [ 0x21 ] 33
                        (null)
        Item(Local ): Usage, data= [ 0x24 ] 36
                        (null)
        Item(Local ): Usage, data= [ 0xfd 0xff ] 65533
                        (null)
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x04 ] 4
        Item(Main  ): Input, data= [ 0x07 ] 7
                        Constant Variable Relative No_Wrap Linear
                        Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x09 ] 9
        Item(Main  ): Input, data= [ 0x01 ] 1
                        Constant Array Absolute No_Wrap Linear
                        Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Local ): Usage, data= [ 0xff 0xff ] 65535
                        (null)
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x01 ] 1
        Item(Main  ): Feature, data= [ 0x22 ] 34
                        Data Variable Absolute No_Wrap Linear
                        No_Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x07 ] 7
        Item(Main  ): Feature, data= [ 0x01 ] 1
                        Constant Array Absolute No_Wrap Linear
                        Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Global): Usage Page, data= [ 0x40 0xff ] 65344
                        (null)
        Item(Global): Logical Minimum, data= [ 0x00 ] 0
        Item(Global): Logical Maximum, data= [ 0x01 ] 1
        Item(Local ): Usage, data= [ 0x17 ] 23
                        (null)
        Item(Local ): Usage, data= [ 0x1e ] 30
                        (null)
        Item(Local ): Usage, data= [ 0x09 ] 9
                        (null)
        Item(Local ): Usage, data= [ 0x18 ] 24
                        (null)
        Item(Local ): Usage, data= [ 0x20 ] 32
                        (null)
        Item(Local ): Usage, data= [ 0x21 ] 33
                        (null)
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x06 ] 6
        Item(Main  ): Output, data= [ 0x22 ] 34
                        Data Variable Absolute No_Wrap Linear
                        No_Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Global): Usage Page, data= [ 0x30 0xff ] 65328
                        (null)
        Item(Global): Logical Minimum, data= [ 0x00 ] 0
        Item(Global): Logical Maximum, data= [ 0x01 ] 1
        Item(Local ): Usage, data= [ 0x9e ] 158
                        (null)
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x01 ] 1
        Item(Main  ): Output, data= [ 0x22 ] 34
                        Data Variable Absolute No_Wrap Linear
                        No_Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x09 ] 9
        Item(Main  ): Output, data= [ 0x01 ] 1
                        Constant Array Absolute No_Wrap Linear
                        Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Main  ): End Collection, data=none
        Item(Global): Usage Page, data= [ 0x0b ] 11
                        Telephony
        Item(Local ): Usage, data= [ 0x05 ] 5
                        Headset
        Item(Main  ): Collection, data= [ 0x01 ] 1
                        Application
        Item(Global): Report ID, data= [ 0x03 ] 3
        Item(Global): Usage Page, data= [ 0x0b ] 11
                        Telephony
        Item(Global): Logical Minimum, data= [ 0x00 ] 0
        Item(Global): Logical Maximum, data= [ 0x01 ] 1
        Item(Local ): Usage, data= [ 0x20 ] 32
                        Hook Switch
        Item(Local ): Usage, data= [ 0x97 ] 151
                        Line Busy Tone
        Item(Local ): Usage, data= [ 0x2b ] 43
                        Speaker Phone
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x03 ] 3
        Item(Main  ): Input, data= [ 0x23 ] 35
                        Constant Variable Absolute No_Wrap Linear
                        No_Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Local ): Usage, data= [ 0x2f ] 47
                        Phone Mute
        Item(Local ): Usage, data= [ 0x21 ] 33
                        Flash
        Item(Local ): Usage, data= [ 0x24 ] 36
                        Redial
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x03 ] 3
        Item(Main  ): Input, data= [ 0x07 ] 7
                        Constant Variable Relative No_Wrap Linear
                        Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Local ): Usage, data= [ 0x07 ] 7
                        Programmable Button
        Item(Global): Usage Page, data= [ 0x09 ] 9
                        Buttons
        Item(Local ): Usage, data= [ 0x01 ] 1
                        Button 1 (Primary)
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x01 ] 1
        Item(Main  ): Input, data= [ 0x02 ] 2
                        Data Variable Absolute No_Wrap Linear
                        Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Global): Report Count, data= [ 0x09 ] 9
        Item(Main  ): Input, data= [ 0x01 ] 1
                        Constant Array Absolute No_Wrap Linear
                        Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Global): Usage Page, data= [ 0x08 ] 8
                        LEDs
        Item(Global): Logical Minimum, data= [ 0x00 ] 0
        Item(Global): Logical Maximum, data= [ 0x01 ] 1
        Item(Local ): Usage, data= [ 0x17 ] 23
                        Off-Hook
        Item(Local ): Usage, data= [ 0x1e ] 30
                        Speaker
        Item(Local ): Usage, data= [ 0x09 ] 9
                        Mute
        Item(Local ): Usage, data= [ 0x18 ] 24
                        Ring
        Item(Local ): Usage, data= [ 0x20 ] 32
                        Hold
        Item(Local ): Usage, data= [ 0x21 ] 33
                        Microphone
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x06 ] 6
        Item(Main  ): Output, data= [ 0x22 ] 34
                        Data Variable Absolute No_Wrap Linear
                        No_Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Global): Usage Page, data= [ 0x0b ] 11
                        Telephony
        Item(Global): Logical Minimum, data= [ 0x00 ] 0
        Item(Global): Logical Maximum, data= [ 0x01 ] 1
        Item(Local ): Usage, data= [ 0x9e ] 158
                        (null)
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x01 ] 1
        Item(Main  ): Output, data= [ 0x22 ] 34
                        Data Variable Absolute No_Wrap Linear
                        No_Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Global): Report Size, data= [ 0x01 ] 1
        Item(Global): Report Count, data= [ 0x09 ] 9
        Item(Main  ): Output, data= [ 0x01 ] 1
                        Constant Array Absolute No_Wrap Linear
                        Preferred_State No_Null_Position Non_Volatile Bitfield
        Item(Main  ): End Collection, data=none

下面的日志告诉我们在proc文件

中手动提供的端口8085上的deployement成功
2018-04-13T16:47:42.573257Z system[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2018-04-13T16:47:42.573323Z system[web.1]: Stopping process with SIGTERM
2018-04-13T16:47:42.5788Z app[web.1]: 2018-04-13 16:47:42.577  INFO 26 --- [       Thread-3] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@75a1cd57: startup date [Fri Apr 13 16:46:43 UTC 2018]; root of context hierarchy
2018-04-13T16:47:42.585423Z app[web.1]: 2018-04-13 16:47:42.585  INFO 26 --- [       Thread-3] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2018-04-13T16:47:43.574239Z system[web.1]: Process exited (exit status 143)
2018-04-13T16:47:43.596277+00:00 system[web.1]: State changed from starting to crashed

procfile:

2018-04-13T16:46:47.276958Z app[web.1]: 2018-04-13 16:46:47.276  INFO 26 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8085 (http)

感谢任何帮助

修改

@ jusermar10感谢您的回复。是的,我正在尝试设置staic端口,并且不想使用由@ user3314492指向的heroku分配的端口。我知道动态端口方法工作正常。我们面临的问题是我们正在尝试使用nginx代理进行缓存,使用https://github.com/theoephraim/nginx-buildpack处的builpack。如果我们使用动态端口,nginx配置文件也会使用它,这就是它抛出以下错误的原因

web: java -Dserver.port=8085 -jar target/app.war

2 个答案:

答案 0 :(得分:0)

请在--server.port=$PORT中将服务器端口更改为Procfile。 Heroku将为您动态分配端口。

答案 1 :(得分:0)

您可以这样设置端口,它将在-Dserver.port=${PORT:8085}

下工作