Uploaded image for project: 'yangide'
  1. yangide
  2. YANGIDE-1

java.lang.LinkageError: org/antlr/v4/runtime/TokenStream

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • unspecified
    • None
    • General
    • None
    • Operating System: All
      Platform: All

    • 5798
    • Highest

    Description

      I'm interested in (eventually..) using yangide as part of https://github.com/vorburger/opendaylight-eclipse-setup, but am currently blocked by:

      java.lang.LinkageError: org/antlr/v4/runtime/TokenStream
      at org.antlr.v4.runtime.Parser.setInputStream(Parser.java:530)
      at org.antlr.v4.runtime.Parser.<init>(Parser.java:182)
      at org.opendaylight.yangtools.antlrv4.code.gen.YangParser.<init>(YangParser.java:188)

      java.lang.LinkageError: loader constraint violation: loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) previously initiated loading for a different type with name "org/antlr/v4/runtime/TokenStream"
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
      at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:273)

      Based on a quick read of the analysis posted on http://stackoverflow.com/questions/36798891/loader-constraint-violation-loading-antlr-jar-in-eclipse-plugin-built-with-tycho, it would appear that the root cause of this could be an ANTLR version conflict between yangide and the Eclipse Checkstyle plugin net.sf.eclipsecs.checkstyle (which I also bundle in opendaylight-eclipse-setup).

      Normally OSGi was meant to avoid such conflicts but there goes the difference between the theory and the practice... More seriously, this is obviously most likely more of a misuse of OSGi than an actual OSGi issue.

      If I can find the time I'll try to help resolve this, if a Gerrit with a contribution to yangide about this would be of interest to you? (Actually it is theoretically possible that this isn't even something to "fix" in yangide, but something that could & should be done differently, or ANTLR upgraded, in net.sf.eclipsecs.checkstyle - I would have to see.)

      If anyone is aware of any short term workarounds for above, please document them here.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dkarr David M. Karr
            vorburger Michael Vorburger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: