[
https://issues.apache.org/jira/browse/JAMES-1444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13537430#comment-13537430
]
Adhish commented on JAMES-1444:
-------------------------------
I believe this is happening because HasMailAttributeWithValueRegex override the
"public void init (MatcherConfig conf) throws MessagingException" from
GenericMatcher and does not call the super class init(MatcherConfig) method.
Hence, the config value is never set in the base class. When JMX tries to call
a method on that config (after calling getMatcherConfig() which returns a
null), it will get a NullPointerException.
HasMailAttributeWithValue does not override the init (MatcherConfig conf)
method and it does not suffer from this issue.
Perhaps you could add a call to super(conf) in the overridden method
HasMailAttributeWithValueRegex to fix the issue.
> Using HasMailAttributeWithValueRegex matcher causes NPE during startup when
> JMX is enabled
> ------------------------------------------------------------------------------------------
>
> Key: JAMES-1444
> URL: https://issues.apache.org/jira/browse/JAMES-1444
> Project: James Server
> Issue Type: Bug
> Components: JMX, Matchers/Mailets (bundled)
> Affects Versions: 3.0-beta4
> Reporter: Adhish
>
> When I use the following Mailet/Matcher,
> <mailet match="HasMailAttributeWithValueRegex=jDKIM.AUTHRESULT, fail"
> class="Null"/>
> I get a NullPointerException as below:
> Caused by: java.lang.NullPointerException
> at
> org.apache.james.mailetcontainer.impl.jmx.MatcherManagement.getMatcherName(MatcherManagement.java:75)
> This does not happen when I use the HasMailAttributeWithValue matcher though.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]