0

I'm moving my application from my dev environment to my test environment.

What is the same:

  • Weblogic version (10.3.6)
  • Weblogic-hosted libraries (none)
  • data source JNDI name

What is different:

  • dev is 1 server behind a proxy; test is 2 servers behind a proxy, both pointing to the same DB
  • different database instances (but same schema)
  • our application is isolated in dev, but colocated in test (several apps running on the server)

Stack trace and configuration files are below.

It looks to me like, WegLogic is trying to open my Main class (TctWebApplication) as an xml context file, and failing because A) it's not XML, and B) there is no file called TctWebApplication -- just a class definition on the classpath which a Java classloader would be able to find.

As far as we can tell, none of the other applications colocated with us are using Spring, so none of them should be setting any old Spring property that limits it to XML configuration.

What else could cause this?

This SO question looks superficially similar, but it isn't quite the same, and we're not running on the Weblogic version where that issue was introduced. I haven't found anything else that looks similar yet.

Note that although I have some Maven configuration for deploying directly to Weblogic, I am instead manually deploying through the Weglogic console. Just in case that's relevant.

The stack trace I'm getting in test:

15:48:26.612 [[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loadi
ng XML bean definitions from ServletContext resource [/<package name redacted>.TctWebApplication]
15:48:26.627 [[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR org.springframework.web.context.ContextLoader - Context initializati
on failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/<package name redacted>.TctWebApplication
]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/<package name redacted>.TctWebApplication]
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
        at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
        at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
        at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1871)
        at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3173)
        at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1529)
        at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:488)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
        at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
        at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
        at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
        at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
        at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
        at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:671)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
        at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
        at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:44)
        at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
        at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:573)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
        at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:149)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:327)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
        at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
        at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
        at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:550)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:263)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/<package name redacted>.TctWebApplication]
        at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:117)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
        ... 50 common frames omitted
<Jun 7, 2017 3:48:26 PM EDT> <Warning> <HTTP> <BEA-101162> <User defined listener org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener failed: or
g.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/<package name redacted>.TctWebApplication];
 nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/<package name redacted>.TctWebApplication].
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/<package name redacted>.TctWebApplication
]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/<package name redacted>.TctWebApplication]
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
        Truncated. see log file for complete stacktrace
Caused By: java.io.FileNotFoundException: Could not open ServletContext resource [/<package name redacted>.TctWebApplication]
        at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:117)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
        Truncated. see log file for complete stacktrace

