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

Why am I getting a ClassNotFoundException?

Georg Schmidl
Contributor
June 28, 2011

I'm trying to use the spring-ldap-code module in my plugin, but I keep getting a ClassNotFoundException for org.springframework.ldap.SizeLimitExceededException.

I also tried to force Confluence to include the package, which will give me "Unable to resolve 1010.0: missing requirement [1010.0] package; (package=org.springframework.ldap)"

<bundle-instructions>
<Import-Package>org.springframework.ldap,*;resolution:=optional</Import-Package>
</bundle-instructions>

The depencency is set to "priovided" because the .jar is in confluence/WEB-INF/lib/spring-ldap-core-1.3.0.RELEASE.jar. If i set the scope to "compile" I get all sorts of weird exceptions.

Am I missing something?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Colin Goudie
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 28, 2011

I just did a quick test with a new confluence plugin via atlas SDK with the following maven dependency inclusion

   <dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core</artifactId>
<version>1.3.0.RELEASE</version>
</dependency>

And it worked fine.

I tested it by throwing the exception in the ExampleMacro and I got an exception, not a classnotfound

The above dependency will bundle the spring libs into your plugin but I'm guessing that is ok because these mustn't be exposed via OSGi anyway

Georg Schmidl
Contributor
June 28, 2011

Yes, this will work for SizeLimitExceededException, but now I'm getting:

java.lang.NoClassDefFoundError: Could not initialize class org.springframework.ldap.core.support.LdapContextSource

and for some weird reason:

cannot find symbol : method join(java.util.ArrayList<java.lang.String>,java.lang.String) for class org.apache.commons.lang.StringUtils

TAGS
AUG Leaders

Atlassian Community Events