You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Bob Reynolds (JIRA)" <ji...@apache.org> on 2009/11/13 16:21:54 UTC

[jira] Created: (AMQ-2491) Unable to use properly encoded URI in broker config

Unable to use properly encoded URI in broker config
---------------------------------------------------

                 Key: AMQ-2491
                 URL: https://issues.apache.org/activemq/browse/AMQ-2491
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.3.0
            Reporter: Bob Reynolds


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.

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


[jira] Updated: (AMQ-2491) Unable to use properly encoded URI in broker config

Posted by "Bruce Snyder (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bruce Snyder updated AMQ-2491:
------------------------------

    Fix Version/s: 5.5.0
                       (was: 5.4.1)

> Unable to use properly encoded URI in broker config
> ---------------------------------------------------
>
>                 Key: AMQ-2491
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2491
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>            Reporter: Bob Reynolds
>             Fix For: 5.5.0
>
>
> {code}
> 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();
> }
> {code}
> 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.

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


[jira] Updated: (AMQ-2491) Unable to use properly encoded URI in broker config

Posted by "Bob Reynolds (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bob Reynolds updated AMQ-2491:
------------------------------

    Description: 
{code}
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();
}
{code}

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.

  was:
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.


> Unable to use properly encoded URI in broker config
> ---------------------------------------------------
>
>                 Key: AMQ-2491
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2491
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>            Reporter: Bob Reynolds
>
> {code}
> 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();
> }
> {code}
> 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.

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