You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Andrew Clemons (Created) (JIRA)" <ji...@apache.org> on 2012/03/20 00:27:38 UTC

[jira] [Created] (SM-2149) ClassCastException in OsgiMailcapCommandMap

ClassCastException in OsgiMailcapCommandMap
-------------------------------------------

                 Key: SM-2149
                 URL: https://issues.apache.org/jira/browse/SM-2149
             Project: ServiceMix
          Issue Type: Bug
          Components: servicemix-mail
         Environment: $ java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)

Slackware 13.37 64 bit
Linux 2.6.38.4 x86_64
            Reporter: Andrew Clemons
            Priority: Minor
         Attachments: 01_servicemix_activation.diff, stack_trace

I am using the service mix javax.activation and javax.mail bundles:

      <dependency>
        <groupId>org.apache.servicemix.bundles</groupId>
        <artifactId>org.apache.servicemix.bundles.javax.mail</artifactId>
        <version>1.4.1_5</version>
      </dependency>

      <dependency>
        <groupId>org.apache.servicemix.specs</groupId>
        <artifactId>org.apache.servicemix.specs.activation-api-1.1</artifactId>
        <version>1.9.0</version>
      </dependency>

For various reasons I am also using:

      <dependency>
        <groupId>org.ops4j.pax.web</groupId>
        <artifactId>pax-web-jetty-bundle</artifactId>
        <version>1.1.2</version>
      </dependency>

That bundle includes java-mail and activation as part of the bundle itself and
also includes a mailcap file. The
org.apache.servicemix.specs.activation.Activator picks that up and adds the
mailcap entries to the OsgiMailcapCommandMap.

