qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Godfrey (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (QPID-5426) PropertiesFileInitialContextFactory only working with properties file on absolute path
Date Mon, 21 Jul 2014 22:16:41 GMT

     [ https://issues.apache.org/jira/browse/QPID-5426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Rob Godfrey resolved QPID-5426.

       Resolution: Fixed
    Fix Version/s: 0.29

Updated the PropertiesFileInitialContextFactory to first attempt to use the provided String
as a URL and then fall back to a filename for backwards compatibility purposes

> PropertiesFileInitialContextFactory only working with properties file on absolute path
> --------------------------------------------------------------------------------------
>                 Key: QPID-5426
>                 URL: https://issues.apache.org/jira/browse/QPID-5426
>             Project: Qpid
>          Issue Type: Bug
>          Components: JMS AMQP 1.0 Client
>    Affects Versions: 0.26
>         Environment: n/a
>            Reporter: Ulrich Romahn
>            Assignee: Rob Godfrey
>             Fix For: 0.29
>         Attachments: PropertiesFileInitialContextFactory.java
> Currently the class org.apache.qpid.amqp_1_0.jms.jndi.PropertiesFileInitialContextFactory
expects a properties file to be loaded for the initial JNDI context. However, the current
implementation can only load a properties file that is on an absolute path on a file system.
This prohibits bundling the properties file inside a package such as a jar or a WAR since
the class cannot read the properties file from there.
> The attached patch is fixing that by providing the location of the properties file as
a URL string. Usage can be as easy as:
>             properties = new Properties();
>             URL propertiesURL = this.getClass().getResource(PROPS_FILE);
>             properties.put(Context.PROVIDER_URL, propertiesURL.toString());
>             LOG.info("creating initial context");
>             Context ctx = new InitialContext(properties);

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org

View raw message