Jun 25th, 2008, 06:44 AM
I have deployed a war file into the platform that worked fine in Tomcat. When it tries to send an email I get an Exception:
java.lang.NoSuchMethodError: com.sun.activation.registries.MailcapFile.getMailc apList(Ljava/lang/StringLjava/util/Hashtable;
I googled this exception and it seems that it is to do with an out of date activation.jar file.
It seems odd that this does not happen in tomcat. I wonder if the platform is loading a different verison of mail.jar or activation.jar than the one bundled with the WAR.
Jun 27th, 2008, 03:30 AM
That's a good catch! And it's a bit complicated, but let me explain what's happening...
> It seems odd that this does not happen in tomcat. I wonder if the platform is loading
> a different verison of mail.jar or activation.jar than the one bundled with the WAR.
This doesn't happen in a standard Tomcat installation, because there is only one version of activation.jar present on the classpath for your web application. In OSGi, however, you can have multiple versions of JARs or packages _available_. In the Platform we have version 1.1.0 of activation.jar in the repository. In addition, the JVM provides a potentially different version of the javax.activation packages.
With regard to your WAR deployed on the Platform, you have provided your own version of activation.jar in the /WEB-INF/lib folder; however, for WARs the Platform automatically imports the version of the javax.activation packages exported by the OSGi system bundle (i.e., the version provided with the JDK on which the Platform is currently running). In OSGi, packages specified via Import-Package take precedence over any packages which may be available in JARs on the Bundle-ClassPath. Thus, even though you package your own version of activation.jar within your WAR, it does not get used.
I hope this helps to clarify the issue for you, and we'll look into providing a better solution for this scenario in a future release.
Jun 30th, 2008, 08:08 AM
FYI: I've created a JIRA issue to track this topic.
Jul 3rd, 2008, 03:13 AM
I shall be interested in where this goes as there may be other classes that are loaded differently in the Platform to standard Tomcat.
It would be nice if deploying a traditional WAR to the platform was guaranteed to work the same as any standard web container.
That way you can enable people to move their legacy code onto the platform without the headache of removing jars from libs etc...
This is especially problematic if you use something like Maven 2 as the jar may come in as part of a transitive dependency.
Thanks again for the reply
Jul 3rd, 2008, 03:16 AM
We've provided a fix in the beta9 release. So once that goes out, please give it a try and let us know if it solves the issues you were facing.
Thanks in advance!
Jul 5th, 2008, 01:02 AM
I have got this exception when I send mail by using the imported mail libs (com.springsource.javax.activation-1.1.0.jar,com.springsource.javax.mail-1.4.0.jar) provided by SAP. And there is no ohter mail lib jars in the web application path. Perhaps the two jar files have been loaded by different ClassLoader. So can the the beta9 release solve this problem ?
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed;
The MANIFEST.MF config file likes this:
Jul 9th, 2008, 11:23 PM
I have tried the SAP beta9 for the mail sending problem. And when I put the activation.jar and mail.jar in the webapp lib dir I got the error below:
java.lang.NoSuchMethodError: com.sun.activation.registries.MailcapFile.getMailc apList(Ljava/lang/String
When I import the packages of mail process classes, I got the error below:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type text/plain; charset=UTF-8
Is there any advice for this ?
Jul 11th, 2008, 08:11 AM
We are looking into this issue. In addition, I've created a JIRA issue which you can track here:
Jul 22nd, 2008, 05:53 PM
Any additional insight into this issue? We are having the exact same problem and i see the bug is targeted for 1.0 but i don't see any activity sense the 11th.
Jul 23rd, 2008, 09:09 AM
We have identified that there are some issues surrounding mail support, and we are looking into it. We'll update the JIRA as soon as we've made concrete progress.
Tags for this Thread