Relating to my first question which is this I supplied the data in application.properties file and then somehow the app started and then suddenly it shut down without any reason. Please check below stacktrace. This is the pom.xml file again sharing with you
<plugin>
<groupId>.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${springboot.version}</version>
<configuration>
<jvmArguments>-Dspring.application.admin.enabled=true</jvmArguments>
<jvmArguments>-Dspring-boot.run.profiles=ci</jvmArguments>
<profiles>
<profiles>${app.profiles}</profiles>
</profiles>
</configuration>
<executions>
<execution>
<id>pre-integration-test</id>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>post-integration-test</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>.springdoc</groupId>
<artifactId>springdoc-openapi-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<apiDocsUrl>http://localhost:9999/some-service/v3/api-docs</apiDocsUrl>
<outputFileName>swagger.json</outputFileName>
</configuration>
</plugin>
2025-03-24 13:26:31,794 [lbgConsumerExecutor-thread-3] INFO [LogWrapper:63 ] - Client-1:jmsSession-3: SolSession started.
2025-03-24 13:26:31,796 [lbgConsumerExecutor-thread-3] INFO [LogWrapper:63 ] - Client-1:jmsSession-2: SolSession started.
2025-03-24 13:26:31,797 [lbgConsumerExecutor-thread-3] INFO [LogWrapper:63 ] - Client-1:jmsSession-1: SolSession started.
2025-03-24 13:26:31,879 [main ] INFO [DefaultSecurityFilterChain:51 ] - Will secure any request with [.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@5acf07e7, .springframework.security.web.context.SecurityContextPersistenceFilter@61f9cab2, .springframework.security.web.header.HeaderWriterFilter@68a4129d, .springframework.security.web.authentication.logout.LogoutFilter@46b4cddb, com.hsbc.ocs.auth.RequestLoggingFilter@3c4ad54, com.hsbc.ocs.logs.correlation.CorrelationIdAppenderFilter@42c8f458, .springframework.security.web.savedrequest.RequestCacheAwareFilter@36fb5ba, .springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@13cdfd26, .springframework.security.web.authentication.AnonymousAuthenticationFilter@1334a246, .springframework.security.web.session.SessionManagementFilter@411acaed, .springframework.security.web.access.ExceptionTranslationFilter@1946d235, .springframework.security.web.access.intercept.FilterSecurityInterceptor@306cb0a0]
2025-03-24 13:26:33,872 [main ] INFO [EndpointLinksResolver:58 ] - Exposing 5 endpoint(s) beneath base path '/actuator'
2025-03-24 13:26:33,937 [main ] INFO [?:? ] - Starting ProtocolHandler ["http-nio-3050"]
2025-03-24 13:26:33,961 [main ] INFO [TomcatWebServer:220 ] - Tomcat started on port(s): 3050 (http) with context path '/some-service'
2025-03-24 13:26:33,987 [main ] INFO [SomeFlow:64 ] - Subscribing to SomeFlow
2025-03-24 13:26:33,987 [main ] INFO [SomeFlow:33 ] - Observing processed erfqs
2025-03-24 13:26:33,989 [main ] INFO [StartupInfoLogger:61 ] - Started Application in 43.649 seconds (JVM running for 44.304)
2025-03-24 13:26:33,999 [main ] INFO [Application:62 ] - some-service complete! Active profiles : [ci]
Exception in thread "main" java.lang.IllegalStateException: Shutdown in progress
at java.base/java.lang.ApplicationShutdownHooks.add(ApplicationShutdownHooks.java:66)
at java.base/java.lang.Runtime.addShutdownHook(Runtime.java:216)
at .springframework.context.support.AbstractApplicationContext.registerShutdownHook(AbstractApplicationContext.java:995)
at com.abcd.ocs.someservice.Application.start(Application.java:63)
at com.abcd.ocs.someservice.Application.main(Application.java:46)
2025-03-24 13:26:59,659 [SpringApplicationShutdownHook] INFO [LogWrapper:63 ] - Client-1:jmsSession-3: SolSession stopped.
2025-03-24 13:26:59,660 [SpringApplicationShutdownHook] INFO [LogWrapper:63 ] - Client-1:jmsSession-2: SolSession stopped.
2025-03-24 13:26:59,660 [SpringApplicationShutdownHook] INFO [LogWrapper:63 ] - Client-1:jmsSession-1: SolSession stopped.
2025-03-24 13:26:59,662 [SpringApplicationShutdownHook] INFO [LogWrapper:63 ] - Client-1: Channel Closed (smfclient 1)
2025-03-24 13:26:59,662 [SpringApplicationShutdownHook] INFO [SSLSmfClient:171 ] - closeOutbound() : isSslDowngradeEnabled: false, mSslEngineClosed: false
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:11 min
[INFO] Finished at: 2025-03-24T13:27:03+00:00
[INFO] Final Memory: 127M/544M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal .springframework.boot:spring-boot-maven-plugin:2.5.7:start (pre-integration-test) on project some-service: Could not figure out if the application has started: Failed to connect to MBean server at port 9001: Could not invoke shutdown operation: Spring application did not start before the configured timeout (30000ms -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
I have supplied the most of the required values in properties file and then the application started up but I think it should take the profile and then pickup the properties file accordingly and then start the app.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744216413a4563574.html
评论列表(0条)