[YANGIDE-10] java.lang.ClassNotFoundException: org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor$YangProvider at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) Created: 09/May/16  Updated: 19/Oct/17

Status: Confirmed
Project: yangide
Component/s: General
Affects Version/s: unspecified
Fix Version/s: None

Type: Bug
Reporter: Michael Vorburger Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File bug5863bis.txt    
External issue ID: 5863

 Description   

I'm interested in (eventually..) using yangide as part of https://github.com/vorburger/opendaylight-eclipse-setup, but am currently blocked by the problem below (visible on the Console) when using yangide on yangide/samples/yang-module1 & module2 (which have the Maven Builder and thus M2E and thus go through the YangBuildParticipant).

David, do you see this as well?

!STACK 0
org.apache.maven.plugin.PluginExecutionException: Execution generate-sources of goal org.opendaylight.yangtools:yang-maven-plugin:0.8.0-Beryllium:generate-sources failed: A required class was missing while executing org.opendaylight.yangtools:yang-maven-plugin:0.8.0-Beryllium:generate-sources: org/opendaylight/yangtools/yang2sources/plugin/YangToSourcesProcessor$YangProvider
-----------------------------------------------------
realm = plugin>org.opendaylight.yangtools:yang-maven-plugin:0.8.0-Beryllium
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-maven-plugin/0.8.0-Beryllium/yang-maven-plugin-0.8.0-Beryllium.jar
urls[1] = file:/home/vorburger/.m2/repository/org/opendaylight/mdsal/maven-sal-api-gen-plugin/0.8.0-Beryllium/maven-sal-api-gen-plugin-0.8.0-Beryllium.jar
urls[2] = file:/home/vorburger/.m2/repository/org/opendaylight/mdsal/mdsal-binding-generator-api/0.8.0-Beryllium/mdsal-binding-generator-api-0.8.0-Beryllium.jar
urls[3] = file:/home/vorburger/.m2/repository/org/opendaylight/mdsal/yang-binding/0.8.0-Beryllium/yang-binding-0.8.0-Beryllium.jar
urls[4] = file:/home/vorburger/.m2/repository/org/opendaylight/mdsal/mdsal-binding-generator-impl/0.8.0-Beryllium/mdsal-binding-generator-impl-0.8.0-Beryllium.jar
urls[5] = file:/home/vorburger/.m2/repository/org/javassist/javassist/3.20.0-GA/javassist-3.20.0-GA.jar
urls[6] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-data-impl/0.8.0-Beryllium/yang-data-impl-0.8.0-Beryllium.jar
urls[7] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-data-util/0.8.0-Beryllium/yang-data-util-0.8.0-Beryllium.jar
urls[8] = file:/home/vorburger/.m2/repository/org/opendaylight/mdsal/mdsal-binding-generator-util/0.8.0-Beryllium/mdsal-binding-generator-util-0.8.0-Beryllium.jar
urls[9] = file:/home/vorburger/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar
urls[10] = file:/home/vorburger/.m2/repository/org/eclipse/xtend/org.eclipse.xtend.lib/2.8.4/org.eclipse.xtend.lib-2.8.4.jar
urls[11] = file:/home/vorburger/.m2/repository/org/eclipse/xtend/org.eclipse.xtend.lib.macro/2.8.4/org.eclipse.xtend.lib.macro-2.8.4.jar
urls[12] = file:/home/vorburger/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.xbase.lib/2.8.4/org.eclipse.xtext.xbase.lib-2.8.4.jar
urls[13] = file:/home/vorburger/.m2/repository/org/opendaylight/mdsal/mdsal-binding-java-api-generator/0.8.0-Beryllium/mdsal-binding-java-api-generator-0.8.0-Beryllium.jar
urls[14] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-data-api/0.8.0-Beryllium/yang-data-api-0.8.0-Beryllium.jar
urls[15] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/util/0.8.0-Beryllium/util-0.8.0-Beryllium.jar
urls[16] = file:/home/vorburger/.m2/repository/com/github/romix/java-concurrent-hash-trie-map/0.2.23/java-concurrent-hash-trie-map-0.2.23.jar
urls[17] = file:/home/vorburger/.m2/repository/org/apache/maven/maven-builder-support/3.3.3/maven-builder-support-3.3.3.jar
urls[18] = file:/home/vorburger/.m2/repository/org/eclipse/aether/aether-util/1.0.2.v20150114/aether-util-1.0.2.v20150114.jar
urls[19] = file:/home/vorburger/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
urls[20] = file:/home/vorburger/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
urls[21] = file:/home/vorburger/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.0/org.eclipse.sisu.inject-0.3.0.jar
urls[22] = file:/home/vorburger/.m2/repository/org/sonatype/sisu/sisu-guice/3.2.5/sisu-guice-3.2.5-no_aop.jar
urls[23] = file:/home/vorburger/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
urls[24] = file:/home/vorburger/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.jar
urls[25] = file:/home/vorburger/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.jar
urls[26] = file:/home/vorburger/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[27] = file:/home/vorburger/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
urls[28] = file:/home/vorburger/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[29] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-parser-impl/0.8.0-Beryllium/yang-parser-impl-0.8.0-Beryllium.jar
urls[30] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-common/0.8.0-Beryllium/yang-common-0.8.0-Beryllium.jar
urls[31] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/object-cache-api/0.8.0-Beryllium/object-cache-api-0.8.0-Beryllium.jar
urls[32] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-model-api/0.8.0-Beryllium/yang-model-api-0.8.0-Beryllium.jar
urls[33] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-parser-api/0.8.0-Beryllium/yang-parser-api-0.8.0-Beryllium.jar
urls[34] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-model-util/0.8.0-Beryllium/yang-model-util-0.8.0-Beryllium.jar
urls[35] = file:/home/vorburger/.m2/repository/org/antlr/antlr4-runtime/4.5.1/antlr4-runtime-4.5.1.jar
urls[36] = file:/home/vorburger/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar
urls[37] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/concepts/0.8.0-Beryllium/concepts-0.8.0-Beryllium.jar
urls[38] = file:/home/vorburger/.m2/repository/com/google/code/findbugs/jsr305/3.0.0/jsr305-3.0.0.jar
urls[39] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-maven-plugin-spi/0.8.0-Beryllium/yang-maven-plugin-spi-0.8.0-Beryllium.jar
urls[40] = file:/home/vorburger/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
Number of foreign imports: 5
import: Entry[import org.sonatype.plexus.build.incremental from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import org.codehaus.plexus.util.Scanner from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import org.codehaus.plexus.util.DirectoryScanner from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import org.codehaus.plexus.util.AbstractScanner from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:168)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331)
at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362)
at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1360)
at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:52)
at org.opendaylight.yangide.m2e.yang.YangBuildParticipant.build(YangBuildParticipant.java:97)
at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:137)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:172)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1$1.call(MavenBuilder.java:115)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:105)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)
at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.apache.maven.plugin.PluginContainerException: A required class was missing while executing org.opendaylight.yangtools:yang-maven-plugin:0.8.0-Beryllium:generate-sources: org/opendaylight/yangtools/yang2sources/plugin/YangToSourcesProcessor$YangProvider
-----------------------------------------------------
realm = plugin>org.opendaylight.yangtools:yang-maven-plugin:0.8.0-Beryllium
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-maven-plugin/0.8.0-Beryllium/yang-maven-plugin-0.8.0-Beryllium.jar
urls[1] = file:/home/vorburger/.m2/repository/org/opendaylight/mdsal/maven-sal-api-gen-plugin/0.8.0-Beryllium/maven-sal-api-gen-plugin-0.8.0-Beryllium.jar
urls[2] = file:/home/vorburger/.m2/repository/org/opendaylight/mdsal/mdsal-binding-generator-api/0.8.0-Beryllium/mdsal-binding-generator-api-0.8.0-Beryllium.jar
urls[3] = file:/home/vorburger/.m2/repository/org/opendaylight/mdsal/yang-binding/0.8.0-Beryllium/yang-binding-0.8.0-Beryllium.jar
urls[4] = file:/home/vorburger/.m2/repository/org/opendaylight/mdsal/mdsal-binding-generator-impl/0.8.0-Beryllium/mdsal-binding-generator-impl-0.8.0-Beryllium.jar
urls[5] = file:/home/vorburger/.m2/repository/org/javassist/javassist/3.20.0-GA/javassist-3.20.0-GA.jar
urls[6] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-data-impl/0.8.0-Beryllium/yang-data-impl-0.8.0-Beryllium.jar
urls[7] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-data-util/0.8.0-Beryllium/yang-data-util-0.8.0-Beryllium.jar
urls[8] = file:/home/vorburger/.m2/repository/org/opendaylight/mdsal/mdsal-binding-generator-util/0.8.0-Beryllium/mdsal-binding-generator-util-0.8.0-Beryllium.jar
urls[9] = file:/home/vorburger/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar
urls[10] = file:/home/vorburger/.m2/repository/org/eclipse/xtend/org.eclipse.xtend.lib/2.8.4/org.eclipse.xtend.lib-2.8.4.jar
urls[11] = file:/home/vorburger/.m2/repository/org/eclipse/xtend/org.eclipse.xtend.lib.macro/2.8.4/org.eclipse.xtend.lib.macro-2.8.4.jar
urls[12] = file:/home/vorburger/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.xbase.lib/2.8.4/org.eclipse.xtext.xbase.lib-2.8.4.jar
urls[13] = file:/home/vorburger/.m2/repository/org/opendaylight/mdsal/mdsal-binding-java-api-generator/0.8.0-Beryllium/mdsal-binding-java-api-generator-0.8.0-Beryllium.jar
urls[14] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-data-api/0.8.0-Beryllium/yang-data-api-0.8.0-Beryllium.jar
urls[15] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/util/0.8.0-Beryllium/util-0.8.0-Beryllium.jar
urls[16] = file:/home/vorburger/.m2/repository/com/github/romix/java-concurrent-hash-trie-map/0.2.23/java-concurrent-hash-trie-map-0.2.23.jar
urls[17] = file:/home/vorburger/.m2/repository/org/apache/maven/maven-builder-support/3.3.3/maven-builder-support-3.3.3.jar
urls[18] = file:/home/vorburger/.m2/repository/org/eclipse/aether/aether-util/1.0.2.v20150114/aether-util-1.0.2.v20150114.jar
urls[19] = file:/home/vorburger/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
urls[20] = file:/home/vorburger/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
urls[21] = file:/home/vorburger/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.0/org.eclipse.sisu.inject-0.3.0.jar
urls[22] = file:/home/vorburger/.m2/repository/org/sonatype/sisu/sisu-guice/3.2.5/sisu-guice-3.2.5-no_aop.jar
urls[23] = file:/home/vorburger/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
urls[24] = file:/home/vorburger/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.jar
urls[25] = file:/home/vorburger/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.jar
urls[26] = file:/home/vorburger/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[27] = file:/home/vorburger/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
urls[28] = file:/home/vorburger/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[29] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-parser-impl/0.8.0-Beryllium/yang-parser-impl-0.8.0-Beryllium.jar
urls[30] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-common/0.8.0-Beryllium/yang-common-0.8.0-Beryllium.jar
urls[31] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/object-cache-api/0.8.0-Beryllium/object-cache-api-0.8.0-Beryllium.jar
urls[32] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-model-api/0.8.0-Beryllium/yang-model-api-0.8.0-Beryllium.jar
urls[33] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-parser-api/0.8.0-Beryllium/yang-parser-api-0.8.0-Beryllium.jar
urls[34] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-model-util/0.8.0-Beryllium/yang-model-util-0.8.0-Beryllium.jar
urls[35] = file:/home/vorburger/.m2/repository/org/antlr/antlr4-runtime/4.5.1/antlr4-runtime-4.5.1.jar
urls[36] = file:/home/vorburger/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar
urls[37] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/concepts/0.8.0-Beryllium/concepts-0.8.0-Beryllium.jar
urls[38] = file:/home/vorburger/.m2/repository/com/google/code/findbugs/jsr305/3.0.0/jsr305-3.0.0.jar
urls[39] = file:/home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-maven-plugin-spi/0.8.0-Beryllium/yang-maven-plugin-spi-0.8.0-Beryllium.jar
urls[40] = file:/home/vorburger/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
Number of foreign imports: 5
import: Entry[import org.sonatype.plexus.build.incremental from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import org.codehaus.plexus.util.Scanner from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import org.codehaus.plexus.util.DirectoryScanner from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import org.codehaus.plexus.util.AbstractScanner from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:166)
... 32 more
Caused by: java.lang.NoClassDefFoundError: org/opendaylight/yangtools/yang2sources/plugin/YangToSourcesProcessor$YangProvider
at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.<init>(YangToSourcesProcessor.java:89)
at org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesMojo.execute(YangToSourcesMojo.java:113)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 32 more
Caused by: java.lang.ClassNotFoundException: org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor$YangProvider
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
... 35 more



 Comments   
