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

Tellier Benoit commented on JAMES-2886:
---------------------------------------

This issue can be solved by packaging things in a jar-with-dependencies as 
demonstrated in https://github.com/linagora/james-project/pull/2695

> Unable to usetransitive dependencies at runtime in Guice extension jars
> -----------------------------------------------------------------------
>
>                 Key: JAMES-2886
>                 URL: https://issues.apache.org/jira/browse/JAMES-2886
>             Project: James Server
>          Issue Type: Bug
>          Components: guice, Matchers/Mailets (bundled)
>    Affects Versions: 3.4.0
>            Reporter: Tellier Benoit
>            Priority: Major
>
> As reported by @AaronRegan , we are unable to resolve transitive dependencies 
> in extension jars.
> # Steps to reproduce
> Given a maven module containing a custom mailet, instanciating objects as 
> part of the *service* method that are NOT part of James classpath:
>  - 1. Start *any* James guice application
>  - 2. Drop the JAR of the aforementioned in extension-jars folder
>  - 3. Configure the mailet within the mailet pipeline
>  - 4. Process a mail and....
>  - 5. Notice runtime failures! The service method does not succeed to 
> instanciate the object not being part of James classpath.
> As off commit 42d7d55d5380d13648533160844d30f765a2c6f1, such a JAR could very 
> well be the *apache-mailet-crypto* JAR.
> This would result in :
> {code:java}
> java.lang.ClassNotFoundException: 
> org.bouncycastle.mail.smime.SMIMESignedGenerator
> at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> ... 82 common frames omitted
> Wrapped by: java.lang.NoClassDefFoundError: 
> org/bouncycastle/mail/smime/SMIMESignedGenerator
> at 
> org.apache.james.transport.SMIMEKeyHolder.createGenerator(SMIMEKeyHolder.java:208)
> at org.apache.james.transport.SMIMEKeyHolder.generate(SMIMEKeyHolder.java:251)
> at 
> org.apache.james.transport.mailets.AbstractSign.service(AbstractSign.java:486)
> at 
> org.apache.james.mailetcontainer.impl.camel.CamelProcessor.process(CamelProcessor.java:81)
> at 
> org.apache.james.mailetcontainer.impl.camel.CamelMailetProcessor$MailetContainerRouteBuilder.handleMailet(CamelMailetProcessor.java:178)
> at 
> org.apache.james.mailetcontainer.impl.camel.CamelMailetProcessor$MailetContainerRouteBuilder.lambda$configure$0(CamelMailetProcessor.java:155)
> at 
> org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
> ... 75 common frames omitted
> {code}
> # What to do from here
>  - Write a test reproducing that behavior...
>  - Bundle *apache-mailet-crypto* within supported guice app mailets
>  - Fix that annoying transitive dependency issue - this is in my opinion a 
> blocker for Guice adoption.



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

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

Reply via email to