wso2 / carbon-kernel

Apache License 2.0
146 stars 655 forks source link

ICF-Provider Tool bat script is not working as expected #1599

Open vidurananayakkara opened 6 years ago

vidurananayakkara commented 6 years ago

Description: icf-provider.bat script (Windows OS) is not working as expected

Suggested Labels: Bug

Affected Product Version: 5.2.1 onwards

Steps to reproduce:

Related Issues:

dzatloukal commented 6 years ago

Can someone resolve this issue?

dzatloukal commented 6 years ago

Ok I realized, what was the problem. Firstly, in icf-provider.bat is badly formated carbon.home property in java -cp command. You should use -Dcarbon.home=%CARBON_HOME% instead of -Dcarbon.home="%CARBON_HOME" Full command should be java -cp ".\*;..\bin\tools\*" -Dcarbon.home=%CARBON_HOME% -Dwso2.carbon.tool="icf-provider" org.wso2.carbon.tools.CarbonToolExecutor %1 %2 %3 %4 The second problem is in ICFProviderTool.java, especially in addBundleActivatorHeader method. URI uri = URI.create("jar:file:" + (finalJarPath.toString()); This cannot work correctly in windows, because path in windows contains backslashes and on the other hand, URI can't work with backslashes. So you have to put Path converted to uri to method URI.create(). So following code works correctly -> URI uri = URI.create("jar:file:" + Paths.get(finalJarPath.toString()).toUri());

Did someone test this tool on windows before release?

this commented 6 years ago

@dzatloukal Can you send a PR for this (with above suggested solution)? We warmly welcome community contributions :)

ljuillerat commented 5 years ago

Just downloaded SP 4.3.0 which still contains this bug. Above solution solves the issue.

./icf-provider.bat notation is also not available on Windows