Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the Loading each jar in <APIM_HOME>/lib and plugins directory during the cipher tool execution #3752

Open
nadeepoornima opened this issue Mar 1, 2025 · 0 comments
Labels

Comments

@nadeepoornima
Copy link

Description

Based on our cipher tool script, it loads each jar within the following two locations to find "org.wso2.ciphertool.CipherTool" runtime.

<APIM_HOME>/lib/.jar
<APIM_HOME>/repository/components/plugins/
.jar
Both directories contain 756 jars, and based on the logic below, each jar is loaded.

# update classpath
CARBON_CLASSPATH=""
for f in "$CARBON_HOME"/lib/*.jar
do
  CARBON_CLASSPATH=$CARBON_CLASSPATH:$f
done
for h in "$CARBON_HOME"/repository/components/plugins/*.jar
do
  CARBON_CLASSPATH=$CARBON_CLASSPATH:$h
done
CARBON_CLASSPATH=$CARBON_CLASSPATH:$CLASSPATH

Therefore, when executing the below command, the customer observed the "Argument list too long" error.

Command:

$JAVA_HOME/bin/java -Dcarbon.home="$CARBON_HOME" -Dcarbon.config.dir.path="$CARBON_HOME"/repository/conf -classpath "$CARBON_CLASSPATH" org.wso2.ciphertool.CipherTool $*
  • Error
760
/******/wso2am-4.2.0/bin/ciphertool.sh: line 127: //bin/java: Argument list too long
761
Cleaning up project directory and file based variables
00:00
762
ERROR: Job failed: exit status 1
  • Reason
    The "CARBON_CLASSPATH" variable value becomes too long because we are appending each jar.

  • Solution

# Update classpath using folder-based approach
CARBON_CLASSPATH="$CARBON_HOME/lib/*:$CARBON_HOME/repository/components/plugins/*:$CLASSPATH"

Steps to Reproduce

Perform cipher encryption in a VM with limited processing capability to handle arguments."

Version

APIM 4.3.0, APIM 4.2.0

Environment Details (with versions)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant