Bug with backslashes in SMX 3.2.2-SNAPSHOT under Windows
--------------------------------------------------------

                 Key: SM-1368
                 URL: https://issues.apache.org/activemq/browse/SM-1368
             Project: ServiceMix
          Issue Type: Bug
          Components: servicemix-core
    Affects Versions: 3.2.2
         Environment: Windows XP SP3, SMX 3.2.2-SNPASHOT sources
            Reporter: Ivan Pryvalov
             Fix For: 3.2.2


Class:
org.apache.servicemix.jbi.framework.AutoDeploymentService

Method: unpackLocation.

In code:

    if (location.startsWith(filePrefix)) {
                URI uri = new URI(location);
                file = new File(uri);
            } else {
                file = new File(location);
            }

 URI uri = new URI(location) throws exception because URI can work the only 
with slaches ("/"), but location is CALCULATED with backslashes.

See:

Class:
org.apache.servicemix.jbi.container.DeploySupport

Method:
getHomeDir()

     public String getHomeDir() {
        if (homeDir == null) {
            homeDir = System.getProperty("user.home", "~");
        }
        return homeDir;
    }


Method returns something like "C:\Documents and Settings\Ivan" (with 
bachslashes) and next time this string is not processed.

For exapmle,  in camel-sa-itest we get Exception 

org.apache.servicemix.jbi.container.InstallSharedLibrary 2008-05-23 
15:09:34,125 [main           ] INFO  InstallSharedLibrary           - Deploying 
shared library: file:///C:\Documents and 
Settings\Ivan\.m2\repository/org/apache/servicemix/servicemix-shared/3.2.1/servicemix-shared-3.2.1-installer.zip
org.apache.servicemix.jbi.framework.InstallationService 2008-05-23 15:09:34,125 
[main           ] ERROR InstallationService            - Deployment failed
javax.jbi.management.DeploymentException: java.net.URISyntaxException: Illegal 
character in path at index 10: file:///C:\Documents and 
Settings\Ivan\.m2\repository/org/apache/servicemix/servicemix-shared/3.2.1/servicemix-shared-3.2.1-installer.zip
        at 
org.apache.servicemix.jbi.framework.AutoDeploymentService.unpackLocation(AutoDeploymentService.java:606)
        at 
org.apache.servicemix.jbi.framework.InstallationService.installSharedLibrary(InstallationService.java:213)
        at 
org.apache.servicemix.jbi.framework.AdminCommandsService.installSharedLibrary(AdminCommandsService.java:104)
        at 
org.apache.servicemix.jbi.container.InstallSharedLibrary.doDeploy(InstallSharedLibrary.java:37)
        at 
org.apache.servicemix.jbi.container.DeploySupport.deploy(DeploySupport.java:58)
        at 
org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertiesSet(SpringJBIContainer.java:111)
...
Caused by: java.net.URISyntaxException: Illegal character in path at index 10: 
file:///C:\Documents and 
Settings\Ivan\.m2\repository/org/apache/servicemix/servicemix-shared/3.2.1/servicemix-shared-3.2.1-installer.zip
        at java.net.URI$Parser.fail(URI.java:2816)
        at java.net.URI$Parser.checkChars(URI.java:2989)
        at java.net.URI$Parser.parseHierarchical(URI.java:3073)
        at java.net.URI$Parser.parse(URI.java:3021)
        at java.net.URI.<init>(URI.java:578)
        at 
org.apache.servicemix.jbi.framework.AutoDeploymentService.unpackLocation(AutoDeploymentService.java:565)



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to