Comment by David M. Karr [ 09/May/16 ]

I don't know if I've seen this exact error, but it's certainly similar to other issues I've seen before.

I note that these samples are using Beryllium artifacts. I had a lot of trouble finding the "version dependency matrix" just for the three related artifacts used in these Yang projects.

Comment by Michael Vorburger [ 10/May/16 ]

Hm, now I cannot reproduce the problem above anymore.. could have just been due to a stale local workspace, and recent automatic rebuild made things consistent again, so gone?! I'm closing this as RESOLVED WORKSFORME; let's re-open if anyone bunmps into above again.

> I note that these samples are using Beryllium artifacts.
> I had a lot of trouble finding the "version dependency matrix"
> just for the three related artifacts used in these Yang projects.

I've cleaned them up in proposed new change https://git.opendaylight.org/gerrit/38628 - merge?

Comment by Michael Vorburger [ 10/May/16 ]

Ha, that didn't take long, I've just hit it again, not identical, but similar enough, I'm reasonably sure that this is the same root cause as initial above, see attachment.

Comment by Michael Vorburger [ 10/May/16 ]

Attachment bug5863bis.txt has been added with description: NoClassDefFoundError from Eclipse Error Log

Comment by Michael Vorburger [ 10/May/16 ]

This time I had a closer look, and it's of course not a trivial typo or something (how could it be in Java..) - a quick verification of the NoClassDefFoundError class org/opendaylight/yangtools/yang/parser/stmt/reactor/ModifierImpl shows that IS of course in one of the JARs listed:

