-1

I have deployed stand alone jar on Linux server in production about 6 month ago. Its starting in about few seconds. But when I deploy a newly builded jar on same server. It takes around 30-45 minutes for getting started.

Due to this I am not able to change any thing on existing setup.

I tried to start a Hello World spring boot app on same server. Its also taking 2 minutes for getting started.

Hello World App Logs:

[support@kbla180303 ~]$ java -jar /app/kpam/kpam-test.jar
Inside Main

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.4.RELEASE)

2019-05-09 13:26:42.606  INFO 1656 --- [           main] com.kmbl.kpam.KpamTest1Application       : Starting KpamTest1Application v0.0.1-SNAPSHOT on kbla180303 with PID 1656 (/app/kpam/kpam-test.jar started by support in /home/support)
2019-05-09 13:26:43.110  INFO 1656 --- [           main] com.kmbl.kpam.KpamTest1Application       : No active profile set, falling back to default profiles: default
2019-05-09 13:26:50.058  INFO 1656 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@531d72ca: startup date [Thu May 09 13:26:50 IST 2019]; root of context hierarchy
2019-05-09 13:27:52.515  INFO 1656 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2019-05-09 13:27:53.905  INFO 1656 --- [           main] com.kmbl.kpam.KpamTest1Application       : Started KpamTest1Application in 122.87 seconds (JVM running for 164.207)
Exit Main
2019-05-09 13:27:53.907  INFO 1656 --- [       Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@531d72ca: startup date [Thu May 09 13:26:50 IST 2019]; root of context hierarchy
2019-05-09 13:27:53.910  INFO 1656 --- [       Thread-2] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
shubham jain
  • 84
  • 1
  • 9
  • Can you show us the LOG? – Simon Martinelli May 09 '19 at 07:51
  • Added logs in question. – shubham jain May 09 '19 at 08:01
  • @shubhamjain If the same application takes very less time in local, then check your server free space. – Satz May 09 '19 at 08:49
  • @Satz It has over 95 GB free space. And old jars are getting started within few seconds. – shubham jain May 09 '19 at 08:51
  • @shubhamjain In your new jar, Have you implemented any external system connection like a new DB or downstream system. If yes, then check that connection logic in Server. – Satz May 09 '19 at 08:55
  • @Satz New jar contains below code. Still it takes 120 seconds. public class KpamTest1Application { public static void main(String[] args) { System.out.println("Inside Main"); SpringApplication.run(KpamTest1Application.class, args); System.out.println("Exit Main"); } } – shubham jain May 09 '19 at 08:58
  • Make sure your issue isn't related to [this question](https://stackoverflow.com/questions/39636792) either. – g00glen00b May 10 '19 at 06:10
  • @g00glen00b It not related to given question. I am creating a stand alone jar. There is no use of IP. – shubham jain May 13 '19 at 05:47
  • @shubhamjain Yes there is, Spring boot uses it behind the screens. ([Source](https://github.com/spring-projects/spring-boot/blob/f1786c357bee391ad48c32139a01a6c95324e396/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/StartupInfoLogger.java#L114)) You can also read [this related issue](https://github.com/spring-projects/spring-boot/issues/7087), – g00glen00b May 13 '19 at 06:00
  • @g00glen00b Then why old jars are running withing few seconds. – shubham jain May 13 '19 at 06:01
  • @shubhamjain Considering that that information is nowhere within your question, make sure to edit it into your question. You've mentioned that you ran an app on that server 6 months ago, in those 6 months, a lot could have changed to your Linux server configuration. – g00glen00b May 13 '19 at 06:05
  • Too late now since you've upgraded and solved it but the only way to get to the root cause would have been to take a thread dump and look for the stuck thread, or connect remotely with a debugger and suspend all the threads. – Andy Brown May 16 '19 at 08:49

1 Answers1

0

I have updated the spring boot version from 1.5.4.RELEASE to 2.1.4.RELEASE. Now application is starting in few seconds. But still not found the root cause for this issue.

shubham jain
  • 84
  • 1
  • 9