Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-2886

Unable to usetransitive dependencies at runtime in Guice extension jars

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.4.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      As reported by @AaronRegan , we are unable to resolve transitive dependencies in extension jars.

      1. 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 :

      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
      
      1. 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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              btellier Benoit Tellier
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: