Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-4903

Exception occurs when trying to scan plugin classes compiled with a java 8 source level

      https://answers.atlassian.com/questions/309405/pluginparseexception

      [INFO] [talledLocalContainer] Caused by: java.io.IOException: Error parsing class file
      [INFO] [talledLocalContainer] at com.atlassian.plugin.osgi.util.ClassBinaryScanner.scanClassBinary(ClassBinaryScanner.java:66) ~[atlassian-plugins-osgi-3.0.22.jar:na]
      [INFO] [talledLocalContainer] ... 18 common frames omitted
      [INFO] [talledLocalContainer] Caused by: java.lang.ArrayIndexOutOfBoundsException: 18
      [INFO] [talledLocalContainer] at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:448) ~[bndlib-1.43.0-atlassian-1.jar:na]
      [INFO] [talledLocalContainer] at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:369) ~[bndlib-1.43.0-atlassian-1.jar:na]
      [INFO] [talledLocalContainer] at aQute.lib.osgi.Clazz.parseClassFileWithCollector(Clazz.java:359) ~[bndlib-1.43.0-atlassian-1.jar:na]
      [INFO] [talledLocalContainer] ... 18 common frames omitted

      After switching to compile with a java source level of 1.8 I couldn't run my plugin.
      The plugin builds successfully, when I turn off code on java 1.8 and set plugin source level to 1.7

            [BSERV-4903] Exception occurs when trying to scan plugin classes compiled with a java 8 source level

            Nick added a comment -

            This issue will be fixed in the next major version, 4.0.0.

            Nick added a comment - This issue will be fixed in the next major version, 4.0.0.

            jhinch (Atlassian) added a comment - - edited

            The issue is about loading classes compiled to 1.8 bytecode, runned on JRE 1.8.

            Yes, this is what I said and what the title of the ticket now describes.

            This means, that i'm not sure completely about 'Stash can run under JRE 1.8'. Better to say 'Stash does not support JRE 1.8 yet'

            This is absolutely not true. Stash does support JRE8. There is a difference between supporting JRE8 as a deployment runtime environment and supporting a Java 8 language level for plugin development. We have never made such a claim. That said we obviously plan to support code compiled with a java 8 language level and thus still treat this as a bug, just with a lower priority. I have linked to the issue I have created PLUG-1098 with regards to the plugin system failing to load java 8 class files.

            jhinch (Atlassian) added a comment - - edited The issue is about loading classes compiled to 1.8 bytecode, runned on JRE 1.8. Yes, this is what I said and what the title of the ticket now describes. This means, that i'm not sure completely about 'Stash can run under JRE 1.8'. Better to say 'Stash does not support JRE 1.8 yet' This is absolutely not true. Stash does support JRE8. There is a difference between supporting JRE8 as a deployment runtime environment and supporting a Java 8 language level for plugin development. We have never made such a claim. That said we obviously plan to support code compiled with a java 8 language level and thus still treat this as a bug, just with a lower priority. I have linked to the issue I have created PLUG-1098 with regards to the plugin system failing to load java 8 class files.

            Hi Jason,
            Your conclusion is strange. Sure, JRE 1.8 can run bytecode 1.7, but the issue is not about it.
            The issue is about loading classes compiled to 1.8 bytecode, runned on JRE 1.8. Stash used OSGi module that can't parse 1.8 bytecode. And this is a problem.

            This means, that i'm not sure completely about 'Stash can run under JRE 1.8'. Better to say 'Stash does not support JRE 1.8 yet'

            Alexey Efimov added a comment - Hi Jason, Your conclusion is strange. Sure, JRE 1.8 can run bytecode 1.7, but the issue is not about it. The issue is about loading classes compiled to 1.8 bytecode, runned on JRE 1.8. Stash used OSGi module that can't parse 1.8 bytecode. And this is a problem. This means, that i'm not sure completely about 'Stash can run under JRE 1.8'. Better to say 'Stash does not support JRE 1.8 yet'

            After some testing locally I have confirmed that this has nothing to do with the runtime version of Java used but the Java source level used in the plugin. Stash only supports a source level of java 7 or below at the moment. However you can run your plugin on a JDK 8 runtime.

            jhinch (Atlassian) added a comment - After some testing locally I have confirmed that this has nothing to do with the runtime version of Java used but the Java source level used in the plugin. Stash only supports a source level of java 7 or below at the moment. However you can run your plugin on a JDK 8 runtime.

            Just to confirm, is this a plugin compiling with a source level for java 8 or merely running on JDK8?

            jhinch (Atlassian) added a comment - Just to confirm, is this a plugin compiling with a source level for java 8 or merely running on JDK8?

            What specific version of the JDK are you using? Can you give us the output of java -version please

            jhinch (Atlassian) added a comment - What specific version of the JDK are you using? Can you give us the output of java -version please

              Unassigned Unassigned
              6954e0c50e7f Dana
              Affected customers:
              7 This affects my team
              Watchers:
              13 Start watching this issue

                Created:
                Updated:
                Resolved: