Plugin throws NoClassDefFoundError when loading on remote agent

Aaron Jeffries November 5, 2014

I have a Bamboo plugin that runs fine on local agents, but throws a NoClassDefFoundError when a remote agent attempts to load it.  The plugin jar does contain the class in question.

Is there any documentation that helps explain why the local and remote agents appear to load classes differently and how to code plugins accordingly?  Any other suggestions on how to fix the above issue?

Thanks in advance.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Krystian Brazulewicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 12, 2014

Can you provide more detail? What class is not found on remote agent? We try to limit number of JARs available in remote agent classpath, so we're not publishing some of the JARs that are related to generating web pages (ie velocity).

You can always embed such JAR in your plugin thus making it independent of those differences.

Aaron Jeffries November 13, 2014

Krystian, First thanks for your explanation. It makes sense that you want to keep the remote agent jars lightweight. In my case the ScanningPluginLoader is throwing a NoClassDefFoundError for org/apache/velocity/exception/VelocityException. I did already try to use the Maven shade plugin to include org.apache.velocity:velocity:1.7 in my plugin jar. When I look inside my Bamboo plugin jar I can see the VelocityException class file. Just out of curiosity I also tried dropping the velocity jar in the agent classpath folder and restarted the agent. In both cases I still seem to have this classloader issue. I wanted to ask if I am shading the right dependency? <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity</artifactId> <version>1.7</version> <dependency> I appreciate your help. Any other ideas?

TAGS
AUG Leaders

Atlassian Community Events