Exception when using JavaMail with Google AppEngine: how to fix it?

I am trying to write a Java program using JavaMail to send email between two users. I have NOT added the mail.jar and activation.jar files to the appengine project as I read somewhere that this will throw exceptions due to the functionality already available with the appengine.jar files. But my program is throwing the following exception: -

Exception in thread "main" com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'mail' or call 'Send()' was not found.
- Hide quoted text -
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:95)
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:48)
at com.google.appengine.api.mail.MailServiceImpl.doSend(MailServiceImpl.java:95)
at com.google.appengine.api.mail.MailServiceImpl.send(MailServiceImpl.java:32)
at com.google.appengine.api.mail.stdimpl.GMTransport.sendMessage(GMTransport.java:247)
at javax.mail.Transport.send(Transport.java:95)
at javax.mail.Transport.send(Transport.java:48)
at weatherForecast.SendEmail.main(SendEmail.java:40)

      

I read in the following post: http://forums.smartclient.com/showthread.php?t=8589 that I need to remove the appengine.jar files from my project in order for everything to work. But my web app also includes providing a .jsp file filled with some data, which is the welcome page of my google app when deployed to google appengine and the project doesn't work as soon as I delete the .jars. However, it helps me get rid of the exception. Can anyone suggest a way to write an email program and make it work on a google appengine project?

0


source to share


2 answers


You probably still somehow accidentally include a .jar file that shouldn't be included.

Right click your project folder and check:



  • Properties -> Java Build Path
  • Properties -> Java EE Module Dependencies

And also make sure there is no jar /war/WEB-INF/lib/

, jars that should not be uploaded to google should be stored in a separate location in your project, I recommend /lib/

.

0


source


If you are using Flexible it is because Google does not support Mail service in flex environment. Java Mail with built-in mail service in GAE seems to be designed to only work in the standard Java framework on this Migration Tips. ... The agile interface introduces three third party post APIs. You can use GMail API for another option.



0


source







All Articles