cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti 5.13 Configuring LDAP - NullPointerException

jhutchins
Champ in-the-making
Champ in-the-making
Hello,

Im new to activiti and am conducting some research on its capabilities, so far very interesting project! I'm attempting to utilize the ldap intgration that was add in 5.13 so AD users can log into activiti-explorer. I have followed all the instructions I could find on the user guide and on the forum post http://forums.activiti.org/content/aciviti-513-ldap-integration .

So far I have downloaded and deployed the activiti-ldap.jar. I have modified the activiti-ui-context.xml and activiti-standalone-context.xml using the examples in the prior forum post and in the activiti userdocs.

Here is my activiti-standalond-context.xml

   <property name="configurators">
          <list>
              <bean class="org.activiti.ldap.LDAPConfigurator">             
                <!– Server connection params –>
                <property name="server" value="ldap://dc1.dev.lan" />
                <property name="port" value="389" />
                <property name="user" value="sAMAcountName=administrator" />
                <property name="password" value="**********" />
               
                <!– Query params –>
                <property name="baseDn" value="ou=demo, dc=dev, dc=lan" />
                <property name="queryUserByUserId" value="(&amp;(objectClass=inetOrgPerson)(sAMAccountName={0}))" />
                <property name="queryUserByFullNameLike" value="(&amp;(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))" />
                <property name="queryGroupsForUser" value="(&amp;(objectClass=groupOfUniqueNames)(uniqueMember={0}))" />
               
                <!– Attribute config –>
                <property name="userIdAttribute" value="sAMAccountName" />
                <property name="userFirstNameAttribute" value="givenName" />
                <property name="userLastNameAttribute" value="sn" />
               
                <property name="groupIdAttribute" value="sAMAccountName" />
                <property name="groupNameAttribute" value="cn" />               
              </bean>
          </list>
        </property>

For the activiti-ui-context.xml I was unsure of the changes i had to make so i left it as is

<property name="adminGroups">
     <list>
      <value>admin</value>
     </list>
   </property>
   <property name="userGroups">
      <list>
        <value>user</value>
      </list>
   </property>

Lastly here is the stack trace I receive while attempting to login on the activiti-explorer app


java.lang.NullPointerException
at org.activiti.explorer.ui.login.DefaultLoginHandler.authenticate(DefaultLoginHandler.java:41)
at org.activiti.explorer.ui.login.DefaultLoginHandler.authenticate(DefaultLoginHandler.java:35)
at org.activiti.explorer.ui.login.LoginPage$ActivitiLoginListener.onLogin(LoginPage.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
at com.vaadin.ui.LoginForm$2.handleParameters(LoginForm.java:103)
at com.vaadin.ui.Window.handleParameters(Window.java:515)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:528)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.activiti.explorer.filter.ExplorerFilter.doFilter(ExplorerFilter.java:44)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

I'm more of a systems guy then a developer but I'm trying to learn Thank you for any assistance.

Jake
8 REPLIES 8

trademak
Star Contributor
Star Contributor
Is this the full stacktrace?
On the line of the error we have the following code:

if (identityService.checkPassword(userName, password)) {

So I'm thinking the identityService is null. Did you change something in the configuration or do you see more detailed error messages?

Best regards,

jhutchins
Champ in-the-making
Champ in-the-making
Tijs,

Thanks for the reply. This is the entire stack trace. I carefully checked all the logs after startup and loading the login page. The logs are clean until i attempt to login with a AD user. This is when the above stacktrace appears. I have made two other changes, One was removing the DemoDataGenerator bean as required per the Userguide for ldap integration. Second I configured db.properties file to use a SQL database. These changes and the ones from my first post are the only changes I have made to the activiti since downloading it and deploying it to Tomcat.

Thanks,
Jake

sai_6491
Champ in-the-making
Champ in-the-making
Hi Jake. is it resolved?
I am also facing the same issue.
Any help appreciated.

sai_6491
Champ in-the-making
Champ in-the-making
Here are my activiti-standalone-context.xml
activiti-ui.xml as text files. I am also getting the same stack Trace as Jake.

frederikherema1
Star Contributor
Star Contributor
It seems to be an error related to the initialisation of the identity-service. Do you have the required ldap-libraries on your classpath in tomcat?

tomasgj
Champ in-the-making
Champ in-the-making
I'm facing the same issue and, yes, I have the ldap libraries on my classpath. Decompiling DefaultLoginHandler I can see that at line 41 the sentence is:

<code>if(!i$.hasNext())</code>

So the "identityService" is not NULL. The problem should be getting the groups, but I don't know why.

Any help would be apreciated.


Tomas

pradeep_mulimat
Champ in-the-making
Champ in-the-making
May I know the procedure to integrate LDAP with Activiti?

Thanks in advance.
Pradeep M

jbarrez
Star Contributor
Star Contributor