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 "Benoit Tellier (Jira)" <se...@james.apache.org> on 2020/05/13 04:17:00 UTC

[jira] [Commented] (JAMES-3176) MDN parser instantiation via parboiled fails

    [ https://issues.apache.org/jira/browse/JAMES-3176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17105959#comment-17105959 ] 

Benoit Tellier commented on JAMES-3176:
---------------------------------------

https://github.com/linagora/james-project/pull/3366 contributes the singleton.

However, maybe that's more likely to be due to an incompatible version of the asm library from an other dependency.

As expressed here https://github.com/linagora/james-project/pull/3366#issuecomment-627187285


{code:java}
[INFO] |  +- com.datastax.cassandra:cassandra-driver-core:jar:shaded:3.7.2:compile
[INFO] |  |  +- io.dropwizard.metrics:metrics-core:jar:4.1.0:compile
[INFO] |  |  +- com.github.jnr:jnr-ffi:jar:2.1.7:compile
[INFO] |  |  |  +- com.github.jnr:jffi:jar:1.2.16:compile
[INFO] |  |  |  +- com.github.jnr:jffi:jar:native:1.2.16:runtime
[INFO] |  |  |  +- org.ow2.asm:asm:jar:5.0.3:compile
{code}


VS parboiled relying on org.ow2.asm:asm:jar:7.1:compile

The solution that should fix this is proposed here: https://github.com/linagora/james-project/pull/3366#issuecomment-627733955

We should implement MDN parsing using parboiled-scala that do not depends on ASM libraries.



> MDN parser instantiation via parboiled fails
> --------------------------------------------
>
>                 Key: JAMES-3176
>                 URL: https://issues.apache.org/jira/browse/JAMES-3176
>             Project: James Server
>          Issue Type: Improvement
>          Components: Mailet Contributions, mdn
>    Affects Versions: 3.5.0
>            Reporter: Benoit Tellier
>            Priority: Major
>              Labels: bug
>             Fix For: 3.6.0
>
>
> Upon execution of ExtractMDNOriginalJMAPMessageId & Vacation mailet we encounter the following exceptions:
> {code:java}
> java.lang.RuntimeException: Error creating extended parser class: null
> 	at org.parboiled.Parboiled.createParser(Parboiled.java:58)
> 	at org.apache.james.mdn.MDNReportParser.parse(MDNReportParser.java:57)
> 	at org.apache.james.mdn.MDNReportParser.parse(MDNReportParser.java:53)
> 	at org.apache.james.jmap.mailet.ExtractMDNOriginalJMAPMessageId.parseReport(ExtractMDNOriginalJMAPMessageId.java:120)
> [...]
> Caused by: java.lang.IllegalArgumentException: null
> 	at org.objectweb.asm.ClassVisitor.<init>(Unknown Source)
> 	at org.objectweb.asm.ClassVisitor.<init>(Unknown Source)
> 	at org.objectweb.asm.tree.ClassNode.<init>(Unknown Source)
> 	at org.parboiled.transform.ParserClassNode.<init>(ParserClassNode.java:43)
> 	at org.parboiled.transform.ParserTransformer.extendParserClass(ParserTransformer.java:43)
> 	at org.parboiled.transform.ParserTransformer.transformParser(ParserTransformer.java:39)
> 	at org.parboiled.Parboiled.createParser(Parboiled.java:54)
> {code}
> Code inspection did not allow me to identify the route cause of the failure due to some heavy reflection dark magic taking place.
> However instantiation of the parser was performed via reflection upon each MDN
> parsing.
> Given that a parser only defines a set of rules, and is thus immutable, 
> we can turn it into a constant, effectively solving our problem ?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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