AnsweredAssumed Answered

Activiti REST-LDAP integration broken in 5.15.1

Question asked by b.schnarr on May 20, 2014
Latest reply on Jun 6, 2014 by jbarrez
Hello at all,

I configured Activiti 5.14 REST-Webapp with the following LDAP-Parameters and everything worked perfectly fine:


<property name="configurators">
          <list>
              <bean class="org.activiti.ldap.LDAPConfigurator">
             
                <!– Server connection params –>
                <property name="server" value="ldap://****" />
                <property name="port" value="389" />
                <property name="user" value="cn=Administrator,cn=Users,dc=ebusiness,dc=local" />
                <property name="password" value="****" />
               
                <!– Query params –>
                <property name="baseDn" value="ou=ebusiness,dc=ebusiness,dc=local" />
                <property name="queryUserByUserId" value="(&amp;(objectClass=person)(cn={0}))" />
                <property name="queryUserByFullNameLike" value="(&amp;(objectClass=person)(|({0}=*{1}*)({2}=*{3}*)))" />
                <property name="queryGroupsForUser" value="(&amp;(objectClass=group)(member={0}))" />
               
                <!– Only for Active Directories –>
                <property name="customConnectionParameters">
                <map>
                <entry key="InitialDirContext" value="Context.REFERRAL" />
                </map>
                </property>
               
                <!– Attribute config –>
                <property name="userIdAttribute" value="cn" />
                <property name="userFirstNameAttribute" value="givenName" />
                <property name="userLastNameAttribute" value="sn" />
               
                <property name="groupIdAttribute" value="cn" />
                <property name="groupNameAttribute" value="cn" />
               
              </bean>
          </list>
        </property>


Basic-Authentication worked fine. Now, I downloaded the 5.15.1 version and did a clean install (no upgrade). I configured the Rest-Webapp exactly the same way. When I test the REST-App with a REST-Plugin, the REST-API asks for my credentials (exactly as in 5.14) but instad of getting a 200 status code afterwoods, I get a 500 internal server error with this log:


Mai 20, 2014 3:09:48 PM org.restlet.resource.ServerResource doCatch
Warnung: Exception or error caught in server resource
Internal Server Error (500) - The server encountered an unexpected condition which prevented it from fulfilling the request
   at org.restlet.resource.ServerResource.doHandle(ServerResource.java:517)
   at org.restlet.resource.ServerResource.get(ServerResource.java:707)
   at org.restlet.resource.ServerResource.doHandle(ServerResource.java:589)
   at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:649)
   at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:348)
   at org.restlet.resource.ServerResource.handle(ServerResource.java:952)
   at org.restlet.resource.Finder.handle(Finder.java:246)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Router.doHandle(Router.java:431)
   at org.restlet.routing.Router.handle(Router.java:648)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:155)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:211)
   at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:84)
   at org.restlet.Application.handle(Application.java:381)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Router.doHandle(Router.java:431)
   at org.restlet.routing.Router.handle(Router.java:648)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Router.doHandle(Router.java:431)
   at org.restlet.routing.Router.handle(Router.java:648)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:211)
   at org.restlet.Component.handle(Component.java:392)
   at org.restlet.Server.handle(Server.java:516)
   at org.restlet.engine.ServerHelper.handle(ServerHelper.java:72)
   at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:152)
   at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1089)
   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.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
   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:100)
   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:1041)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
   at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: java.lang.NullPointerException
### Cause: java.lang.NullPointerException
   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98)
   at org.activiti.engine.impl.db.DbSqlSession.selectListWithRawParameter(DbSqlSession.java:331)
   at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:322)
   at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:312)
   at org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntityManager.findProcessDefinitionsByQueryCriteria(ProcessDefinitionEntityManager.java:57)
   at org.activiti.engine.impl.ProcessDefinitionQueryImpl.executeList(ProcessDefinitionQueryImpl.java:288)
   at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:143)
   at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
   at org.activiti.engine.impl.AbstractQuery.listPage(AbstractQuery.java:124)
   at org.activiti.rest.common.api.AbstractPaginateList.paginateList(AbstractPaginateList.java:104)
   at org.activiti.rest.common.api.AbstractPaginateList.paginateList(AbstractPaginateList.java:129)
   at org.activiti.rest.service.api.repository.ProcessDefinitionCollectionResource.getProcessDefinitions(ProcessDefinitionCollectionResource.java:107)
   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 org.restlet.resource.ServerResource.doHandle(ServerResource.java:506)
   … 62 more
Caused by: java.lang.NullPointerException
   at javax.naming.ldap.Rdn.escapeStringValue(Unknown Source)
   at javax.naming.ldap.Rdn.escapeValue(Unknown Source)
   at org.activiti.ldap.LDAPQueryBuilder.buildQueryGroupsForUser(LDAPQueryBuilder.java:77)
   at org.activiti.ldap.LDAPGroupManager$1.executeInContext(LDAPGroupManager.java:120)
   at org.activiti.ldap.LDAPGroupManager$1.executeInContext(LDAPGroupManager.java:116)
   at org.activiti.ldap.LDAPTemplate.execute(LDAPTemplate.java:44)
   at org.activiti.ldap.LDAPGroupManager.findGroupsByUser(LDAPGroupManager.java:116)
   at org.activiti.engine.impl.ProcessDefinitionQueryImpl.getAuthorizationGroups(ProcessDefinitionQueryImpl.java:234)
   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 org.apache.ibatis.reflection.invoker.MethodInvoker.invoke(MethodInvoker.java:37)
   at org.apache.ibatis.reflection.wrapper.BeanWrapper.getBeanProperty(BeanWrapper.java:151)
   at org.apache.ibatis.reflection.wrapper.BeanWrapper.get(BeanWrapper.java:45)
   at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:113)
   at org.apache.ibatis.scripting.xmltags.DynamicContext$ContextMap.get(DynamicContext.java:94)
   at org.apache.ibatis.scripting.xmltags.DynamicContext$ContextAccessor.getProperty(DynamicContext.java:113)
   at org.apache.ibatis.ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1657)
   at org.apache.ibatis.ognl.ASTProperty.getValueBody(ASTProperty.java:92)
   at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
   at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:210)
   at org.apache.ibatis.ognl.ASTNotEq.getValueBody(ASTNotEq.java:49)
   at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
   at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:210)
   at org.apache.ibatis.ognl.ASTAnd.getValueBody(ASTAnd.java:56)
   at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
   at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:210)
   at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:333)
   at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:413)
   at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:395)
   at org.apache.ibatis.scripting.xmltags.OgnlCache.getValue(OgnlCache.java:45)
   at org.apache.ibatis.scripting.xmltags.ExpressionEvaluator.evaluateBoolean(ExpressionEvaluator.java:29)
   at org.apache.ibatis.scripting.xmltags.IfSqlNode.apply(IfSqlNode.java:30)
   at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:29)
   at org.apache.ibatis.scripting.xmltags.IfSqlNode.apply(IfSqlNode.java:31)
   at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:29)
   at org.apache.ibatis.scripting.xmltags.TrimSqlNode.apply(TrimSqlNode.java:51)
   at org.apache.ibatis.scripting.xmltags.MixedSqlNode.apply(MixedSqlNode.java:29)
   at org.apache.ibatis.scripting.xmltags.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:37)
   at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:275)
   at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:79)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)
   … 86 more


I used this test-query: http://***:8080/activiti-rest/service/repository/process-definitions?startableByUser=gonzo
and I did not altered the source code. Then, I tried 5.14 again, everything is fine.


For me, this is a showstopper bug. Please, could anyone can confirm this problem?

Best regards
Ben

Outcomes