File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
aws-serverless-java-container-springboot3/src/main/java/com/amazonaws/serverless/proxy/spring Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1818import org .slf4j .LoggerFactory ;
1919import org .springframework .boot .WebApplicationType ;
2020import org .springframework .boot .builder .SpringApplicationBuilder ;
21- import org .springframework .boot . web .servlet . context .AnnotationConfigServletWebServerApplicationContext ;
21+ import org .springframework .web .context .ConfigurableWebApplicationContext ;
2222import org .springframework .context .ConfigurableApplicationContext ;
2323
2424import com .amazonaws .serverless .exceptions .ContainerInitializationException ;
@@ -192,12 +192,15 @@ public void initialize()
192192
193193 SpringApplicationBuilder builder = new SpringApplicationBuilder (getEmbeddedContainerClasses ())
194194 .web (springWebApplicationType ); // .REACTIVE, .SERVLET
195+ if (springBootInitializer != null ) {
196+ builder .main (springBootInitializer );
197+ }
195198 if (springProfiles != null ) {
196199 builder .profiles (springProfiles );
197200 }
198201 applicationContext = builder .run ();
199202 if (springWebApplicationType == WebApplicationType .SERVLET ) {
200- ((AnnotationConfigServletWebServerApplicationContext )applicationContext ).setServletContext (getServletContext ());
203+ ((ConfigurableWebApplicationContext )applicationContext ).setServletContext (getServletContext ());
201204 AwsServletRegistration reg = (AwsServletRegistration )getServletContext ().getServletRegistration (DISPATCHER_SERVLET_REGISTRATION_NAME );
202205 if (reg != null ) {
203206 reg .setLoadOnStartup (1 );
You can’t perform that action at this time.
0 commit comments