$ unzip -q -c pax-web-jetty-bundle-1.1.2.jar  META-INF/mailcap
#
# @(#)mailcap   1.8 05/04/20
#
# Default mailcap file for the JavaMail System.
#
# JavaMail content-handlers:
#
text/plain;;            x-java-content-handler=com.sun.mail.handlers.text_plain
text/html;;             x-java-content-handler=com.sun.mail.handlers.text_html
text/xml;;              x-java-content-handler=com.sun.mail.handlers.text_xml
multipart/*;;           x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true
message/rfc822;;        x-java-content-handler=com.sun.mail.handlers.message_rfc822
#
# can't support image types because java.awt.Toolkit doesn't work on servers
#
#image/gif;;            x-java-content-handler=com.sun.mail.handlers.image_gif
#image/jpeg;;           x-java-content-handler=com.sun.mail.handlers.image_jpeg

When I then try to send a multipart email, the DataContentHandler comes from
the pax-web-jetty-bundle, but that instance comes from its classloader and is
not assignable to the DataContentHandler as seen by the
org.apache.servicemix.specs.activation-api-1.1 bundle. This results in a
ClassCastException on line 60 in OsgiMailcapCommandMap which propagates up the
call stack.

I'll attached a patch which fixes the problem for me and an example stack
trace.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (SM-2149) ClassCastException in OsgiMailcapCommandMap

Posted by "Freeman Fang (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SM-2149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang reassigned SM-2149:
--------------------------------

    Assignee: Freeman Fang
    
> ClassCastException in OsgiMailcapCommandMap
> -------------------------------------------
>
>                 Key: SM-2149
>                 URL: https://issues.apache.org/jira/browse/SM-2149
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-mail
>         Environment: $ java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
> Slackware 13.37 64 bit
> Linux 2.6.38.4 x86_64
>            Reporter: Andrew Clemons
>            Assignee: Freeman Fang
>            Priority: Minor
>         Attachments: 01_servicemix_activation.diff, stack_trace
>
>
> I am using the service mix javax.activation and javax.mail bundles:
>       <dependency>
>         <groupId>org.apache.servicemix.bundles</groupId>
>         <artifactId>org.apache.servicemix.bundles.javax.mail</artifactId>
>         <version>1.4.1_5</version>
>       </dependency>
>       <dependency>
>         <groupId>org.apache.servicemix.specs</groupId>
>         <artifactId>org.apache.servicemix.specs.activation-api-1.1</artifactId>
>         <version>1.9.0</version>
>       </dependency>
> For various reasons I am also using:
>       <dependency>
>         <groupId>org.ops4j.pax.web</groupId>
>         <artifactId>pax-web-jetty-bundle</artifactId>
>         <version>1.1.2</version>
>       </dependency>
> That bundle includes java-mail and activation as part of the bundle itself and
> also includes a mailcap file. The
> org.apache.servicemix.specs.activation.Activator picks that up and adds the
> mailcap entries to the OsgiMailcapCommandMap.
> $ unzip -q -c pax-web-jetty-bundle-1.1.2.jar  META-INF/mailcap
> #
> # @(#)mailcap   1.8 05/04/20
> #
> # Default mailcap file for the JavaMail System.
> #
> # JavaMail content-handlers:
> #
> text/plain;;            x-java-content-handler=com.sun.mail.handlers.text_plain
> text/html;;             x-java-content-handler=com.sun.mail.handlers.text_html
> text/xml;;              x-java-content-handler=com.sun.mail.handlers.text_xml
> multipart/*;;           x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true
> message/rfc822;;        x-java-content-handler=com.sun.mail.handlers.message_rfc822
> #
> # can't support image types because java.awt.Toolkit doesn't work on servers
> #
> #image/gif;;            x-java-content-handler=com.sun.mail.handlers.image_gif
> #image/jpeg;;           x-java-content-handler=com.sun.mail.handlers.image_jpeg
> When I then try to send a multipart email, the DataContentHandler comes from
> the pax-web-jetty-bundle, but that instance comes from its classloader and is
> not assignable to the DataContentHandler as seen by the
> org.apache.servicemix.specs.activation-api-1.1 bundle. This results in a
> ClassCastException on line 60 in OsgiMailcapCommandMap which propagates up the
> call stack.
> I'll attached a patch which fixes the problem for me and an example stack
> trace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SM-2149) ClassCastException in OsgiMailcapCommandMap

Posted by "Andrew Clemons (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SM-2149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13233081#comment-13233081 ] 

Andrew Clemons commented on SM-2149:
------------------------------------

Hi Freeman,
My bundle does not embed pax-web-jetty-bundle. I am using the activation
classes as exported by the service mix activation bundle. The problems occurs
after the pax-web-jetty-bundle is activated since the listener in
org.apache.servicemix.specs.activation.Activator picks up the mailcap entry
there and then pulls out DataContentHandler instances which aren't assignable.

javax.activation,version=1.1.0 from org.apache.servicemix.specs.activation-api-1.1 (130)
javax.mail,version=1.4.1 from org.apache.servicemix.bundles.javax.mail (84)
javax.mail.internet,version=1.4.1 from org.apache.servicemix.bundles.javax.mail (84)
javax.mail.util,version=1.4.1 from org.apache.servicemix.bundles.javax.mail (84)
org.aopalliance.aop,version=1.0.0 from com.springsource.org.aopalliance (50)
org.apache.commons.beanutils,version=1.8.0 from com.springsource.org.apache.commons.beanutils (51)
org.apache.commons.io,version=1.4.0 from com.springsource.org.apache.commons.io (56)
org.apache.commons.lang,version=2.5.0 from com.springsource.org.apache.commons.lang (57)
org.apache.commons.logging,version=1.1.1 from pax-logging-api (249)
org.apache.commons.logging,version=1.0.4 from pax-logging-api (249)
org.bouncycastle.bcpg,version=0.0.0 from bcpg (30)
org.bouncycastle.jce.provider,version=0.0.0 from bcprov (31)
org.bouncycastle.openpgp,version=0.0.0 from bcpg (30)
org.slf4j,version=1.6.1 from pax-logging-api (249)
org.slf4j,version=1.5.11 from pax-logging-api (249)
org.slf4j,version=1.4.3 from pax-logging-api (249)
org.springframework.aop,version=3.0.6.RELEASE from org.springframework.aop (86)
org.springframework.aop.framework,version=3.0.6.RELEASE from org.springframework.aop (86)
org.springframework.beans.factory,version=3.0.6.RELEASE from org.springframework.beans (88)
org.springframework.beans.factory.config,version=3.0.6.RELEASE from org.springframework.beans (88)
org.springframework.beans.factory.xml,version=3.0.6.RELEASE from org.springframework.beans (88)
org.springframework.context,version=3.0.6.RELEASE from org.springframework.context (89)
org.springframework.core.io,version=3.0.6.RELEASE from org.springframework.core (91)
org.springframework.mail,version=3.0.6.RELEASE from org.springframework.context.support (90)
org.springframework.mail.javamail,version=3.0.6.RELEASE from org.springframework.context.support (90)
org.springframework.util,version=3.0.6.RELEASE from org.springframework.core (91)

Thanks
Andrew
                
> ClassCastException in OsgiMailcapCommandMap
> -------------------------------------------
>
>                 Key: SM-2149
>                 URL: https://issues.apache.org/jira/browse/SM-2149
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-mail
>         Environment: $ java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
> Slackware 13.37 64 bit
> Linux 2.6.38.4 x86_64
>            Reporter: Andrew Clemons
>            Assignee: Freeman Fang
>            Priority: Minor
>         Attachments: 01_servicemix_activation.diff, stack_trace
>
>
> I am using the service mix javax.activation and javax.mail bundles:
>       <dependency>
>         <groupId>org.apache.servicemix.bundles</groupId>
>         <artifactId>org.apache.servicemix.bundles.javax.mail</artifactId>
>         <version>1.4.1_5</version>
>       </dependency>
>       <dependency>
>         <groupId>org.apache.servicemix.specs</groupId>
>         <artifactId>org.apache.servicemix.specs.activation-api-1.1</artifactId>
>         <version>1.9.0</version>
>       </dependency>
> For various reasons I am also using:
>       <dependency>
>         <groupId>org.ops4j.pax.web</groupId>
>         <artifactId>pax-web-jetty-bundle</artifactId>
>         <version>1.1.2</version>
>       </dependency>
> That bundle includes java-mail and activation as part of the bundle itself and
> also includes a mailcap file. The
> org.apache.servicemix.specs.activation.Activator picks that up and adds the
> mailcap entries to the OsgiMailcapCommandMap.
> $ unzip -q -c pax-web-jetty-bundle-1.1.2.jar  META-INF/mailcap
> #
> # @(#)mailcap   1.8 05/04/20
> #
> # Default mailcap file for the JavaMail System.
> #
> # JavaMail content-handlers:
> #
> text/plain;;            x-java-content-handler=com.sun.mail.handlers.text_plain
> text/html;;             x-java-content-handler=com.sun.mail.handlers.text_html
> text/xml;;              x-java-content-handler=com.sun.mail.handlers.text_xml
> multipart/*;;           x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true
> message/rfc822;;        x-java-content-handler=com.sun.mail.handlers.message_rfc822
> #
> # can't support image types because java.awt.Toolkit doesn't work on servers
> #
> #image/gif;;            x-java-content-handler=com.sun.mail.handlers.image_gif
> #image/jpeg;;           x-java-content-handler=com.sun.mail.handlers.image_jpeg
> When I then try to send a multipart email, the DataContentHandler comes from
> the pax-web-jetty-bundle, but that instance comes from its classloader and is
> not assignable to the DataContentHandler as seen by the
> org.apache.servicemix.specs.activation-api-1.1 bundle. This results in a
> ClassCastException on line 60 in OsgiMailcapCommandMap which propagates up the
> call stack.
> I'll attached a patch which fixes the problem for me and an example stack
> trace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SM-2149) ClassCastException in OsgiMailcapCommandMap

Posted by "Andrew Clemons (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SM-2149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Clemons updated SM-2149:
-------------------------------

    Attachment: stack_trace

Example stack trace
                
> ClassCastException in OsgiMailcapCommandMap
> -------------------------------------------
>
>                 Key: SM-2149
>                 URL: https://issues.apache.org/jira/browse/SM-2149
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-mail
>         Environment: $ java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
> Slackware 13.37 64 bit
> Linux 2.6.38.4 x86_64
>            Reporter: Andrew Clemons
>            Priority: Minor
>         Attachments: 01_servicemix_activation.diff, stack_trace
>
>
> I am using the service mix javax.activation and javax.mail bundles:
>       <dependency>
>         <groupId>org.apache.servicemix.bundles</groupId>
>         <artifactId>org.apache.servicemix.bundles.javax.mail</artifactId>
>         <version>1.4.1_5</version>
>       </dependency>
>       <dependency>
>         <groupId>org.apache.servicemix.specs</groupId>
>         <artifactId>org.apache.servicemix.specs.activation-api-1.1</artifactId>
>         <version>1.9.0</version>
>       </dependency>
> For various reasons I am also using:
>       <dependency>
>         <groupId>org.ops4j.pax.web</groupId>
>         <artifactId>pax-web-jetty-bundle</artifactId>
>         <version>1.1.2</version>
>       </dependency>
> That bundle includes java-mail and activation as part of the bundle itself and
> also includes a mailcap file. The
> org.apache.servicemix.specs.activation.Activator picks that up and adds the
> mailcap entries to the OsgiMailcapCommandMap.
> $ unzip -q -c pax-web-jetty-bundle-1.1.2.jar  META-INF/mailcap
> #
> # @(#)mailcap   1.8 05/04/20
> #
> # Default mailcap file for the JavaMail System.
> #
> # JavaMail content-handlers:
> #
> text/plain;;            x-java-content-handler=com.sun.mail.handlers.text_plain
> text/html;;             x-java-content-handler=com.sun.mail.handlers.text_html
> text/xml;;              x-java-content-handler=com.sun.mail.handlers.text_xml
> multipart/*;;           x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true
> message/rfc822;;        x-java-content-handler=com.sun.mail.handlers.message_rfc822
> #
> # can't support image types because java.awt.Toolkit doesn't work on servers
> #
> #image/gif;;            x-java-content-handler=com.sun.mail.handlers.image_gif
> #image/jpeg;;           x-java-content-handler=com.sun.mail.handlers.image_jpeg
> When I then try to send a multipart email, the DataContentHandler comes from
> the pax-web-jetty-bundle, but that instance comes from its classloader and is
> not assignable to the DataContentHandler as seen by the
> org.apache.servicemix.specs.activation-api-1.1 bundle. This results in a
> ClassCastException on line 60 in OsgiMailcapCommandMap which propagates up the
> call stack.
> I'll attached a patch which fixes the problem for me and an example stack
> trace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (SMX4-1116) ClassCastException in OsgiMailcapCommandMap

Posted by "Freeman Fang (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SMX4-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang resolved SMX4-1116.
--------------------------------

       Resolution: Fixed
    Fix Version/s: specs-2.0.0

apply patch on behalf of Andrew Clemons with thanks
http://svn.apache.org/viewvc?rev=1302778&view=rev
                
> ClassCastException in OsgiMailcapCommandMap
> -------------------------------------------
>
>                 Key: SMX4-1116
>                 URL: https://issues.apache.org/jira/browse/SMX4-1116
>             Project: ServiceMix 4
>          Issue Type: Bug
>          Components: specs
>         Environment: $ java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
> Slackware 13.37 64 bit
> Linux 2.6.38.4 x86_64
>            Reporter: Andrew Clemons
>            Assignee: Freeman Fang
>            Priority: Minor
>             Fix For: specs-2.0.0
>
>         Attachments: 01_servicemix_activation.diff, stack_trace
>
>
> I am using the service mix javax.activation and javax.mail bundles:
>       <dependency>
>         <groupId>org.apache.servicemix.bundles</groupId>
>         <artifactId>org.apache.servicemix.bundles.javax.mail</artifactId>
>         <version>1.4.1_5</version>
>       </dependency>
>       <dependency>
>         <groupId>org.apache.servicemix.specs</groupId>
>         <artifactId>org.apache.servicemix.specs.activation-api-1.1</artifactId>
>         <version>1.9.0</version>
>       </dependency>
> For various reasons I am also using:
>       <dependency>
>         <groupId>org.ops4j.pax.web</groupId>
>         <artifactId>pax-web-jetty-bundle</artifactId>
>         <version>1.1.2</version>
>       </dependency>
> That bundle includes java-mail and activation as part of the bundle itself and
> also includes a mailcap file. The
> org.apache.servicemix.specs.activation.Activator picks that up and adds the
> mailcap entries to the OsgiMailcapCommandMap.
> $ unzip -q -c pax-web-jetty-bundle-1.1.2.jar  META-INF/mailcap
> #
> # @(#)mailcap   1.8 05/04/20
> #
> # Default mailcap file for the JavaMail System.
> #
> # JavaMail content-handlers:
> #
> text/plain;;            x-java-content-handler=com.sun.mail.handlers.text_plain
> text/html;;             x-java-content-handler=com.sun.mail.handlers.text_html
> text/xml;;              x-java-content-handler=com.sun.mail.handlers.text_xml
> multipart/*;;           x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true
> message/rfc822;;        x-java-content-handler=com.sun.mail.handlers.message_rfc822
> #
> # can't support image types because java.awt.Toolkit doesn't work on servers
> #
> #image/gif;;            x-java-content-handler=com.sun.mail.handlers.image_gif
> #image/jpeg;;           x-java-content-handler=com.sun.mail.handlers.image_jpeg
> When I then try to send a multipart email, the DataContentHandler comes from
> the pax-web-jetty-bundle, but that instance comes from its classloader and is
> not assignable to the DataContentHandler as seen by the
> org.apache.servicemix.specs.activation-api-1.1 bundle. This results in a
> ClassCastException on line 60 in OsgiMailcapCommandMap which propagates up the
> call stack.
> I'll attached a patch which fixes the problem for me and an example stack
> trace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SM-2149) ClassCastException in OsgiMailcapCommandMap

Posted by "Freeman Fang (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SM-2149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13233069#comment-13233069 ] 

Freeman Fang commented on SM-2149:
----------------------------------

Hi Andrew,

Thanks for the patch.

But I think the root cause is that you shouldn't use DataContentHandler from pax-web-jetty-bundle.
I just check the pax-web-jetty-bundle code, it doesn't export javax.activation package from the OSGi metadata header, so I believe your customer bundle embed the pax-web-jetty-bundle, right? 
If so, you shouldn't use the embed way, you should install all necessary bundles in OSGi container and import necessary package in your bundle, otherwise you will encounter lots of ClassCastException issues which is caused by different classloader.

Freeman
                
> ClassCastException in OsgiMailcapCommandMap
> -------------------------------------------
>
>                 Key: SM-2149
>                 URL: https://issues.apache.org/jira/browse/SM-2149
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-mail
>         Environment: $ java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
> Slackware 13.37 64 bit
> Linux 2.6.38.4 x86_64
>            Reporter: Andrew Clemons
>            Priority: Minor
>         Attachments: 01_servicemix_activation.diff, stack_trace
>
>
> I am using the service mix javax.activation and javax.mail bundles:
>       <dependency>
>         <groupId>org.apache.servicemix.bundles</groupId>
>         <artifactId>org.apache.servicemix.bundles.javax.mail</artifactId>
>         <version>1.4.1_5</version>
>       </dependency>
>       <dependency>
>         <groupId>org.apache.servicemix.specs</groupId>
>         <artifactId>org.apache.servicemix.specs.activation-api-1.1</artifactId>
>         <version>1.9.0</version>
>       </dependency>
> For various reasons I am also using:
>       <dependency>
>         <groupId>org.ops4j.pax.web</groupId>
>         <artifactId>pax-web-jetty-bundle</artifactId>
>         <version>1.1.2</version>
>       </dependency>
> That bundle includes java-mail and activation as part of the bundle itself and
> also includes a mailcap file. The
> org.apache.servicemix.specs.activation.Activator picks that up and adds the
> mailcap entries to the OsgiMailcapCommandMap.
> $ unzip -q -c pax-web-jetty-bundle-1.1.2.jar  META-INF/mailcap
> #
> # @(#)mailcap   1.8 05/04/20
> #
> # Default mailcap file for the JavaMail System.
> #
> # JavaMail content-handlers:
> #
> text/plain;;            x-java-content-handler=com.sun.mail.handlers.text_plain
> text/html;;             x-java-content-handler=com.sun.mail.handlers.text_html
> text/xml;;              x-java-content-handler=com.sun.mail.handlers.text_xml
> multipart/*;;           x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true
> message/rfc822;;        x-java-content-handler=com.sun.mail.handlers.message_rfc822
> #
> # can't support image types because java.awt.Toolkit doesn't work on servers
> #
> #image/gif;;            x-java-content-handler=com.sun.mail.handlers.image_gif
> #image/jpeg;;           x-java-content-handler=com.sun.mail.handlers.image_jpeg
> When I then try to send a multipart email, the DataContentHandler comes from
> the pax-web-jetty-bundle, but that instance comes from its classloader and is
> not assignable to the DataContentHandler as seen by the
> org.apache.servicemix.specs.activation-api-1.1 bundle. This results in a
> ClassCastException on line 60 in OsgiMailcapCommandMap which propagates up the
> call stack.
> I'll attached a patch which fixes the problem for me and an example stack
> trace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Moved] (SMX4-1116) ClassCastException in OsgiMailcapCommandMap

Posted by "Freeman Fang (Moved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SMX4-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang moved SM-2149 to SMX4-1116:
----------------------------------------

    Component/s:     (was: servicemix-mail)
                 specs
            Key: SMX4-1116  (was: SM-2149)
        Project: ServiceMix 4  (was: ServiceMix)
    
> ClassCastException in OsgiMailcapCommandMap
> -------------------------------------------
>
>                 Key: SMX4-1116
>                 URL: https://issues.apache.org/jira/browse/SMX4-1116
>             Project: ServiceMix 4
>          Issue Type: Bug
>          Components: specs
>         Environment: $ java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
> Slackware 13.37 64 bit
> Linux 2.6.38.4 x86_64
>            Reporter: Andrew Clemons
>            Assignee: Freeman Fang
>            Priority: Minor
>         Attachments: 01_servicemix_activation.diff, stack_trace
>
>
> I am using the service mix javax.activation and javax.mail bundles:
>       <dependency>
>         <groupId>org.apache.servicemix.bundles</groupId>
>         <artifactId>org.apache.servicemix.bundles.javax.mail</artifactId>
>         <version>1.4.1_5</version>
>       </dependency>
>       <dependency>
>         <groupId>org.apache.servicemix.specs</groupId>
>         <artifactId>org.apache.servicemix.specs.activation-api-1.1</artifactId>
>         <version>1.9.0</version>
>       </dependency>
> For various reasons I am also using:
>       <dependency>
>         <groupId>org.ops4j.pax.web</groupId>
>         <artifactId>pax-web-jetty-bundle</artifactId>
>         <version>1.1.2</version>
>       </dependency>
> That bundle includes java-mail and activation as part of the bundle itself and
> also includes a mailcap file. The
> org.apache.servicemix.specs.activation.Activator picks that up and adds the
> mailcap entries to the OsgiMailcapCommandMap.
> $ unzip -q -c pax-web-jetty-bundle-1.1.2.jar  META-INF/mailcap
> #
> # @(#)mailcap   1.8 05/04/20
> #
> # Default mailcap file for the JavaMail System.
> #
> # JavaMail content-handlers:
> #
> text/plain;;            x-java-content-handler=com.sun.mail.handlers.text_plain
> text/html;;             x-java-content-handler=com.sun.mail.handlers.text_html
> text/xml;;              x-java-content-handler=com.sun.mail.handlers.text_xml
> multipart/*;;           x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true
> message/rfc822;;        x-java-content-handler=com.sun.mail.handlers.message_rfc822
> #
> # can't support image types because java.awt.Toolkit doesn't work on servers
> #
> #image/gif;;            x-java-content-handler=com.sun.mail.handlers.image_gif
> #image/jpeg;;           x-java-content-handler=com.sun.mail.handlers.image_jpeg
> When I then try to send a multipart email, the DataContentHandler comes from
> the pax-web-jetty-bundle, but that instance comes from its classloader and is
> not assignable to the DataContentHandler as seen by the
> org.apache.servicemix.specs.activation-api-1.1 bundle. This results in a
> ClassCastException on line 60 in OsgiMailcapCommandMap which propagates up the
> call stack.
> I'll attached a patch which fixes the problem for me and an example stack
> trace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SM-2149) ClassCastException in OsgiMailcapCommandMap

Posted by "Andrew Clemons (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SM-2149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Clemons updated SM-2149:
-------------------------------

    Attachment: 01_servicemix_activation.diff

patch
                
> ClassCastException in OsgiMailcapCommandMap
> -------------------------------------------
>
>                 Key: SM-2149
>                 URL: https://issues.apache.org/jira/browse/SM-2149
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-mail
>         Environment: $ java -version
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
> Slackware 13.37 64 bit
> Linux 2.6.38.4 x86_64
>            Reporter: Andrew Clemons
>            Priority: Minor
>         Attachments: 01_servicemix_activation.diff, stack_trace
>
>
> I am using the service mix javax.activation and javax.mail bundles:
>       <dependency>
>         <groupId>org.apache.servicemix.bundles</groupId>
>         <artifactId>org.apache.servicemix.bundles.javax.mail</artifactId>
>         <version>1.4.1_5</version>
>       </dependency>
>       <dependency>
>         <groupId>org.apache.servicemix.specs</groupId>
>         <artifactId>org.apache.servicemix.specs.activation-api-1.1</artifactId>
>         <version>1.9.0</version>
>       </dependency>
> For various reasons I am also using:
>       <dependency>
>         <groupId>org.ops4j.pax.web</groupId>
>         <artifactId>pax-web-jetty-bundle</artifactId>
>         <version>1.1.2</version>
>       </dependency>
> That bundle includes java-mail and activation as part of the bundle itself and
> also includes a mailcap file. The
> org.apache.servicemix.specs.activation.Activator picks that up and adds the
> mailcap entries to the OsgiMailcapCommandMap.
> $ unzip -q -c pax-web-jetty-bundle-1.1.2.jar  META-INF/mailcap
> #
> # @(#)mailcap   1.8 05/04/20
> #
> # Default mailcap file for the JavaMail System.
> #
> # JavaMail content-handlers:
> #
> text/plain;;            x-java-content-handler=com.sun.mail.handlers.text_plain
> text/html;;             x-java-content-handler=com.sun.mail.handlers.text_html
> text/xml;;              x-java-content-handler=com.sun.mail.handlers.text_xml
> multipart/*;;           x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true
> message/rfc822;;        x-java-content-handler=com.sun.mail.handlers.message_rfc822
> #
> # can't support image types because java.awt.Toolkit doesn't work on servers
> #
> #image/gif;;            x-java-content-handler=com.sun.mail.handlers.image_gif
> #image/jpeg;;           x-java-content-handler=com.sun.mail.handlers.image_jpeg
> When I then try to send a multipart email, the DataContentHandler comes from
> the pax-web-jetty-bundle, but that instance comes from its classloader and is
> not assignable to the DataContentHandler as seen by the
> org.apache.servicemix.specs.activation-api-1.1 bundle. This results in a
> ClassCastException on line 60 in OsgiMailcapCommandMap which propagates up the
> call stack.
> I'll attached a patch which fixes the problem for me and an example stack
> trace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira