Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem with NoClassDefFoundError

Hello,

Below is the problem that I am encountering. Any help or suggestions will be greatly appreciated. Thank you very much.

<u>Scenario</u>

I have 2 local components :

1) wd_mail : Have 2 java classes , Email.java and SendMailException.java (The classes were from some forumer in SDN ). A wd_sendmail_pp as been exposed as a public part which containes the above 2 classes.

2) wd_main : Declares wd_sendmail_pp as a used DC.

<u>Problem</u>

When I deploy and run wd_main, I get the dump below. It seems that the SendMailException cannot be 'seen' by wd_main.

Here is the code:

try {

Properties p = new Properties();

Email mail = Email.getEmailInstance(p);

mail.setFrom("testfrom@mail.com");

mail.setTo("testto@sap.com");

mail.setSubject("Test mail");

mail.setMessages(new String[] { "As above ..... " });

mail.send();

wdComponentAPI.getMessageManager().reportSuccess("Email sent.");

} catch (SendMailException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

I took the same piece of code and added to the wdDoInit of component controller in wd_mail and it works perfectly.

<u>Error Stack</u>

#... 42 more

Caused by: java.lang.NoClassDefFoundError: com/sap/commons/sendmail/SendMailException

#at com.sap.xbcr.carddetails.wdp.InternalCardDetailsView.<init>(InternalCardDetailsView.java:1103)

from

Kwok Wei

Not what you were looking for? View more on this topic or Ask a question