cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the Java Activation Framework

Former Member
0 Kudos

Hi Experts,

I am developing an J2EE application that sends and receives MIME messages. My application works on NetWeaver 2004s. To handle MIME messages, the app needs to register mailcap entries as follows:

MailcapCommandMap mc = (MailcapCommandMap)CommandMap.getDefaultCommandMap();

mc.addMailcap(<mimeType 1>; ; x-java-content-handler=<DCH 1);

...

mc.addMailcap(<mimeType N>; ; x-java-content-handler=<DCH N>);

CommandMap.setDefaultCommandMap(mc);

In order for the Java Activation Framework (JAF) of the J2EE server to work for my application, I add the followings reference to the application-j2ee-engine.xml file:

...

<reference reference-type="hard">

* <reference-target provider-name="sap.com" target-type="library">*

* activation*

* </reference-target>*

</reference>

...

The activation.jar file is located in folder ...\j2ee\cluster\server<N>\bin\ext\activation.

When running the application, I get the following error:

javax.activation.UnsupportedDataTypeException: no object DCH for MIME type ...

This error seems to say that the DataContentHandler class cannot be loaded.

If I copy the activation.jar file to folder lib\ext of the JRE installation, my application works perfectly.

My question is: Can I still use the JAF of the J2EE server without copying the activation.jar to the JRE folder? What should I do?

Thanks,

Viet

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Viet,

Do you employ any cryptography to your mime messages? Did you manage to resolve the problem? I'm facing the same problem but unable to solve it.

Thanks in advance,

Joe

Edited by: joe.ye on Jun 30, 2010 11:23 AM

Former Member
0 Kudos

Hi All,

I know the cause. My DataContentHandler classes that are packed and deployed along with the application are loaded by Application class loader, while the Java Activation Framework (JAF) classes are loaded by Component class loader. The Component class loader couldn't find my DataContentHandler classes, so it couldn't load my classes.

Now my question is: Are there any ways for the Component class loader to be able to find our DataContentHandler classes?

Thanks,

Viet

Edited by: Viet Phan on May 14, 2009 7:43 AM