You need to apply .patch file to the code base and create jar(s) out of it. Then Create a folder with the name of the patch (eg: patch001) and place the jar(s) inside and copy newly created patch folder (eg: patch001) to repository/components/patches.
Now running the wso2server.sh -DapplyPatches will work.
when you execute -DapplyPatches, it takes a backup of the original content of the repository/components/plugins directory to repository/components/patches directory that's why you see patch000 folder (hence revert-back to a previous state is possible).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…