You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "garpinc (JIRA)" <ji...@apache.org> on 2013/08/01 23:13:49 UTC

[jira] [Commented] (OPENJPA-2085) Improve enhancement process to support JAVA 7 compliant class file generation

    [ https://issues.apache.org/jira/browse/OPENJPA-2085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13726902#comment-13726902 ] 

garpinc commented on OPENJPA-2085:
----------------------------------

I had a problem where classloader couldn't find ClassWriter for some reason in AsmAdapter when running as osgi bundle. changing as follows seems to do the trick. Can you guys change implementation in trunk please:

    private static void tryClass(final String s) {
        if (cwClass == null) {
            try {
                //garpinc changed here instead of AsmAdaptor.class.getClassLoader()
                cwClass = Thread.currentThread().getContextClassLoader().loadClass(s + "ClassWriter");
            } catch (Throwable t) {
                //ignore
            }
        }
        if (crClass == null) {
            try {
                //garpinc changed here instead of AsmAdaptor.class.getClassLoader()
                crClass = Thread.currentThread().getContextClassLoader().loadClass(s + "ClassReader");
            } catch (Throwable t) {
                //ignore
            }
        }
    }
                
> Improve enhancement process to support JAVA 7 compliant class file generation
> -----------------------------------------------------------------------------
>
>                 Key: OPENJPA-2085
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2085
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: Enhance, kernel
>    Affects Versions: 2.2.0
>            Reporter: Albert Lee
>            Assignee: Albert Lee
>             Fix For: 2.2.0
>
>         Attachments: OPENJPA-2085.patch
>
>
> Java 7 requires StackMapTable attribute to be set in class file for verification.
> Serp does not support StackMapTable generation, hence the currently enhanced PersistenceCapable class will NOT be able to load by a Java 7 JVM if the entity is compiled with a Java 7 compiler (i.e. class file major version >= 51)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira