Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

noClassDefFoundError FingerprintChecker On CreateIssueHandler initialisation

Reinis July 8, 2024

Hi. Im new to jira plugin development. And been given a task to fix this error on our custom incoming email handler. As this is legacy code, I have no deep knowledge why and how this worked before, but at this time it goes something like this: 
Using jira 9.6.0
Amps. 8.14.3
jira-mail-plugin v17.0.7

We call handler1 that implements MessageHandler. And its pretty blank, just straight on calls (In the handler1 handleMessage method) handler2 that extends CreateIssueHandler. 
In this handler2 "handleMessage" method is mostly copy paste, but with some added custom logic inside.

And in this jira-mail-plugin version CreateIssueHandler requires constructor with multiple parameters, an one of them is FingerPrintChecker. 

Its getting passed from Handler1 like so: 

FingerprintChecker fingerprintChecker = ComponentAccessor.getOSGiComponentInstanceOfType(FingerprintChecker.class);

And then gets passed into Handler2 constructor and super into CreateIssueHandler.

Problem is that I get 

"java.lang.NoClassDefFoundError: com/atlassian/jira/plugins/mail/handlers/fingerprint/FingerprintChecker"

And I Cannot seem to find a way to fix this noClassDefFoundError
I have tried to access it as a Component, to use @ComponentImport
To change that Checker to DefaultFingerPrintChecker, 

I have ran it locally and multiple times cleared everyting with atlas-clean. So no cache issues or anything of that sort.
I even tried to rewrite that logic without using CreateIssueHandler, but ran into issue that I needed to rewrite "
createAttachmentsForMessage" And many other methods from those original Jira handlers and its just too much. I guess I don't know how to properly use MessageHandler to rewrite it correctly, and there is also none existing documentation for it. So any help would be appreciated with getting rid of this noClassDef

1 answer

0 votes
Tuncay Senturk _Snapbytes_
Community Champion
July 8, 2024

Hi @Reinis 

Welcome to the Community!

This NoClassDefFoundError can be tricky most of the time.

I assume you have already imported the component using the @ComponentImport annotation to import it as a dependency.

Additionally, I'd suggest ensuring that FingerprintChecker is a valid OSGi component. Adding an import-package element to the pom.xml might work, something like the one below.

<Import-Package>
com.atlassian.jira.plugins.mail.handlers.fingerprint;version="[17.0.0,18.0.0)",
</Import-Package>

 Last, did you add component-import line to the atlassian-plugin.xml?

 

<component-import key="fingerprintChecker" interface="com.atlassian.jira.plugins.mail.handlers.fingerprint.FingerprintChecker"/>

I hope this will lead you in the right direction!

Reinis July 8, 2024

Thanks for the fast replay. And yes I have moved import to use @componentImport.

Unfortunately by adding both of those things plugin won’t even enable. And I can’t seem to find logs regarding it. 

Suggest an answer

Log in or Sign up to answer