Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML Serialization related JDK resources missing from test classpath when plugin is included #25

Closed
patflynn opened this issue Nov 12, 2015 · 1 comment
Assignees
Milestone

Comments

@patflynn
Copy link

When I include this plugin I get some unexpected test failures.

I've created a sample project to show the issue:
https://github.com/patflynn/gradle-intellij-plugin-classpath-bug

running gradlew test will cause:
java.lang.ExceptionInInitializerError
at TestRtClasspath.testToXMLStreamOnClassPath(TestRtClasspath.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:86)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:49)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:64)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:360)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: The resource [ com.sun.org.apache.xml.internal.serializer.XMLEntities ] could not load: java.lang.RuntimeException: The resource [ com.sun.org.apache.xml.internal.serializer.XMLEntities ] could not be found.
com.sun.org.apache.xml.internal.serializer.XMLEntities
com.sun.org.apache.xml.internal.serializer.XMLEntities java.lang.RuntimeException: The resource [ com.sun.org.apache.xml.internal.serializer.XMLEntities ] could not be found.
com.sun.org.apache.xml.internal.serializer.XMLEntities
at com.sun.org.apache.xml.internal.serializer.CharInfo.(CharInfo.java:291)
at com.sun.org.apache.xml.internal.serializer.CharInfo.(CharInfo.java:51)
at com.sun.org.apache.xml.internal.serializer.CharInfo$1.run(CharInfo.java:470)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.org.apache.xml.internal.serializer.CharInfo.getCharInfoBasedOnPrivilege(CharInfo.java:467)
at com.sun.org.apache.xml.internal.serializer.CharInfo.getCharInfo(CharInfo.java:529)
at com.sun.org.apache.xml.internal.serializer.ToXMLStream.(ToXMLStream.java:55)
... 44 more

TestRtClasspath > testToXMLStreamOnClassPath FAILED
java.lang.ExceptionInInitializerError at TestRtClasspath.java:10
Caused by: java.lang.RuntimeException at TestRtClasspath.java:10

If you remove the:
plugins {
id "org.jetbrains.intellij" version "0.0.27"
}

declaration then the test passes.

@patflynn patflynn changed the title XML Serialization related JDK resources missing from test classpath when plugin is imported XML Serialization related JDK resources missing from test classpath when plugin is included Nov 12, 2015
@patflynn
Copy link
Author

This looks like it's fixed in 0.0.28

@zolotov zolotov added this to the 0.0.28 milestone Dec 5, 2015
@zolotov zolotov self-assigned this Dec 5, 2015
mfilippov pushed a commit to mfilippov/gradle-intellij-plugin that referenced this issue Mar 29, 2022
Fix NoClassDefFoundError exception while parser generation with 2020.1 platform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants