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

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

Open
vidurananayakkara opened this issue Nov 2, 2017 · 4 comments
Open

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

vidurananayakkara opened this issue Nov 2, 2017 · 4 comments
Labels

Comments

@vidurananayakkara
Copy link
Contributor

vidurananayakkara commented Nov 2, 2017

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:

  • Download activemq-client-5.9.0.jar from https://mvnrepository.com/artifact/org.apache.activemq/activemq-client/5.9.0
  • icf-provider.bat org.apache.activemq.jndi.ActiveMQInitialContextFactory /temp/activemq-client-5.9.0.jar /temp should create the BundleActivator to jar activemq-client-5.9.0.jar which will register the user mentioned ICF implementation according to the OSGi JNDI spec (However it doesn't in Windows environment)

Related Issues:

@dzatloukal
Copy link

Can someone resolve this issue?

@dzatloukal
Copy link

dzatloukal commented Mar 28, 2018

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
Copy link
Member

this commented May 16, 2018

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

@this this changed the title ICF Tool bash script is not working as expected ICF -Provider Tool bat script is not working as expected Jul 26, 2018
@this this changed the title ICF -Provider Tool bat script is not working as expected ICF-Provider Tool bat script is not working as expected Jul 26, 2018
@ljuillerat
Copy link

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

@jsdjayanga jsdjayanga added the C5 label Jul 4, 2019
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

5 participants