Symptom
Unable to send emails after updating a Pega application or establishing an SMTP connection.
Error
<pxErrorMessage>loader constraint violation: when resolving interface method "javax.mail.Part.setDataHandler(Ljavax/activation/DataHandler;)V" the class loader (instance of com/pega/pegarules/bootstrap/loader/PRAppLoader) of the current class, com/pega/platform/integrationcore/client/email/internal/javamail/JavaMailPart, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for the method's defining class, javax/mail/Part, have different Class objects for the type javax/activation/DataHandler used in the signature</pxErrorMessage>
Explanation
Conflicting JBoss jar version. The class loading strategy of Pega collides with that of JBoss for the javax.activation
classes, which are provided as external libraries and in Java Runtime Library.
Environment
The issue occurs in the following environments:
- Pega Platform version 8.2.2 on-premises
- Pega Platform version 8.6.4 on-premises
- Pega Platform version 8.7 on client cloud
Solution
Perform the following local change:
- Modify
module.xml
file ofjavax.activation.api
class to exclude JBOSS from loading this class so it is always delegated to Java Runtime Environment (JRE). - Open the JBOSS folder:
/modules/system/layers/base/javax/activation/api/main/module.xml
, to add the following code:
<module xmlns="urn:jboss:module:1.3" name="javax.activation.api">
<dependencies>
<module name="javax.api" />
<module name="javax.mail.api" optional="true">
<imports><include path="META-INF"/></imports>
</module>
<module name="com.sun.xml.messaging.saaj" optional="true"/>
<module name="org.jboss.ws.native.jbossws-native-core" optional="true"/>
<module name="org.apache.cxf" optional="true"/>
<system export="true"><paths><path name="javax/activation"/></paths></system>
</dependencies>
<!---<resources>
<resource-root path="activation-1.1.1.redhat-5.jar"/>
</resources>--->
</module>