If you create a user with a name like Conan O'Brien, and try to use OpenContent to do something like return his inbox items, the DQL will fail. I'll just point out the first case I hit (whoever fixes this should probably look for other possibilities). Note that the times that this occurs is likely when we are constructing our own DQL queries and simply forget that some user's might have apostrophes in their names.
In WorkflowService.java, the method populateUserAndGroups(session, userIds), the DQL that gets created is malformed into the following:
SELECT group_name FROM dm_group WHERE ANY i_all_users_names IN ('Conan O'Brien');
Which leads to the following error:
DfException:: THREAD: http-8080-Processor21; MSG: [DM_QUERY_E_SYNTAX]error: "A Parser Error (syntax error) has occurred in the vicinity of: SELECT group_name FROM dm_group WHERE ANY i_all_users_names IN ('Conan O'Brien"; ERRORCODE: 100; NEXT: null
at com.documentum.fc.client.impl.docbase.DocbaseExceptionMapper.newException(DocbaseExceptionMapper.java:57)
at com.documentum.fc.client.impl.connection.docbase.MessageEntry.getException(MessageEntry.java:39)
at com.documentum.fc.client.impl.connection.docbase.DocbaseMessageManager.getException(DocbaseMessageManager.java:137)
at com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient.checkForMessages(NetwiseDocbaseRpcClient.java:305)
at com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient.applyForCollection(NetwiseDocbaseRpcClient.java:429)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection$3.evaluate(DocbaseConnection.java:1136)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.evaluateRpc(DocbaseConnection.java:1007)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.applyForCollection(DocbaseConnection.java:1124)
at com.documentum.fc.client.impl.docbase.DocbaseApi.exec(DocbaseApi.java:82)
at com.documentum.fc.client.impl.session.Session.query(Session.java:3247)
at com.documentum.fc.client.impl.session.SessionHandle.query(SessionHandle.java:2232)
at com.documentum.fc.client.DfQuery.runQuery(DfQuery.java:161)
at com.documentum.fc.client.DfQuery.execute(DfQuery.java:205)
at com.tsgrp.util.dctm.DfcAccessor.doQuery(Unknown Source)
at com.tsgrp.util.dctm.DfcTemplate.queryForValueResults(Unknown Source)
at com.tsgrp.util.dctm.DfcTemplate.queryForStringResults(Unknown Source)
at com.tsgrp.opencontent.dctm.workflow.WorkflowService.populateUserAndGroups(WorkflowService.java:901)
at com.tsgrp.opencontent.dctm.workflow.WorkflowService.retrieveUserMap(WorkflowService.java:849)
at com.tsgrp.opencontent.dctm.workflow.WorkflowService.getAllInboxItems(WorkflowService.java:86)
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:585)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)
To fix this, escape out the single quote from the userIds that are being iterated over, whether there is some helper method somewhere or one can be created.