PurgeProcess.bat fix

Update

This bug should be fixed in Core | Quick Fix 1048-010

There is a command line tool in AEM Forms JEE that allows you to purge processes from the system. It can be found in <install-dir>/sdk/misc/Foundation/ProcessPurgeTool folder.

Problem is, it doesn’t work. It throws an error similar to:

UNEXPECTED ERROR!!! See the stack trace below for details.
 java.lang.NoClassDefFoundError: org/apache/commons/httpclient/protocol/SecureProtocolSocketFactory
 at com.adobe.idp.workflow.ProcessPurgeTool.getSoapClientFactory(ProcessPurgeTool.java:197)
 at com.adobe.idp.workflow.ProcessPurgeTool.purgeProcess(ProcessPurgeTool.java:291)
 at com.adobe.idp.workflow.ProcessPurgeTool.main(ProcessPurgeTool.java:457)
 Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory
 at java.net.URLClassLoader$1.run(Unknown Source)
 at java.net.URLClassLoader$1.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 ... 3 more

Solution: you have to add %THIRDPARTY_DIR%\commons-httpclient-3.1.jar; to the SOAP_LIBS path in the batch file or shell script.

Windows Batch file

@ECHO OFF
SETLOCAL

IF NOT DEFINED LIVECYCLE_SDK_HOME (
ECHO Please set LIVECYCLE_SDK_HOME environment variable.
ECHO It should point to the LiveCycle SDK root directory.
ECHO For example: set LIVECYCLE_SDK_HOME=&amp;amp;quot;C:\Adobe\Adobe_Experience_Manager_forms\sdk&amp;amp;quot;
GOTO end
)

IF NOT EXIST &amp;amp;quot;%LIVECYCLE_SDK_HOME%\client-libs\common\adobe-livecycle-client.jar&amp;amp;quot; (
ECHO The LIVECYCLE_SDK_HOME environment variable seems to point to a wrong directory.
GOTO end
)

SET SDK_COMMON_DIR=%LIVECYCLE_SDK_HOME%\client-libs\common
SET THIRDPARTY_DIR=%LIVECYCLE_SDK_HOME%\client-libs\thirdparty
SET SOAP_LIBS=%THIRDPARTY_DIR%\activation.jar;%THIRDPARTY_DIR%\axis.jar;%THIRDPARTY_DIR%\commons-codec-1.3.jar;%THIRDPARTY_DIR%\commons-collections-3.1.jar;%THIRDPARTY_DIR%\commons-discovery.jar;%THIRDPARTY_DIR%\commons-logging.jar;%THIRDPARTY_DIR%\dom3-xml-apis-2.5.0.jar;%THIRDPARTY_DIR%\jaxen-1.1-beta-9.jar;%THIRDPARTY_DIR%\jaxrpc.jar;%THIRDPARTY_DIR%\log4j.jar;%THIRDPARTY_DIR%\mail.jar;%THIRDPARTY_DIR%\saaj.jar;%THIRDPARTY_DIR%\serializer.jar;%THIRDPARTY_DIR%\wsdl4j.jar;%THIRDPARTY_DIR%\xalan.jar;%THIRDPARTY_DIR%\xbean.jar;%THIRDPARTY_DIR%\xercesImpl.jar;%THIRDPARTY_DIR%\commons-httpclient-3.1.jar;
SET CLASSPATH=process-purge-tool.jar;%SDK_COMMON_DIR%\adobe-livecycle-client.jar;%SDK_COMMON_DIR%\adobe-workflow-client-sdk.jar;%SDK_COMMON_DIR%\adobe-jobmanager-client-sdk.jar;%SDK_COMMON_DIR%\adobe-usermanager-client.jar;%SOAP_LIBS%

CALL java -cp &amp;amp;quot;%CLASSPATH%&amp;amp;quot; com.adobe.idp.workflow.ProcessPurgeTool %*

:end
ENDLOCAL

Korn Shell script

#!/bin/ksh

