0
votes

I'm facing a strange issue while deploying a spring-boot legacy-war in weblogic-12c. The same war/application works in both mvn spring-boot:run (embedded-tomcat) / Standalone tomcat war deployment.

The @ImportResource configured in the main application is not getting loaded which is causing few bean-injection inconsistencies. Is there any known issue to be worked-around for deploying in weblogic12c?

Note: I've already tried below: 1. extends SpringBootServletInitializer implements WebApplicationInitializer 2. Separate inner-config class

@Configuration @ImportResource({ "classpath*:**/**my-applicationContext.xml"}) @ComponentScan(basePackages = {"com.myapp" })

  1. SLF4J exclude in weblogic.xml
<wls:prefer-application-packages>
  <wls:package-name>org.slf4j</wls:package-name>
  <wls:package-name>com.google.common.*</wls:package-name>
</wls:prefer-application-packages>
1

1 Answers

0
votes

The issue was with the Antlr pattern used for loading xml-appcontexts. Strangely the same expression worked in embedded tomcat / standalone tomcat.

The fix was to expand few of the *

@Configuration

@ImportResource({
"classpath*:mypackage/**my-applicationContext.xml"})
@ComponentScan(basePackages = {"com.myapp" })

Debug info:

AbstractBeanDefinitionReader (Line 216) - spring-beans-4.2.4