How can I fix CNFE "org.eclipse.jface.text.BadLocationException" in build when using custom build toolkit plugin?
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
Comments
I also suspect that the missing jar is masking another issue, that's causing BadLocationException to be thrown in the first place.
Nick, no. There is no BadLocationException thrown but one of the SDK interfaces actually does an import org.eclipse.jface.text.BadLocationException;
One can google the fact that this Exception really lives in the org.eclipse.text.jar rather than org.eclipse.jface.text. What I meant with the comment about "it works when called by <exec> task in ANT", this is when I called plain java classes by <exec java ...>. Obviously this worked because the class was called with the RTC Client Eclipse plugins in its classpath.
Your suggestion to copy org.eclipse.text to build toolkit is what I did and yes, I think an RFE is in order for org.eclipse.text to be included in build toolkit.
One other answer
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
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".
1 vote
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.