Karaf
  1. Karaf
  2. KARAF-891

Problem with $ charact in wrap:mvn URL

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.2.6, 3.0.0
    • Labels:
      None
    • Environment:

      OS-X Lion JDK 1.6

      Description

      When trying to install a maven jar with the wrap protocol, the syntax documented at both http://team.ops4j.org/wiki//display/paxurl/Wrap+Protocol and http://karaf.apache.org/manual/2.2.2/developers-guide/creating-bundles.html do not have the desired effect when attempting to add instructions such as Bundle-Version in the URL.

      Example: "osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1"

        Issue Links

          Activity

          Hide
          Jean-Baptiste Onofré added a comment -

          Hi Brian,

          I saw a similar issue with another "special character" used in an URL (cf KARAF-875).

          I will check if we don't have some kind of "intercept" with JLine events.

          Regards
          JB

          Show
          Jean-Baptiste Onofré added a comment - Hi Brian, I saw a similar issue with another "special character" used in an URL (cf KARAF-875 ). I will check if we don't have some kind of "intercept" with JLine events. Regards JB
          Hide
          Jamie goodyear added a comment -

          Bumping out to 2.2.5.

          Show
          Jamie goodyear added a comment - Bumping out to 2.2.5.
          Hide
          Jamie goodyear added a comment -

          this issue needs to be retested since karaf-875 resolution.

          Show
          Jamie goodyear added a comment - this issue needs to be retested since karaf-875 resolution.
          Hide
          Jean-Baptiste Onofré added a comment -

          The issue is still present on karaf-2.2.x branch and trunk.

          The $ character is not "escaped" by jline:

          karaf@root> osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1
          java.lang.RuntimeException: URL [mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1] could not be resolved.
          karaf@root> osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE\$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1
          osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1
          java.lang.RuntimeException: URL [mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1] could not be resolved.

          Show
          Jean-Baptiste Onofré added a comment - The issue is still present on karaf-2.2.x branch and trunk. The $ character is not "escaped" by jline: karaf@root> osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1 java.lang.RuntimeException: URL [mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1] could not be resolved. karaf@root> osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE\$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1 osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1 java.lang.RuntimeException: URL [mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1] could not be resolved.
          Hide
          Jean-Baptiste Onofré added a comment -

          I will take a look to escape the $ character in URL in Jline.

          Show
          Jean-Baptiste Onofré added a comment - I will take a look to escape the $ character in URL in Jline.
          Hide
          Jamie goodyear added a comment -

          Retested the above example with 2.2.6-snapshot, received the same error messages.

          karaf@root> osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1
          java.lang.RuntimeException: URL [mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1] could not be resolved.
          karaf@root> osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE\$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1
          osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1
          java.lang.RuntimeException: URL [mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1] could not be resolved.
          karaf@root>
          
          Show
          Jamie goodyear added a comment - Retested the above example with 2.2.6-snapshot, received the same error messages. karaf@root> osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1 java.lang.RuntimeException: URL [mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1] could not be resolved. karaf@root> osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE\$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1 osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1 java.lang.RuntimeException: URL [mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1] could not be resolved. karaf@root>
          Hide
          Jamie goodyear added a comment - - edited

          Note:

          If you double escape the $ then it appears to work (two \ before the $).

          karaf@root> osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE\\$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1
          osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE\$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1
          Bundle ID: 52
          karaf@root> 
          karaf@root> list
          START LEVEL 100 , List Threshold: 50
             ID   State         Blueprint      Level  Name
          [  52] [Active     ] [            ] [   60] spring-ldap-core (1.3.1)
          karaf@root>
          
          Show
          Jamie goodyear added a comment - - edited Note: If you double escape the $ then it appears to work (two \ before the $). karaf@root> osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE\\$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1 osgi:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE\$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1 Bundle ID: 52 karaf@root> karaf@root> list START LEVEL 100 , List Threshold: 50 ID State Blueprint Level Name [ 52] [Active ] [ ] [ 60] spring-ldap-core (1.3.1) karaf@root>
          Hide
          Jamie goodyear added a comment - - edited

          Use double escape when typing $ character.

          Show
          Jamie goodyear added a comment - - edited Use double escape when typing $ character.
          Hide
          Jamie goodyear added a comment -

          On Karaf 3.0.x series use double escape characters before the $ character as well:

          karaf@root> bundle:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1
          Bundle IDs: 
          Error executing command: Error installing bundles:
          	Unable to install bundle wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1
          karaf@root> bundle:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE\\$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1
          bundle:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE\$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1
          Bundle ID: 72
          karaf@root>
          
          Show
          Jamie goodyear added a comment - On Karaf 3.0.x series use double escape characters before the $ character as well: karaf@root> bundle:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1 Bundle IDs: Error executing command: Error installing bundles: Unable to install bundle wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1 karaf@root> bundle:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE\\$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1 bundle:install -s wrap:mvn:org.springframework.ldap/spring-ldap-core/1.3.1.RELEASE\$Bundle-SymbolicName=spring-ldap-core&Bundle-Version=1.3.1 Bundle ID: 72 karaf@root>

            People

            • Assignee:
              Jamie goodyear
              Reporter:
              Brian Topping
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development