How can I fix CNFE "org.eclipse.jface.text.BadLocationException" in build when using custom build toolkit plugin?
Using RTC 4.0.6 I am running a custom plugin in my build toolkit. It makes use of java to query work items. While the java class can be called from ANT via <exec> task and works just fine, as part of the custom plugin in the build it will break the build with:
BUILD FAILED java.lang.NoClassDefFoundError: org.eclipse.jface.text.BadLocationException at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:73) at java.lang.J9VMInternals.verify(J9VMInternals.java:71) at java.lang.J9VMInternals.verify(J9VMInternals.java:71) at java.lang.J9VMInternals.initialize(J9VMInternals.java:135) at com.ibm.team.process.internal.client.ThinClientProcess.createConfigurationData(ThinClientProcess.java:329) at com.ibm.team.process.internal.client.ThinClientProcess.getProjectConfigurationData(ThinClientProcess.java:280) at com.ibm.team.workitem.client.internal.AuditableClientProcess.findProcessConfiguration(AuditableClientProcess.java:72) at com.ibm.team.workitem.common.internal.ConfigurationItemManager.resolveProcessConfiguration(ConfigurationItemManager.java:124) at com.ibm.team.workitem.common.internal.ConfigurationItemManager.readConfigurationItems(ConfigurationItemManager.java:107) at com.ibm.team.workitem.common.internal.WorkItemTypeManager.readConfigurationItems(WorkItemTypeManager.java:370) at com.ibm.team.workitem.common.internal.ConfigurationItemManager.updateCache(ConfigurationItemManager.java:99) at com.ibm.team.workitem.common.internal.util.CacheHelper.internalCheckCache(CacheHelper.java:107) at com.ibm.team.workitem.common.internal.util.CacheHelper.checkCache(CacheHelper.java:73) at com.ibm.team.workitem.common.internal.util.CacheHelper.checkCache(CacheHelper.java:65) at com.ibm.team.workitem.common.internal.ConfigurationItemManager.findConfigurationItems(ConfigurationItemManager.java:48) at com.ibm.team.workitem.common.internal.WorkItemCommon.findWorkItemTypes(WorkItemCommon.java:410) at com.ibm.team.workitem.common.internal.expression.WorkItemQueryAttributeFactory.cacheCustomAttributesFromWorkitemTypes(WorkItemQueryAttributeFactory.java:452) at com.ibm.team.workitem.common.internal.expression.WorkItemQueryAttributeFactory.updateCache(WorkItemQueryAttributeFactory.java:137) at com.ibm.team.workitem.common.internal.util.CacheHelper.internalCheckCache(CacheHelper.java:107) at com.ibm.team.workitem.common.internal.util.CacheHelper.checkCache(CacheHelper.java:73) at com.ibm.team.workitem.common.internal.expression.WorkItemQueryAttributeFactory.findAttribute(WorkItemQueryAttributeFactory.java:102) at net.jazz.ant.samples.arne.CheckSnapWorkItem.checkSnapWorkItem(CheckSnapWorkItem.java:93) at net.jazz.ant.samples.arne.ReviewChangeSetHistory.doExecute(ReviewChangeSetHistory.java:288) at com.ibm.team.build.ant.task.AbstractTeamBuildTask.execute(AbstractTeamBuildTask.java:666) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) at org.apache.tools.ant.Project.executeTarget(Project.java:1306) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1189) at org.apache.tools.ant.Main.runBuild(Main.java:758) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) Caused by: java.lang.ClassNotFoundException: org.eclipse.jface.text.BadLocationException at java.net.URLClassLoader.findClass(URLClassLoader.java:434) at java.lang.ClassLoader.loadClass(ClassLoader.java:677) at java.lang.ClassLoader.loadClass(ClassLoader.java:643) ... 42 more How to fix this? |
Accepted answer
One other answer
Reusing the answer in https://jazz.net/forum/questions/92009/badlocationexception-when-querying-for-work-items-using-java-api I copied the org.eclipse.text_3.5.0.v20100601-1300.jar from my RTC Eclipse client plugin directory to <Build_Install_Path>\buildsystem\buildtoolkit
The build then works without breaking. I tried various other ways of referencing that org.eclipse.text. Is there a more graceful way of solving this issue? Comments 1
Donald Nong
commented May 04 '14, 11:31 p.m.
RTC and the build tool kit are two different Java environments, so necessary .jar files have to be distributed to both environments for certain Java applications to run properly. I don't know how you distribute the custom plugin, but you need to make sure the org.eclipse.text.###.jar file is included in the distribution (as being copied in your case). I can't think of anything "more graceful".
Donald, thanks for the answer. I guess by "more graceful" I am asking for the minor RFE to include the org.eclipse.text in the standard build toolkit distribution.
|