I'm getting a NoClassDefFoundException exception in one of my wired integration tests when I try to use some of the classes in my main packages.
For instance, I try to do this:
MyResultClass result = componentBeingTested.myMethod(); assertEquals(MyResultType.TYPE_ONE, result.getType());
And I would get a NoClassDefFoundException about the class containing the MyResultType enum on the assert line.
Community moderators have prevented the ability to post new answers.
same here with JIRA 5.2.11
it's not just entities that are affected. I am stuck with my own POJO's and my own Exception class.
This seems to be related to the packaging. There are classes missing in the test bundle. Maybe we have to declare them somewhere? However i couldn't find any documentation.
I have the same issue with the simple Unit tests as well. I have a simple auto-generated unit test for my plug-in. It runs fine with atlas-unit-test. But I get a java.lang.NoClassDefFoundError when I run the same test through the JIRA plug-in test console.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the EXACT same issue. I can't believe there is no answer to this question!? I followed the simple instructions to create a Wired test using the AtlassianPluginsTestRunner class. I inject ActiveObjects. But when I try to retrieve one of my entities, I get a java.lang.NoClassDefFoundError ! What am I missing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are there any news on this topic? I'm stuck there, too.
I know I have the option to make my plugin export its packages by adding to the POM:
<instructions> <Export-Package>...</Export-Package> </instructions>
However, these exports should not exist in the final product, so I would like to see them only in the test phase. Does anyone have an idea how to achieve this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any update on issues like this? I'm getting a similar issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This problem seems like something related to the packaging of the plugin and the tests. If you can send me the code or the project with just the test and the classes it references (including the pom.xml and atlassian-plugin.xml), so I can test locally I'll try to help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Extracting the AggregationReturnType doesn't seem to fix it, unfortunately.
The following piece of test code gives the same NoClassDefFoundException on the cast to WebServiceAggregationResultNumber:
WebServiceAggregationResultNumber result = (WebServiceAggregationResultNumber) aggregationManager.aggregateByFilter("10005", "customfield_10002", "min", "number", userManager.getUser("admin")); assertEquals((Double) 0.5, (Double) result.getValue());
I am getting similar issues running my unit tests through the plugin test console (ClassNotFoundExceptions). They work fine when run with atlas-unit-test.
I have other wired tests that run fine, but they don't use any classes from my main package except for the components I'm testing (but those get injected).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you try to extract the AggregationReturnType in its own class so it's not an inner class ? I can't give exact reason for the failure but I suspect that there might be some problem with AggregationReturnType being inner class.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, it happens even after a clean.
This is the part of the server log when I run the test class (it only shows 1 actual test, the other tests result in the same stuff being written to the server log). The AggregationReturnType is the MyResultType enum from my question.
The "java.lang.UnsupportedOperationException: Attempted to serialize java.lang.Class: mypackage.common.representation.ErrorCollectionRepresentation. Forgot to register a type adapter?" is also unusual since I have tests (in other test classes) that test if my REST resources provide error information on bad input and the ErrorCollectionRepresentation seems to get serialized fine there.
This is my plugin's pom.xml.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is this happening after cleaning and rebuilding your plugin and running tests again ?
If yes - please provide more information like logs and your plugins pom.xml file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.