Forum Discussion

Lewis_Beard's avatar
2 years ago

javax.mail.Session issues?

I wanted to do some simple email things based on some of the datasources such as email_TransitTime etc, but every time I try to use the Session class in the same way the LM datasources do, I get the error “unable to resolve class Session”.

All the datasources on our platform that fall under email_Whatever all do the same basic imports of javax.mail.* (which I believe is where this class is supposed to live) and a couple others, and snags System.getProperties() into a variable such as props or smtpProps, sets some additional mail properties, and then makes this call:

Session session = Session.getInstance(props, null);

But when I do this, I just get “unable to resolve class Session” every time.

Is this user error? :) Or does the availability of javax.mail.Session depend on some other module or component?

Thanks!

  • Check the Email_RoundTrip module. It is still largely useless if you need OAuth2. LM in theory added support but it remains undocumented AFAIK.

  • Check the Email_RoundTrip module. It is still largely useless if you need OAuth2. LM in theory added support but it remains undocumented AFAIK.

  • They changed it to jakarta. Beat my head against that one a fair bit recently.

  • Do you have any more information on that? On how to use it in LogicMonitor? I just searched and found some pages talking about using Jakarta mail Session class stuff, but in the first 2 examples I found, they were still importing javax.mail.* etc.

  • Ah! We werent actually using any of the Email_ datasources, and I had looked at that one, and it had the same problem. BUT I see now that our version was super ancient, so ancient it didnt have a version number on it. :)

    I updated it to the latest since nobody is using it at present, and I see the jakarta stuff there now. I’ll check that and see if I can reverse engineer that. Thanks so much!