My Oracle Support Banner

Problem Creating Plan.xml Due To Application Specific Antlr.jar (Doc ID 1988141.1)

Last updated on AUGUST 29, 2023

Applies to:

Oracle WebLogic Server - Version 12.1.2.0.0 and later
Information in this document applies to any platform.

Symptoms

There is an issue creating Plan.xml when you have application specific "antlr.jar" and use it using "prefer-application-packages" in "weblogic-application.xml".
 
Without "<prefer-application-packages>" in weblogic-application.xml everything works, but the problem is then the antlr classes from Weblogic will be used for the application and not from the specified antlr.jar in "prefer-application-packages".

With WLS12.1.1 we can see the correct behavior.

Issue is seen in WLS 12.1.2 and later versions.

The error received is: 

"java.lang.ClassCastException: antlr.CommonToken cannot be cast to antlr.Token"


Steps to reproduce this issue:

The issue can be reproduced at will with the following steps:

- Create any EAR or use the helloWorldEar application
- In weblogic-application.xml add
    <prefer-application-packages>
        <package-name>antlr.*</package-name>
    </prefer-application-packages>
- Add your own version of "antlr-2.7.7.jar" in "Ear/APP-INF/lib"
- Deploy the application to the Admin Server
- Try to configure something and activate so that Plan.xml is created, for example:
      Deployments -> helloWorldEar -> TransactionEJB -> Configuration ->Dispatch Policy -> "mydispatch" -> save ->Activate changes
- Then the error occurs:
           "java.lang.ClassCastException: antlr.CommonToken cannot be cast to antlr.Token"

 

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.