Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-2491

Unable to use properly encoded URI in broker config

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 5.3.0
    • 5.x
    • Broker
    • None

    Description

      try {
                  File configFile = new File(System.getProperty("user.home"), "activemq.xml");
                  String configUri = configFile.toURI().toString();
                  ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://broker?brokerConfig=xbean:" + configUri);
                  factory.createConnection();
      } catch (Exception e) {
                  e.printStackTrace();
      }
      

      The problem seems to be in VMTransportFactory.doCompositeConnect where the URI is first being decoded then passed to the URI constructor again, which causes an exception because the URI contains a space.

      Specifically, the problem is at VMTransportFactory, line 80 where the location is parsed (URISupport.parseParameters) then passed to URI constructor.

      The solution may be to re-encode before passing to the URI constructor, or to not decode the options in URISupport.parseParameters.

      Attachments

        Activity

          People

            Unassigned Unassigned
            breynolds Bob Reynolds
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: