Illegalargumentexception when deploying Spring Boot application in Weblogic

Asked

Viewed 73 times

1

I am not being able to successfully deploy my Spring boot 2-based application to a server running Oracle Weblogic 12.1.3 due to this error:

weblogic.application.ModuleException: null
null
        at weblogic.servlet.internal.WebAppModule.createModuleException(WebAppModule.java:1824)
        at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:270)
        at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:682)
        at weblogic.application.internal.flow.ScopedModuleDriver.init(ScopedModuleDriver.java:162)
        at weblogic.application.internal.ExtensibleModuleWrapper.init(ExtensibleModuleWrapper.java:98)
        Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalArgumentException
        at com.bea.objectweb.asm.ClassReader.<init>(Unknown Source)
        at com.bea.objectweb.asm.ClassReader.<init>(Unknown Source)
        at weblogic.application.utils.annotation.ClassInfoImpl.<init>(ClassInfoImpl.java:41)
        at weblogic.application.utils.annotation.ClassfinderClassInfos.polulateOneClassInfo(ClassfinderClassInfos.java:240)
        at weblogic.application.utils.annotation.ClassfinderClassInfos.populateClassInfos(ClassfinderClassInfos.java:193)
        at weblogic.application.utils.annotation.ClassfinderClassInfos.<init>(ClassfinderClassInfos.java:44)
        at weblogic.servlet.internal.War.initializeClassInfosIfNecessary(War.java:446)
        at weblogic.servlet.internal.War.getAnnotatedClasses(War.java:376)
        at weblogic.servlet.utils.WarUtils.isJsfApplication(WarUtils.java:258)
        at weblogic.servlet.internal.WebAppModule.detectJsfApplication(WebAppModule.java:277)
        at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:262)
        at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:682)
        at weblogic.application.internal.flow.ScopedModuleDriver.init(ScopedModuleDriver.java:162)
        at weblogic.application.internal.ExtensibleModuleWrapper.init(ExtensibleModuleWrapper.java:98)
        at weblogic.application.internal.flow.ModuleListenerInvoker.init(ModuleListenerInvoker.java:84)
        at weblogic.application.internal.flow.InitModulesFlow.initModule(InitModulesFlow.java:288)
        at weblogic.application.internal.flow.InitModulesFlow.initModules(InitModulesFlow.java:301)
        at weblogic.application.internal.flow.InitModulesFlow.prepare(InitModulesFlow.java:329)
        at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:706)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
        at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:237)
        at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:48)
        at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:158)
        at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:61)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:208)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:233)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:749)
        at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1238)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:252)
        at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:172)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
        at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:548)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)

At first I thought it might be due to the incompatibility of Java versions between the server and my development machine (as suggested in this question), however both are running the JDK 8.

I also found this Issue about cannot deploy a Log4j 2.9.x application to Weblogic due to an error with.objectweb.asm.Classreader but the only references my project contains to Log4j are to version 2.1.0 so I don’t think it applies.

Considering that although my application does not run on Weblogic the war is successfully created and the application runs locally, some idea of what might be?


Contents of 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>

    <groupId>XXX</groupId>
    <artifactId>XXX</artifactId>
    <version>x.x.x</version>
    <packaging>war</packaging>

    <name>XXX</name>
    <description>XXX</description>

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

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>

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

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.vaadin.external.google</groupId>
                    <artifactId>android-json</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-dbcp2</artifactId>
        </dependency>

        <dependency>
            <groupId>org.xerial</groupId>
            <artifactId>sqlite-jdbc</artifactId>
        </dependency>

        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20180130</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>
  • see log file for complete stacktrace: can you include the full log snippet of weblog in the deploy? Include your pom.xml as well, to check out the dependency tree.

  • @Brunocésar added to the example log the excerpt I could find in the logs. I had already put in the question the part of the dependencies of the pom.xml either way I added the full file to make it easier.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.