java.lang.ArrayIndexOutOfBoundsException while Deploying app in WLS 12

Basically, it's a bad class file inside your deployment. Some libs have those.

What's wrong there is that weblogic 12c is not catching the exception and logging the culprit so one could find out which one it is. I would raise this issue with Oracle so they would do that.

See similar issue in Geronimo where they changed the message to be warn and not preventing deployment.

A hint as to which file might be problematic is that in 12c they are loading resource classes as well which they did not do in previous versions, so if the app works in a previous version, it might be due to that.

As to how to find out which class it is, you could hook up debugging to your weblogic instance and add an exception breakpoint on java.lang.ArrayIndexOutOfBoundsException, then try to examine the context to find out the parameters.


Another problem, that I'm adding for prosperity because it caused me a lot of headaches, is the Spring version bundled with WebLogic 12c. WebLogic 12c comes bundled with Spring 3.x, and that doesn't understand Java 8 class files with lambda expressions.

A complicating factor was that it worked fine on a local WebLogic instance on my development machine, but not on the Oracle Cloud instance.

The solution is to tell WebLogic to use the version of Spring that is bundled with your web application, by adding the weblogic.xml in the WEB-INF directory (src/main/webbapp/WEB-INF if you're using Maven).

<?xml version="1.0" encoding="UTF-8" ?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">

    <container-descriptor>
        <prefer-application-packages>
            <package-name>org.springframework</package-name>
            <!--
                Add other packages that you may want to use
                over the ones bundled with WebLogic.
            -->
        </prefer-application-packages>
    </container-descriptor>

</weblogic-web-app>

And that solved the problem for me.

Tags:

Java

Weblogic