ClassCastException: javax.mail.Session incompatible with javax.mail.Session

Solution Verified - Updated -

Issue

When trying to send an email from business process, deployed on the kie-server.war the following exceptions occurs:

Caused by: org.jbpm.bpmn2.handler.WorkItemHandlerRuntimeException: java.lang.ClassCastException: javax.mail.Session incompatible with javax.mail.Session
    at org.jbpm.process.workitem.AbstractLogOrThrowWorkItemHandler.handleException(AbstractLogOrThrowWorkItemHandler.java:55)
    at org.jbpm.process.workitem.AbstractLogOrThrowWorkItemHandler.handleException(AbstractLogOrThrowWorkItemHandler.java:38)
    at org.jbpm.process.workitem.email.EmailWorkItemHandler.executeWorkItem(EmailWorkItemHandler.java:88)
    at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:69)
    at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:138)
    ... 107 more
Caused by: java.lang.ClassCastException: javax.mail.Session incompatible with javax.mail.Session
    at org.jbpm.process.workitem.email.SendHtml.getSession(SendHtml.java:189)
    at org.jbpm.process.workitem.email.SendHtml.sendHtml(SendHtml.java:68)
    at org.jbpm.process.workitem.email.SendHtml.sendHtml(SendHtml.java:55)
    at org.jbpm.process.workitem.email.EmailWorkItemHandler.executeWorkItem(EmailWorkItemHandler.java:82)
    ... 109 more

Environment

  • Red Hat JBoss BPM Suite (kie-server only)
    • 6.1+
  • Red Hat JBoss BRMS (kie-server only)
    • 6.1+
  • WebSphere Application Server 8+

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.