I have built a jar of a spring application using package
maven plugin. Locally, I can run it with
java -jar -Dspring.profiles.active=dev target/my.jar
and everything works.
Then I copied the jar to a remote server using scp
, logged in with ssh
, copied all resources which my application requires and tried to run. This is what i got:
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:~$
No error message.
I tried with different profiles (dev/test/production), changed owner of files to me and got the same output. I tried to run it with both jdk-9 and jdk1.8. I develop in IntelliJ Idea. What can be different from my local machine? How can I print more information on what's wrong?
I realize that there are many similar questions on SO, but in each of them ther was SOME error messages.
dmesg
output:
[ 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
(it does not change after executing jar)
UPDATE
Good news: the recreated project does not work locally. Maybe it's something about dependencies, maybe some missing or confilicting jars.
Good news 2: When running spring boot from inside Idea, I get some warning message!
Now the output is:
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
My pom files
master
new, spring boot application
old legacy module ("commonJars"), some code dates 2003.
I've found that the problem of absence of logs was in a logback.xml
which I created to customize log messages. After deleting it, error messages were printed and I was able to resolve actual errors (it was something about tomcat not starting, not really relevant to this question).
User contributions licensed under CC BY-SA 3.0