jar -tf /home/vorburger/.m2/repository/org/opendaylight/yangtools/yang-parser-impl/1.0.0-SNAPSHOT/yang-parser-impl-1.0.0-SNAPSHOT.jar | grep org/opendaylight/yangtools/yang/parser/stmt/reactor/ModifierImpl
(...)
org/opendaylight/yangtools/yang/parser/stmt/reactor/ModifierImpl.class

Curious. I do have one somewhat vague suspicion though, which is more of a hunch than something I "prove" at this stage: The org.opendaylight.yangide.m2e.yang plugin is more than just a "normal" M2E Configurator.. not only does it seem to delegate code generation to yangtools via the Classpath of the yang-maven-plugin (NOT yangide.m2e.yang Eclipse plugin!), as any "normal" M2E Configurator would, but it also seems to do some yang model validation by calling THE SAME kind of yangtools code, but that through it's dependency to yangide.ui & yangide.core (which depends on yangide.yangparser, which bundles copies of the yangtools JARs).

To me this seems dangerous, and possibly the root cause of this (only occasionally happening) problem? BTW: I'm assuming a strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy in Maven, which I'm not an expert of, means that it should first load classes from the Classpath of the yang-maven-plugin, and so in theory not get confused, but in practice... looks like this does not (always) work?

