Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

NoClassDefFoundError when executing package via a PostFunction, which was included in plugin?

I have included a class which uses MongoDB driver in a customfield plugin. The Mongo driver has been added as a dependency and as one of the Import Packages in the plugin pom file as per below.

<Import-Package>org.bson.*;resolution:="optional", com.mongodb.*;resolution:="optional", org.springframework.osgi.*;resolution:="optional", org.eclipse.gemini.blueprint.*;resolution:="optional", *</Import-Package>

Everything has compiled and is well, however when I try to use the MongoClient class in a post function script (using script runner) the following error is returned:

java.lang.NoClassDefFoundError: com/mongodb/MongoClient
	at com.rs2.jira.plugin.customfield.jira.customfields.MongoHelper.<init>( [?:?]
	at com.rs2.jira.plugin.customfield.jira.customfields.CarrierToDb.getMongoHelper( [?:?]
	at com.rs2.jira.plugin.customfield.jira.customfields.CarrierToDb$ Source) [?:?]
	at [?:?]
	at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.runScriptAndGetContext(ScriptRunnerImpl.groovy:158) [?:?]
	at com.onresolve.scriptrunner.runner.ScriptRunner$runScriptAndGetContext$0.callCurrent(Unknown Source) [?:?]
	at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.runStringAsScript(ScriptRunnerImpl.groovy:146) [?:?]
	at com.onresolve.scriptrunner.runner.ScriptRunner$ Source) [?:?]
	at com.onresolve.scriptrunner.canned.jira.utils.CustomScriptDelegate.doScript(CustomScriptDelegate.groovy:66) [?:?]
	at com.onresolve.scriptrunner.canned.jira.utils.CustomScriptDelegate$ Source) [?:?]
	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.CustomScriptFunction.doScript(CustomScriptFunction.groovy:44) [?:?]


How is it possible that the class is not found, when it is explicitly provided?

1 answer


In order to do this you need to use the @WithPlugin and the plugin that you have inserted the MongoDB driver into.

You have more information about this here.

If I can help you further let me know.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

Why you should move agile planning to Lucidspark’s digital whiteboard

During my 17 years as a coach, mentor, and trainer of Agile teams, I’ve participated in hundreds of Agile planning meetings. The end result was a wall of backlog items annotated by an explosion of co...

91 views 0 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you