SpringXD module delete command does not delete the uploaded .jar file

953 views Asked by At

Issue

SpringXD's module delete command is deleting the module from SpringXD DIRT (module list command does not show the delete module) but is not deleting the uploaded .jar file in /xd/custom-modules/job directory. The reason is that .jar file is used by a java process even after the deployed module is deleted from SpringXD DIRT. If I restart the admin and container I can delete the file.

using module upload command with --force option results in following error:

java.lang.IllegalArgumentException: Could not install Uploaded module 'job:ang-im-job' at location file [C:\install_dir\xd\custom-modules\job\batch-job.jar] as that file already exists

I am using SpringXD 1.2 and on Windows 7. Is this something to do with OS?

Below are the scripts, I am going to parameterize them and integrate with automated deployment tool so that same scirpts can be used for deploying modules in SpringXD DIRT.

upload_module.bat

set ASSEMBLY_PATH=C:\path_to_assembly\batch-job-01.00.00.00-SNAPSHOT.jar

set MODULE_NAME=batch-job

set MODULE_TYPE=job

cd %XD_INSTALL_DIR%\shell\bin\

xd-shell module upload --force --file %ASSEMBLY_PATH% --name %MODULE_NAME% --type %MODULE_TYPE%

deploy_job.bat

set MODULE_NAME=batch-job

set DEPLOY_JOB_NAME=batch-job

cd %XD_INSTALL_DIR%\shell\bin\

xd-shell job create --name %DEPLOY_JOB_NAME% --definition "%MODULE_NAME%" --deploy

destroy_job.bat

set DEPLOY_JOB_NAME=batch-job

cd %XD_INSTALL_DIR%\shell\bin\

xd-shell job destroy --name %DEPLOY_JOB_NAME%

delete_module.bat

set MODULE_NAME=batch-job

cd %XD_INSTALL_DIR%\shell\bin\

xd-shell module delete --name job:%MODULE_NAME%

2

There are 2 answers

0
Gaurang Bhatt On BEST ANSWER

Issue is with the OS. On Windows module delete command is not deleting the .jar file after it deletes from SpringXD DIRT environment. No such issues on Linux.

0
whoami On

In my case, though the XD shell said the below error, i don't see the module in admin-ui

xd:>module delete --name job:reverseJob

Command failed org.springframework.xd.rest.client.impl.SpringXDException: Could
not delete module 'job:reverseJob'