Wednesday, December 4, 2013

Overcome "class path is too long" error while executing WSO2 ciper tool in windows

The cipher tool is there to encrypt and decrypt simple texts and by default bundled with all WSO2 products. You can simply use this tool by running either the shell script or batch script inside <PRODUCT_HOME>/bin directory according to your environment.

I'm not going to explain in detail about this tool, but you can find out more information from here[1].

In this blog post I'm going to explain a workaround to get rid of the error "The class path is too long for the windows shell to handle it" when you try to run ciphertools.bat -Dconfigure" command within windows environment.

Before continue further just take a back-up of the <PRODUCT_HOME>/bin/cipertools.bat file.

What you have to do is update line no 73 to 77 with,
call ant -buildfile "%CARBON_HOME%\bin\build.xml" -q
set CARBON_CLASSPATH=.\conf
FOR %%c in ("%CARBON_HOME%\lib\*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\lib\%%~nc%%~xc"
FOR %%C in ("%CARBON_HOME%\repository\lib\*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\repository\lib\%%~nC%%~xC"
This snippet will only add dependent jar files to the class_path and you can get rid of the above mentioned issue.


[1] http://docs.wso2.org/display/Carbon420/Encrypting+and+Decrypting+Simple+Texts

No comments:

Post a Comment