What to do? a) Make yangide.m2e.yang completely separate from yangide.ui, yangide.core & yangide.yangparser? And run the validation.. from another separate Builder than the M2E one, in yangide.core? OR b) Try to make all of yangide always delegate to yangtools from the project's classpath, instead of bundling copies of those JARs? Technically that should be doable (with likely quite a bit of work).

Comment by Michael Vorburger [ 11/May/16 ]

Some notes for future digging:

1. NoClassDefFoundError can be because of problem in static, but normally there should be an ExceptionInInitializerError.. so set breakpoint in all 3 constructors of ExceptionInInitializerError to see if any.

2. SelfFirstStrategy.loadClass breakpoint could be interesting to debug the actual ClassLoader(s) it really tried

3. yangtools/mdsal ClassLoaderUtils ClassLoader and Thread setContextClassLoader magic - bug there?

Comment by Michael Vorburger [ 11/May/16 ]

> 3. yangtools/mdsal ClassLoaderUtils ClassLoader and Thread setContextClassLoader magic - bug there?

Unlikely, seems safe; see analysis in MDSAL-165 (and proposed minor change https://git.opendaylight.org/gerrit/#/c/38659/; but that's more readability and not going to fix anything).

Comment by David M. Karr [ 11/May/16 ]

Have you attempted to change the versions to match what the YangIDE generates in a new project? From what I'm seeing here, this is still using Beryllium.

Comment by Michael Vorburger [ 11/May/16 ]

> Have you attempted to change the versions to match what the YangIDE generates in a new project?

Yes in https://git.opendaylight.org/gerrit/38628 (see above) I've changed 0.8.0-Beryllium to 1.0.0-SNAPSHOT. See the attached 2nd occurrence of this problem, there are no "0.8.0-Beryllium" there anymore.

Comment by David M. Karr [ 11/May/16 ]

So what happens when you use the plugin to create a Yang project? Do you get the same error?

Comment by Michael Vorburger [ 11/May/16 ]

> So what happens when you use the plugin to create a Yang project?

oh hang on, we were not talking about the same thing, you mean File > New > Project > YANG.. I just discovered that now. I have not changed anything related to that (and it was already at non-Beryllium). Above (x2) is when using yangide on yangide/samples/yang-module1 & module2.

> Do you get the same error?

This error happens occasionally (twice to me), and I don't have steps to reproduce. The File > New > Project > YANG & yangide/samples/yang-module1 & module2 both look like the have a very similar structure, so I assume it can happen in either.

Comment by David M. Karr [ 12/May/16 ]

I have a feeling what we will find is that this error only happens when importing these projects without creating it as a Yang Project. If that's the case, we should prevent this error from happening, but we would do that by ensuring that the Yang editing facilities are not available for Yang files not in a "Yang Project".

In addition, we should implement the "Yang Nature", which can be added to an imported project after creation, to get Yang editing facilities without creating a "Yang Project".

Generated at Wed Feb 07 20:48:26 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.