if [ &amp;quot;$LIVECYCLE_SDK_HOME&amp;quot; == &amp;quot;&amp;quot; ] ; then
  echo &amp;quot;Please set LIVECYCLE_SDK_HOME environment variable.&amp;quot;
  echo &amp;quot;It should point to the LiveCycle SDK root directory.&amp;quot;
  echo &amp;quot;For example: export LIVECYCLE_SDK_HOME=/home/Adobe_Experience_Manager_forms/sdk&amp;quot;
  exit 1
fi

export SDK_COMMON_DIR=$LIVECYCLE_SDK_HOME/client-libs/common
export THIRDPARTY_DIR=$LIVECYCLE_SDK_HOME/client-libs/thirdparty
export SOAP_LIBS=$THIRDPARTY_DIR/activation.jar:$THIRDPARTY_DIR/axis.jar:$THIRDPARTY_DIR/commons-codec-1.3.jar:$THIRDPARTY_DIR/commons-collections-3.1.jar:$THIRDPARTY_DIR/commons-discovery.jar:$THIRDPARTY_DIR/commons-logging.jar:$THIRDPARTY_DIR/dom3-xml-apis-2.5.0.jar:$THIRDPARTY_DIR/jaxen-1.1-beta-9.jar:$THIRDPARTY_DIR/jaxrpc.jar:$THIRDPARTY_DIR/log4j.jar:$THIRDPARTY_DIR/mail.jar:$THIRDPARTY_DIR/saaj.jar:$THIRDPARTY_DIR/serializer.jar:$THIRDPARTY_DIR/wsdl4j.jar:$THIRDPARTY_DIR/xalan.jar:$THIRDPARTY_DIR/xbean.jar:$THIRDPARTY_DIR/xercesImpl.jar:$THIRDPARTY_DIR/commons-httpclient-3.1.jar
export CLASSPATH=./process-purge-tool.jar:$SDK_COMMON_DIR/adobe-livecycle-client.jar:$SDK_COMMON_DIR/adobe-workflow-client-sdk.jar:$SDK_COMMON_DIR/adobe-jobmanager-client-sdk.jar:$SDK_COMMON_DIR/adobe-usermanager-client.jar:$SOAP_LIBS

set -f

java -cp $CLASSPATH com.adobe.idp.workflow.ProcessPurgeTool &amp;quot;$@&amp;quot;

Invoking AEM Forms 6.2 services via EJB in JBoss

From Jboss AS6 onwards (AEM Forms JEE 6.0+) , the way you invoke Forms services via EJB has changed.

Below is a code snippet from a DSC of how to invoke the TaskManagerService via EJB in AEM Forms 6.2. Note how the scheme ‘jnp://’ has been removed from the URL.

long taskId = 1234;
Document document = null;
ServiceClientFactory factory = null;

Properties ConnectionProps = new Properties();
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "localhost:4447");
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,
				ServiceClientFactoryProperties.DSC_EJB_PROTOCOL);
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");

factory = ServiceClientFactory.createInstance(ConnectionProps);
TaskManager tmObj = TaskManagerClientFactory.getTaskManager(factory);
FormInstance formInst = tmObj.getFormInstanceForTask(taskId, 0, true);
document = formInst.getDocument();
System.out.println("Document size = " + document.length());

NOTE: You also need to start using the updated JBoss client library from your JBoss instance (\bin\client\jboss-client.jar)

aemblog

Everything AEM aka CQ5 based on my experience listed here.

Adobe AEM The Right Way

Best practices, tips, and tricks for your Adobe AEM project

/home/bkondepudi

A WCM journey with Day/Adobe CQ

Technoracle (a.k.a. "Duane's World")

A multi-purpose toolkit for the Adobe LiveCycle and AEM Forms developer.

Adobe LiveCycle Blog

A multi-purpose toolkit for the Adobe LiveCycle and AEM Forms developer.

A multi-purpose toolkit for the Adobe LiveCycle and AEM Forms developer.

XFA@Mobile

A multi-purpose toolkit for the Adobe LiveCycle and AEM Forms developer.

Code Monkey

Ramblings of a Developer