[crowd] Crowd 2.3 Customs Directory example code

Jerome Taylor October 24, 2011

Does anyone have example code of a custom directory for Crowd 2.3. I am trying to create one and am getting a java.lang.NullPointerException. Exception trace stack:

java.lang.NullPointerException
at com.atlassian.crowd.manager.application.ApplicationServiceGeneric.isUserAuthorised(ApplicationServiceGeneric.java:171)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:20)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy10.isUserAuthorised(Unknown Source)
at com.atlassian.crowd.manager.application.CachingApplicationService.isUserAuthorised(CachingApplicationService.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:20)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy10.isUserAuthorised(Unknown Source)

public class CSPDirectoryServer implements RemoteDirectory {

public User authenticate(String name, PasswordCredential credential)

throws UserNotFoundException, InactiveAccountException,

InvalidAuthenticationException, ExpiredCredentialException,

OperationFailedException {

log.info("authenticate(“ + name + “)");

UserTemplate user = new UserTemplate(name, getDirectoryId());

user.setName(name);

user.setFirstName("Joe");

user.setLastName("Nevermind");

user.setDisplayName("Nevermind, Joe (" + name + ")");

user.setEmailAddress(name + "@cmp.com");

user.setActive(true);

log.info("User: " + user.toString());

return (User) user;

}

….

}

1 answer

1 accepted

0 votes
Answer accepted
Jeff Kirby
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.
October 24, 2011

I recommend downloading the source code for Crowd 2.3 from my.atlassian.com.

Then in your IDE of choice, set a break point at line 171 of com.atlassian.crowd.manager.application.ApplicationServiceGeneric line 171

and see what it is that is null

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events