2 Replies Latest reply on Jul 21, 2011 3:50 PM by rglowinski

    Multipart mail send problem.

    rglowinski

      Hello,

       

      I have a pretty complex situation to solve.

       

      I have a multi-bundle application and in one of the bunles I have emebedded weblogic.jar using following entries in the MANIFEST file:

       

      Bundle-Version: 0.07.02.06-SNAPSHOT

      Bundle-Name: xxxxxxxxxxxxx

      Bundle-ClassPath: .,lib/weblogic-8.1.5.0.jar

      Build-Jdk: 1.5.0_22

      Embed-Directory: lib

      Bundle-ManifestVersion: 2

      Tool: Bnd-0.0.357

      Embed-Dependency: weblogic;scope=*

       

      The bad luck is that weblogic.jar contains lots of javax.activation and com.sun.mail.* classes. It causes a nasty exception:

       

      Caused by: java.lang.ClassCastException: com.sun.mail.handlers.multipart_mixed

      at org.apache.servicemix.specs.activation.OsgiMailcapCommandMap.createDataContentHandler(OsgiMailcapCommandMap.java:60)[65:org.apache.servicemix.specs.activation-api-1.1:

      1.7.0]

      at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:249)65:org.apache.servicemix.specs.activation-api-1.1:1.7.0

      at javax.activation.DataHandler.writeTo(DataHandler.java:73)65:org.apache.servicemix.specs.activation-api-1.1:1.7.0

      at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1383)117:javax.mail:1.4.3

      at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1743)117:javax.mail:1.4.3

      at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:888)117:javax.mail:1.4.3

      at javax.mail.Transport.send0(Transport.java:191)117:javax.mail:1.4.3

      at javax.mail.Transport.send(Transport.java:120)117:javax.mail:1.4.3

      .......

       

      My other bundle - sending the email is really simple. Just plain Java Mail API Code + pom.xml configuration as follows:

       

                   

       

      How should I proceed to solve this problem? Removing the weblogic.jar from my bundle is out of the questions since it contains LOTS of different CORBA classes which are really necessary.

       

      Rafal

       

      Edited by: rglowinski on Jul 21, 2011 2:16 PM

        • 1. Re: Multipart mail send problem.
          davsclaus

          Do weblogic not have more fine grained JAR files instead of one giant that contains the lot?

          • 2. Re: Multipart mail send problem.
            rglowinski

            Well there are some... but the BIG issue is:

             

            WebLogic Server is 8.1.5 which implies it is run on Java 1.4. FUSE is 4.3.1 run on Java 5.

             

            weblogic.jar has some old Corba files (copied from rt.jar of Java 1.4!!! Imagine that....), without which our code cannot connect to the WL server.

             

            The question is: Why are the classes from embedded dependencies loaded by other bundles? They are certainly NOT present on the Export-package list in MANIFEST files.

             

            Rafal