Custom checkin policies plugin for TFS fails to load

Answered

I've got the following problem:
I downloaded sample checkin policies from here: https://confluence.jetbrains.com/display/IDEADEV/Team+Foundation+Server+(TFS)+Integration.
Then I added references to Intellij Idea SDK and to tfsIntegration.jar library (%IDEA_HOME%/plugins/tfsIntegration/lib/tfsIntegration.jar). 
Everything compiles well, but when I install plugin it is not loaded. 
If I start debugging, I see the following message: 

java.lang.Throwable: Extension class sample.WorkItemLinkedPolicy does not implement class org.jetbrains.tfsIntegration.checkin.PolicyBase
at com.intellij.openapi.extensions.Extensions$SimpleLogProvider.error(Extensions.java:216)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.registerExtension(ExtensionPointImpl.java:149)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapters(ExtensionPointImpl.java:250)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.getExtensions(ExtensionPointImpl.java:194)
at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:100)
at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:87)
at org.jetbrains.tfsIntegration.checkin.CheckinPoliciesManager.getInstalledPolicies(CheckinPoliciesManager.java:65)
at org.jetbrains.tfsIntegration.checkin.CheckinPoliciesManager.find(CheckinPoliciesManager.java:83)
at org.jetbrains.tfsIntegration.checkin.CheckinParameters.evaluatePolicies(CheckinParameters.java:301)
at org.jetbrains.tfsIntegration.checkin.CheckinParameters$1.run(CheckinParameters.java:270)
at org.jetbrains.tfsIntegration.core.tfs.TfsExecutionUtil$4.run(TfsExecutionUtil.java:205)
at org.jetbrains.tfsIntegration.core.tfs.TfsExecutionUtil$4.run(TfsExecutionUtil.java:203)
at org.jetbrains.tfsIntegration.core.tfs.TfsExecutionUtil$3.run(TfsExecutionUtil.java:194)
at org.jetbrains.tfsIntegration.core.tfs.TfsExecutionUtil$1.run(TfsExecutionUtil.java:154)
at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:227)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
at com.intellij.openapi.progress.impl.CoreProgressManager$8.run(CoreProgressManager.java:357)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:446)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
at com.intellij.openapi.application.impl.ApplicationImpl$14$1.run(ApplicationImpl.java:626)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:365)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)

 

It is very strange, as my plugin class sample.WorkItemLinkedPolicy does extend org.jetbrains.tfsIntegration.checkin.PolicyBase (as in the example), which is located in tfsIntegration.jar.
I build and run plugin using the same Intellij Idea instance on the same machine.
Any ideas, how to fix the problem?
Thanks a lot!

1 comment
Comment actions Permalink

After some investigation with the help of Jet Brains support, I solved this issue:
I added tfsIntegration.jar as an external library to the project, which is incorrect.
Instead, I should have added tfsIntegration.jar to classpath section of Intellij Idea SDK.

1

Please sign in to leave a comment.