You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/07/22 00:14:38 UTC
[jira] [Commented] (QPID-5426) PropertiesFileInitialContextFactory
only working with properties file on absolute path
[ https://issues.apache.org/jira/browse/QPID-5426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14069413#comment-14069413 ]
ASF subversion and git services commented on QPID-5426:
-------------------------------------------------------
Commit 1612416 from [~godfrer] in branch 'qpid/trunk'
[ https://svn.apache.org/r1612416 ]
QPID-5426 : Allow use of a URL for properties file initial context factory
> 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
> 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
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org