Hi Dirk, On Thu, Sep 18, 2014 at 6:17 PM, <[email protected]> wrote: > Hi all, > > I have to solve a problem after upgrading our project from CQ5.4 to AEM > 5.6.1. As the subject say it is related to the bouncy castle jce provider and > in detail to mail encryption. > > The setup was that we added the provider to the classpath of our application > and the required policies to the java installation directory as described in > the documentation and everything worked great. > > In the setup of the upgraded version I tried to install the provider as a > bundle itself but I got a ClassCastException when the static initializer > tries to add some mailcap stuff to the MailCapCommandMap that due to the > javax.activation bundle of Sling isn't a MailCapCommandMap but a CommandMap > only that doesn't support the addMailcap() method.
Which initializer is that? If that's under your control please change it as I suggest below. If it's not, file a bug against the library that assumes that a CommandMap is always a MailCapCommandMap . > > Is there any chance we can implement OsgiMailcapCommandMap by extending > MailCapCommandMap? I think the problem will be that the bundle context is > missing for the add method and I'm not sure how the ClassLoader of the > defining bundle (in this case it is bcmail) should be obtained to load the > handler class later on. Any ideas? > > Is there any workaround known to solve this issue? Unfortunately it blocks > the go live of our project :( I suggest that add a bundle with a /META-INF/mailcap file. Then the javax.action bundle's activator will pick it up and register commands based on that, see [1] for more details on how it's done. Robert [1]: https://github.com/apache/sling/blob/d113d49297c9807c490d76a3f47a06eaffb640b1/bundles/extensions/javax.activation/src/main/java/org/apache/sling/javax/activation/internal/Activator.java#L88-L113 > > Mit freundlichen Grüßen, > > Dirk Rudolph > > > T-Systems Multimedia Solutions GmbH > Organisationseinheit CCS > Dirk Rudolph > Software-Entwicklung, OCJP > Hausanschrift: Riesaer Straße 5, 01129 Dresden > Postanschrift: Postfach 10 02 24, 01072 Dresden > +49 351 2820-5363 (Tel) > E-Mail: [email protected]<mailto:[email protected]> > Internet: http://www.t-systems-mms.com<http://www.t-systems-mms.de/> > > T-Systems Multimedia Solutions GmbH > Aufsichtsrat: Thilo Kusch (Vorsitzender) > Geschäftsführung: Peter Klingenburg, Susanne Heger, Dr. Rolf Werner > Handelsregister: Amtsgericht Dresden HRB 11433 > Sitz der Gesellschaft: Dresden > Ust-IdNr.: DE 811 807 949 > >
