You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Robert Burrell Donkin (JIRA)" <se...@james.apache.org> on 2007/08/09 21:53:42 UTC
[jira] Commented: (JSIEVE-5) You'd better change the way you load
sieveConfig.xml
[ https://issues.apache.org/jira/browse/JSIEVE-5?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518827 ]
Robert Burrell Donkin commented on JSIEVE-5:
--------------------------------------------
...Grrrr...Don't get me started on J2EE classloaders...
Really wants to be refactored so that a suitable interface is injected but
try
{
return Thread.currentThread().getContextClassLoader().getResourceAsStream(getConfigName());
}
catch
{
return ClassLoader.getSystemResourceAsStream(getConfigName());
}
might work well enough for now.
Opinions?
> You'd better change the way you load sieveConfig.xml
> ----------------------------------------------------
>
> Key: JSIEVE-5
> URL: https://issues.apache.org/jira/browse/JSIEVE-5
> Project: jSieve
> Issue Type: Improvement
> Reporter: Vladimir
>
> I've placed sieveConfig.xml in jsieve's jar (I think that might be much better if you use jsieve as a library).
> You'd better change in ConfigurationManager method: getConfigStream
> this: return ClassLoader.getSystemResourceAsStream(getConfigName());
> with this:
> return Thread.currentThread().getContextClassLoader().getResourceAsStream(getConfigName());
> ClassLoader doesn't load config if you use jsieve as a library
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: [jira] Commented: (JSIEVE-5) You'd better change the way you
load sieveConfig.xml
Posted by Stefano Bagnara <ap...@bago.org>.
Robert Burrell Donkin (JIRA) ha scritto:
> [ https://issues.apache.org/jira/browse/JSIEVE-5?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518827 ]
>
> Robert Burrell Donkin commented on JSIEVE-5:
> --------------------------------------------
>
> ...Grrrr...Don't get me started on J2EE classloaders...
>
> Really wants to be refactored so that a suitable interface is injected but
>
> try
> {
> return Thread.currentThread().getContextClassLoader().getResourceAsStream(getConfigName());
> }
> catch
> {
> return ClassLoader.getSystemResourceAsStream(getConfigName());
> }
>
> might work well enough for now.
>
> Opinions?
Inside JAMES Server code I used
Thread.currentThread().getContextClassLoader().getResourceAsStream()
without the fallback to the ClassLoader.getSystemResourceAsStream, but
this seems even more safe, so +1.
Stefano
PS: Anyone else noticed that most of jSieve code have curly brackets in
the wrong places (I mean different from most of JAMES code)?
>> You'd better change the way you load sieveConfig.xml
>> ----------------------------------------------------
>>
>> Key: JSIEVE-5
>> URL: https://issues.apache.org/jira/browse/JSIEVE-5
>> Project: jSieve
>> Issue Type: Improvement
>> Reporter: Vladimir
>>
>> I've placed sieveConfig.xml in jsieve's jar (I think that might be much better if you use jsieve as a library).
>> You'd better change in ConfigurationManager method: getConfigStream
>> this: return ClassLoader.getSystemResourceAsStream(getConfigName());
>> with this:
>> return Thread.currentThread().getContextClassLoader().getResourceAsStream(getConfigName());
>> ClassLoader doesn't load config if you use jsieve as a library
>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org