Forums de discussion

loader constraint violation using liferay mail

Martina Biermann, modifié il y a 12 années.

loader constraint violation using liferay mail

New Member Publications: 2 Date d'inscription: 27/03/12 Publications récentes
Hello,
i'm using liferay portal 6.1 with tomcat 7.0.23
I set the mail settings in the control panel.

When I try to send n email via liferay mail, i'm getting the following exception:

[ResponseWriterBridgeImpl:241] writing value=[loader constraint violation: when resolving method "com.liferay.mail.service.MailServiceUtil.getSession()Ljavax/mail/Session;"
the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
of the current class, com/liferay/util/mail/MailEngine,
and the class loader (instance of org/apache/catalina/loader/StandardClassLoader)
for resolved class, com/liferay/mail/service/MailServiceUtil,
have different Class objects for the type javax/mail/Session used in the signature]

Is this a configuration problem? Have I to configure which mailing classes to use?
thumbnail
David H Nebinger, modifié il y a 12 années.

RE: loader constraint violation using liferay mail

Liferay Legend Publications: 14917 Date d'inscription: 02/09/06 Publications récentes
You can't use Liferay's session that way because you're in a different war and trying to cross the class loader boundary.

You can either create your own session or use the Liferay facilities to send an email.
thumbnail
Hitoshi Ozawa, modifié il y a 12 années.

RE: loader constraint violation using liferay mail

Liferay Legend Publications: 7942 Date d'inscription: 24/03/10 Publications récentes
Are you trying to use the Mail Portlet?
If so, you don't have to setup mail configuration in the Control Panel. These setting are when using Liferay Mail API to send mail out and is not used by the Mail Portlet.

Following page contains information on using the Mail Portlet:

http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/ma-4
Martina Biermann, modifié il y a 12 années.

RE: loader constraint violation using liferay mail

New Member Publications: 2 Date d'inscription: 27/03/12 Publications récentes
I'm using the liferay mail API and get the exception when I call MailEngine.send(from, to, subject, body) method
thumbnail
Hitoshi Ozawa, modifié il y a 12 années.

RE: loader constraint violation using liferay mail

Liferay Legend Publications: 7942 Date d'inscription: 24/03/10 Publications récentes
I'm just used MailServiceUtil.sendEmail(mailMessage); and haven't encountered any problem creating a simple batch mailer portlet.
thumbnail
Fernando Fernandez, modifié il y a 9 années.

RE: loader constraint violation using liferay mail

Expert Publications: 396 Date d'inscription: 22/08/07 Publications récentes
It's probably to late to answer this, but maybe it can help someone else.

I just had the same problem and found out that I was deploying another version of javax.mail in a jar within my portlet's lib.

The problem was solved by removing this jar and using the javax.mail that is already bundled with the liferay+tomcat bundle.

HTH

Fernando