web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value><-- package name redacted-->.TctWebApplication</param-value>
    </context-param>

    <listener>
        <listener-class>org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener</listener-class>
    </listener>

    <context-param>
        <!-- file to load -->
        <param-name>log4j-init-file</param-name>
        <param-value>log4j.xml</param-value>
    </context-param>
    <context-param>
        <!-- load from classpath -->
        <param-name>load-config-with-classloader</param-name>
        <param-value>true</param-value>
    </context-param>

    <listener>
        <listener-class><-- package name redacted-->.Log4jContextListener
        </listener-class>
    </listener>

    <servlet>
        <servlet-name>appServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextAttribute</param-name>
            <param-value>org.springframework.web.context.WebApplicationContext.ROOT</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>appServlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>

    <filter>
        <filter-name>SecurityFilter</filter-name>
        <filter-class><-- package name redacted-->.SecurityFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>SecurityFilter</filter-name>
        <url-pattern>/api/*</url-pattern>
    </filter-mapping>

    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/api/*</url-pattern>
    </filter-mapping>
</web-app>

weblogic.xml:

<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee         http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd         http://xmlns.oracle.com/weblogic/weblogic-web-app         http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd">
    <wls:context-root>tct</wls:context-root>
    <wls:container-descriptor>
        <wls:prefer-application-packages>
            <wls:package-name>org.slf4j</wls:package-name>
            <wls:package-name>javax.persistence</wls:package-name>
            <wls:package-name>org.eclipse.persistence.*</wls:package-name>
            <wls:package-name>org.joda.*</wls:package-name>
        </wls:prefer-application-packages>
    </wls:container-descriptor>
</wls:weblogic-web-app>

TctWebApplication.java:

@SpringBootApplication
@Import({ JpaConfiguration.class, ReportingConfiguration.class })
@ImportResource("classpath:applicationContext-security.xml")
public class TctWebApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
    private Logger logger = LoggerFactory.getLogger(TctWebApplication.class);

    public static void main(String[] args) {
        TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
        SpringApplication.run(TctWebApplication.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(TctWebApplication.class);
    }
}

web project pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <artifactId>tct-web</artifactId>
    <packaging>war</packaging>

    <name>TCT Web</name>
    <description>Web interface for the TCT application</description>

    <parent>
        <groupId><-- group id redacted --></groupId>
        <artifactId>travel-comp-time</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <relativePath>..</relativePath>
    </parent>

    <properties>
        <start-class><-- package name redacted -->.TctWebApplication</start-class>
    </properties>

    <dependencies>
        <dependency>
            <groupId><-- group id redacted --></groupId>
            <artifactId>tct-data</artifactId>
        </dependency>
        <dependency>
            <groupId><-- group id redacted --></groupId>
            <artifactId>tct-security</artifactId>
        </dependency>
        <dependency>
            <groupId><-- group id redacted --></groupId>
            <artifactId>tct-reporting</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>log4j-over-slf4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-legacy</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
            <!-- This ensures that the Tomcat starter doesn't interfere with WebLogic's 
                servlet container -->
        </dependency>

        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports-fonts</artifactId>
            <version>5.6.1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery</artifactId>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery-ui</artifactId>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>bootstrap</artifactId>
        </dependency>


        <dependency>
            <groupId><-- group id redacted --></groupId>
            <artifactId>ws-sec</artifactId>
            <version>2.5.10</version>
            <!-- <scope>provided</scope> -->
        </dependency>

        <dependency>
            <groupId><-- group id redacted --></groupId>
            <artifactId>secapi-spring</artifactId>
            <version>1.2.0-BUILD-SNAPSHOT</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Transient dependencies needed by the security library -->
        <dependency>
            <groupId><-- group id redacted --></groupId>
            <artifactId>CustomLogger</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>axis</groupId>
            <artifactId>axis</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>axis</groupId>
            <artifactId>axis-ant</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>jaxrpc</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.soap</groupId>
            <artifactId>saaj</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>commons-discovery</groupId>
            <artifactId>commons-discovery</artifactId>
            <version>0.2</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.0.4</version>
        </dependency>
        <dependency>
            <groupId>wsdl4j</groupId>
            <artifactId>wsdl4j</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <!-- To get this working, make sure you install the weblogic-maven-plugin.jar. 
                    Then you can run this command from a terminal: mvn com.oracle.weblogic:weblogic-maven-plugin:deploy -->
                <groupId>com.oracle.weblogic</groupId>
                <artifactId>weblogic-maven-plugin</artifactId>
                <version>10.3.6.0</version>
                <configuration>
                    <adminurl>t3://localhost:7001</adminurl>
                    <user>weblogic</user>
                    <password>weblogic1</password>
                    <upload>true</upload>
                    <action>deploy</action>
                    <remote>false</remote>
                    <verbose>true</verbose>
                    <source>${project.build.directory}/${project.build.finalName}.${project.packaging}</source>
                    <name>${project.build.finalName}</name>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

Parent project pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId><-- group id redacted --></groupId>
    <artifactId>travel-comp-time</artifactId>
    <packaging>pom</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>Travel Comp Time Application</name>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.5.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <modules>
        <module>tct-data</module>
        <module>tct-reporting</module>
        <module>tct-security</module>
        <module>tct-web</module>
    </modules>

    <properties>
        <!-- set versions here so all modules use same version of dependencies, 
            etc -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.7</java.version>
        <maven.compiler.target>1.7</maven.compiler.target>
        <maven.compiler.source>1.7</maven.compiler.source>
        <oracle.version>12.1.0.2</oracle.version>
        <eclipselink.version>2.6.4</eclipselink.version>
        <jasperreports.version>6.2.0</jasperreports.version>
        <spring-boot-legacy.version>1.0.2.RELEASE</spring-boot-legacy.version>
        <jquery.version>3.1.0</jquery.version>
        <jquery-ui.version>1.12.1</jquery-ui.version>
        <bootstrap.version>3.3.7</bootstrap.version>
    </properties>

    <dependencies>
        <!-- <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency> -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId><-- group id redacted --></groupId>
                <artifactId>tct-data</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId><-- group id redacted --></groupId>
                <artifactId>tct-security</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId><-- group id redacted --></groupId>
                <artifactId>tct-reporting</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.oracle</groupId>
                <artifactId>ojdbc7</artifactId>
                <version>${oracle.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.persistence</groupId>
                <artifactId>org.eclipse.persistence.jpa</artifactId>
                <version>${eclipselink.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.persistence</groupId>
                <artifactId>org.eclipse.persistence.oracle</artifactId>
                <version>${eclipselink.version}</version>
            </dependency>
            <dependency>
                <groupId>net.sf.jasperreports</groupId>
                <artifactId>jasperreports</artifactId>
                <version>${jasperreports.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-legacy</artifactId>
                <version>${spring-boot-legacy.version}</version>
            </dependency>

            <dependency>
                <groupId>org.webjars</groupId>
                <artifactId>jquery</artifactId>
                <version>${jquery.version}</version>
            </dependency>
            <dependency>
                <groupId>org.webjars</groupId>
                <artifactId>jquery-ui</artifactId>
                <version>${jquery-ui.version}</version>
            </dependency>
            <dependency>
                <groupId>org.webjars</groupId>
                <artifactId>bootstrap</artifactId>
                <version>${bootstrap.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/*IntegrationTest.java</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/*IntegrationTest.java</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>integration-test</goal>
                        </goals>
                    </execution>
                    <!-- Uncomment/comment this in order to fail the build if any integration 
                        test fail -->
                    <execution>
                        <id>verify</id>
                        <goals>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>3.0.3</version>
            </plugin>
            <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> 
                <version>2.17</version> <reportSets> <reportSet> <reports> <report>checkstyle</report> 
                </reports> </reportSet> </reportSets> </plugin> -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <instrumentation>
                        <ignoreTrivial>true</ignoreTrivial>
                    </instrumentation>
                </configuration>
            </plugin>

        </plugins>
    </reporting>

    <repositories>
        <repository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</project>

We do have some xml config for our spring security stuff, because the organization has some custom things that I didn't want to try to modernize just yet, but it's never even getting to the point of importing it in my Main class up there, and once I redacted it there would be little useful information, so I'm not posting it at the moment.

Sam Jones
  • 1,400
  • 1
  • 13
  • 25
  • why is the value for contextConfigLocation is '<-- package name redacted-->.TctWebApplication'. Did you try removing that comment? – Emre Türkiş Jun 08 '17 at 14:37
  • Please share pom.xml – Issam El-atif Jun 08 '17 at 14:53
  • @EmreTürkiş -- I just redacted the file before posting it to stack overflow. The package name provided identifying information that I should not expose on the general Internet. The original file(s) and stack trace did not have that comment -- they had the correct package name for that file. – Sam Jones Jun 08 '17 at 15:00
  • @IssamEL-ATIF done. – Sam Jones Jun 08 '17 at 15:05
  • I wanted to check that you are using `spring-boot-legacy`it is there indeed. – Issam El-atif Jun 08 '17 at 15:23
  • 1
    Try with `classpath:*<-- package name redacted-->.TctWebApplication` and add this line to weblogic.xml `org.springframework.*` – Issam El-atif Jun 08 '17 at 15:25
  • @IssamEL-ATIF The second part of that did it! I wasn't able to get any variation of classpath: prefix to work on the first part, but just doing the second one and redeploying fixed the issue completely. Thank you! – Sam Jones Jun 08 '17 at 20:29
  • Glad it helped. I add an answer with this it could be helpful for someone else. – Issam El-atif Jun 09 '17 at 00:08

1 Answers1

1

Add this line <wls:package-name>org.springframework.*</wls:package-name> to weblogic.xml should fix the issue.

<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee         http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd         http://xmlns.oracle.com/weblogic/weblogic-web-app         http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd">
    <wls:context-root>tct</wls:context-root>
    <wls:container-descriptor>
        <wls:prefer-application-packages>
            <wls:package-name>org.slf4j</wls:package-name>
            <wls:package-name>javax.persistence</wls:package-name>
            <wls:package-name>org.eclipse.persistence.*</wls:package-name>
            <wls:package-name>org.joda.*</wls:package-name>
            <wls:package-name>org.springframework.*</wls:package-name>
        </wls:prefer-application-packages>
    </wls:container-descriptor>
</wls:weblogic-web-app>
Issam El-atif
  • 2,366
  • 2
  • 17
  • 22