microsoft / microsoft/vscode-java-test
NoClassDefFoundError when running test in project with classifiers
Personne n'a encore pris cette issue.
- Langage dominant
- TypeScript
- Étoiles
- 340
- Forks
- 173
- Merge moyen
- 1 j 19 h
- PR mergées (30 j)
- 18
Description
VSCode version: 1.37.0
Java Test Runner version: 0.19.0
The workspace contains two projects, i.e. A and B. Project A depends on Project B.
When executing an unit test of Project A, the test failed due to a missing Java class definition from Project B.
Caused by: java.lang.NoClassDefFoundError: a/b/c/d/e/exception/InvalidTokenException
at a.b.c.d.f.g.registrationService(g.java:27)
at a.b.c.d.f.g$$EnhancerBySpringCGLIB$$db27a38.CGLIB$registrationService$0(<generated>)
at a.b.c.d.f.g$$EnhancerBySpringCGLIB$$db27a38$$FastClassBySpringCGLIB$$df65555.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355)
at a.b.be.d.f.g$$EnhancerBySpringCGLIB$$db27a38.registrationService(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 39 more
Caused by: java.lang.ClassNotFoundException: a.b.c.d.e.exception.InvalidTokenException
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 50 more
When browsing the dependency of Project A using Java Dependency Viewer, Project B is missing from Maven Dependencies.
If I remove Project B from the workspace, Project B re-appears in the dependency list under Maven Dependencies. At this moment, the test runs perfectly fine without any issue.
I am not sure whether there are some issues on resolving classpath in mutli-project workspace.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Reproduisez l’échec dans l’espace de travail à deux projets décrit, puis inspectez Project A dans Java Dependency Viewer pendant que Project B est présent ou supprimé. La tâche est terminée lorsque Project B reste dans Maven Dependencies et que le test unitaire de Project A s’exécute sans le NoClassDefFoundError ; l’issue n’indique aucun fichier du dépôt ni aucun test à inspecter.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java, vscode
- Domaine
- build-system, testing
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100