IBM Support

IV43478: A JAVA.LANG.CLASSCASTEXCEPTION HAPPENS WITH A PROXY CLASS GENERA TED BY METHOD NEWPROXYINSTANCE() OF CLASS JAVA.LANG.REFLECT.PROX

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Error Message: An error message similar to the following is
    received:
    
       Caused by: java.lang.ClassCastException: $Proxy6 incompatible
    with <SOME_INTERFACE>
    .
    Stack Trace: N/A
    .
    

Local fix

  • This issue can be worked around by disabling the share classes
    cache with the following option:
            -Xshareclasses:none
    

Problem summary

  • When a proxy object is generated through the following method in
    java.lang.reflect.Proxy,
       newProxyInstance(ClassLoader loader, Class<?><OSB><CSB>
    interfaces, InvocationHandler h)
      the proxy class (for example $Proxy6) will be generated and
    improperly cached into the share classes cache.  After
      the JVM is restarted, the proxy class ($Proxy6) will be loaded
    from the share classes cache to JVM runtime. It would cause a
      java.lang.ClassCastException if the same proxy class ($Proxy6)
    is cast to some other interface.
    

Problem conclusion

  • The JVM has been updated to prevent the improper caching
    information into the share classes cache.
    
    This defect will be fixed in:
    5.0.0 SR12 FP4
    5.0.0 SR13
    6.0.0 SR10
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV43478

  • Reported component name

    J9 COMMON CODE

  • Reported component ID

    620700127

  • Reported release

    600

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-05-31

  • Closed date

    2013-05-31

  • Last modified date

    2013-05-31

  • APAR is sysrouted FROM one or more of the following:

    IZ94639

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    J9 COMMON CODE

  • Fixed component ID

    620700127

Applicable component levels

  • R600 PSY

       

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSCVQ3W","label":"Virtual Machine"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"6.0","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
31 May 2013