Spring引导在远程服务器上立即关闭(确实),没有错误

时间:2018-03-01 13:05:35

标签: java spring spring-boot deployment

我使用package maven插件构建了一个spring应用程序jar。在本地,我可以运行它 java -jar -Dspring.profiles.active=dev target/my.jar 并且一切正常

然后我使用scp将jar复制到远程服务器,使用ssh登录,复制了我的应用程序所需的所有资源并尝试运行。这就是我得到的:

user@server:~$ java -jar -Dspring.profiles.active=dev target/my.jar -debug
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.9.RELEASE)

[INFO ] 2018-03-01 13:37:02                  com.ws.eb.MyApplication - Starting MyApplication v1.0 with PID 16806 (/home/user/target/my.jar started by suirz in /home/user)
[DEBUG] 2018-03-01 13:37:02                  com.ws.eb.MyApplication - Running with Spring Boot v1.5.9.RELEASE, Spring v4.3.13.RELEASE
[INFO ] 2018-03-01 13:37:02                  com.ws.eb.MyApplication - The following profiles are active: dev
user@server:~$ 

没有错误消息。

我尝试使用不同的配置文件(dev / test / production),将文件的所有者更改为我并获得相同的输出。我试着用jdk-9和jdk1.8来运行它。我在IntelliJ Idea中开发。有什么不同于我的本地机器?如何打印有关错误的更多信息?

我意识到在SO上有很多类似的问题,但在每一个问题中都有一些错误信息。

dmesg输出:

[    7.803955] [drm] Max GMR ids is 64
[    7.803958] [drm] Max number of GMR pages is 65536
[    7.803960] [drm] Max dedicated hypervisor surface memory is 0 kiB
[    7.803963] [drm] Maximum display memory size is 4096 kiB
[    7.803966] [drm] VRAM at 0xe8000000 size is 4096 kiB
[    7.803969] [drm] MMIO at 0xfe000000 size is 256 kiB
[    7.806320] [drm] global init.
[    7.808880] [TTM] Zone  kernel: Available graphics memory: 4087984 kiB
[    7.808884] [TTM] Zone   dma32: Available graphics memory: 2097152 kiB
[    7.808887] [TTM] Initializing pool allocator
[    7.808897] [TTM] Initializing DMA pool allocator
[    7.811195] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    7.811202] [drm] No driver support for vblank timestamp query.
[    7.812224] [drm] Screen objects system initialized
[    7.812351] [drm] width 640
[    7.812372] [drm] height 480
[    7.812393] [drm] bpp 32
[    7.817482] [drm] Fifo max 0x00040000 min 0x00001000 cap 0x0000077f
[    7.840594] fbcon: svgadrmfb (fb0) is primary device
[    7.891478] Console: switching to colour frame buffer device 100x37
[    7.894293] [drm] Initialized vmwgfx 2.6.1 20140704 for 0000:00:0f.0 on minor 0
[    8.003994] AVX version of gcm_enc/dec engaged.
[    8.004001] AES CTR mode by8 optimization enabled
[    8.156934] audit: type=1400 audit(1515139563.865:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/sbin/dhclient" pid=589 comm="apparmor_parser"
[    8.156948] audit: type=1400 audit(1515139563.865:3): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=589 comm="apparmor_parser"
[    8.156957] audit: type=1400 audit(1515139563.865:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=589 comm="apparmor_parser"
[    8.157796] audit: type=1400 audit(1515139563.865:5): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=589 comm="apparmor_parser"
[    8.157805] audit: type=1400 audit(1515139563.865:6): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=589 comm="apparmor_parser"
[    8.158244] audit: type=1400 audit(1515139563.865:7): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=589 comm="apparmor_parser"
[    8.188649] intel_rapl: no valid rapl domains found in package 0
[    8.269314] ppdev: user-space parallel port driver
[    8.270832] vmxnet3 0000:03:00.0 eth0: intr type 3, mode 0, 5 vectors allocated
[    8.274863] vmxnet3 0000:03:00.0 eth0: NIC Link is Up 10000 Mbps
[    8.594646] init: failsafe main process (636) killed by TERM signal
[    8.708205] audit: type=1400 audit(1515139564.413:8): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/sbin/dhclient" pid=925 comm="apparmor_parser"
[    8.708231] audit: type=1400 audit(1515139564.413:9): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=925 comm="apparmor_parser"
[    8.708246] audit: type=1400 audit(1515139564.413:10): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=925 comm="apparmor_parser"
[    8.709706] audit: type=1400 audit(1515139564.417:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/tcpdump" pid=927 comm="apparmor_parser"
[   10.251903] NET: Registered protocol family 40
[  471.712509] init: tty1 main process ended, respawning

(执行jar后不会改变)

更新

  1. 我创建了一个虚拟空弹簧项目,它既可以在本地也可以在远程服务器上运行。
  2. 我已清除maven library cache
  3. 我已经重新创建了我的项目,并且删除了一些依赖项,但仍然没有运气
  4. 好消息:重新创建的项目在本地工作。也许这是关于依赖性的东西,也许是一些缺失或混淆的罐子。

    好消息2:当从Idea内部运行spring boot时,我收到一些警告信息!

    现在输出是:

    Connected to the target VM, address: '127.0.0.1:44323', transport: 'socket'
    The Class-Path manifest attribute in /home/user/.m2/repository/com/sun/xml/bind/jaxb-impl/2.2.3-1/jaxb-impl-2.2.3-1.jar referenced one or more files that do not exist: file:/home/user/.m2/repository/com/sun/xml/bind/jaxb-impl/2.2.3-1/jaxb-api.jar,file:/home/user/.m2/repository/com/sun/xml/bind/jaxb-impl/2.2.3-1/activation.jar,file:/home/user/.m2/repository/com/sun/xml/bind/jaxb-impl/2.2.3-1/jsr173_1.0_api.jar,file:/home/user/.m2/repository/com/sun/xml/bind/jaxb-impl/2.2.3-1/jaxb1-impl.jar
    The Class-Path manifest attribute in /home/user/.m2/repository/org/htmlparser/htmlparser/2.1/htmlparser-2.1.jar referenced one or more files that do not exist: file:/home/user/.m2/repository/org/htmlparser/htmlparser/2.1/sax-2.0.1.jar,file:/home/user/.m2/repository/org/htmlparser/htmlparser/2.1/htmllexer-2.1.jar
    
      .   ____          _            __ _ _
     /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
    ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
     \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
      '  |____| .__|_| |_|_| |_\__, | / / / /
     =========|_|==============|___/=/_/_/_/
     :: Spring Boot ::        (v1.5.9.RELEASE)
    
    [INFO ] 2018-03-05 11:14:03                  com.ws.my.MyApplication - Starting MyApplication on user-msi with PID 5593 (/export/home/workspace/my/employemYackend/target/classes started by user in /export/home/workspace/my)
    [DMYUG] 2018-03-05 11:14:03                  com.ws.my.MyApplication - Running with Spring Boot v1.5.9.RELEASE, Spring v4.3.13.RELEASE
    [INFO ] 2018-03-05 11:14:03                  com.ws.my.MyApplication - The following profiles are active: dev
    Disconnected from the target VM, address: '127.0.0.1:44323', transport: 'socket'
    
    Process finished with exit code 0
    

    我的pom文件

    https://pastebin.com/cKAKTriq

    新的春季启动应用程序

    https://pastebin.com/PBwmH2wZ

    旧的遗留模块(“commonJars”),有些代码日期为2003年。

    https://pastebin.com/rQ37HNLL

1 个答案:

答案 0 :(得分:0)

我发现缺少日志的问题是我创建的logback.xml来自定义日志消息。删除它后,打印出错误消息,我能够解决实际错误(这是关于tomcat无法启动的问题,与此问题无关)。