|JavaMail and JAX-WS in Eclipse Scout [message #647259]
||Wed, 05 January 2011 12:51
| Daniel Wiehl
Registered: April 2010
In the past, we encountered trouble with JAX-WS 2.1.6 in combination with JavaMail 1.4.3 and JMS 1.1.0.|
In order to make use of JavaMail in other plug-ins, we encapsulated the orginal mail and jms Jars within our custom plug-ins javax.mail.jre16_1.4.3.jar, javax.mail.jre15_1.4.1.jar and javax.jms_1.1.0.jar, respectively. After integration JAX-WS into Scout, mailing did not work properly afterwards. It very depended whether JAX-WS was booting prior or after to JavaMail to initialize some handlers in a factory. When JAX-WS was first, if was not aware of a general configuration file located in javax.mail.jre1x_x.x.x.jar plug-in with proper default values. This is because JAX-WS is part of JRE distribution which cannot see our Scout plug-ins a layer above. So in term, mailing was broken.
We did lot of investigation in solving this problem with the only practicable solution of moving the respective mail and jms Jars directly into jre/lib/endorsed directory to become part of JRE itself. Therefore, JAX-WS is now able to recognize the config file to do its initialization work properly. It does not matter anymore whether JAX-WS or JavaMail are loaded first.
What does that mean for you?
If using JavaMail in your product, download the request jar from Oracle and put it into the endorsed directory of the JRE used by Eclipse IDE. It can be downloaded from http://www.oracle.com/technetwork/java/index-138643.html. Afterwards, in order to make use of its contained classes, you have to adapt the build path of your eclipse projects. In the build properties, you can find a tab 'JRE System library'. Click the node 'Access rules' and add a new entry with the pattern 'javax/**' and visibility 'Accessible'. Afterwards, feel free to use JavaMail in your product.
Note: This change in build path is only required for development time to compile sources referring to classes in endorsed directory. When installing the product, those Jars are either already included in the application container or must be added manually to the respective endorsed directory. Please refere to the documentation of the application server in use.
Powered by FUDForum
. Page generated in 0.01689 seconds