Exception in thread "main" com.google.apphosting.api.ApiProxy $ CallNotFoundException: API package "mail" or call "Send ()" was not found

I wrote a program to send mail using gmail, it works fine if I run it separately, but when I integrate with the Google appengine, it gives me the error below,

Exception in thread "main" com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'mail' or call 'Send()' was not found. at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:104) at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:56) at com.google.appengine.api.mail.MailServiceImpl.doSend(MailServiceImpl.java:98) at com.google.appengine.api.mail.MailServiceImpl.send(MailServiceImpl.java:34) at com.google.appengine.api.mail.stdimpl.GMTransport.sendMessage(GMTransport.java:231) at javax.mail.Transport.send(Transport.java:95) at javax.mail.Transport.send(Transport.java:48) at in.javadomain.PostMail.postMailMethod(PostMail.java:49) at in.javadomain.PostMail.main(PostMail.java:20) 

I am sure integration error or error. I already added javax.mail jar.

+7
java google-app-engine
source share
1 answer

You need to configure the test environment correctly, for example:

 private final LocalServiceTestHelper helper = new LocalServiceTestHelper(new LocalMailServiceTestConfig()); @Before public void setUp() { helper.setUp(); } @After public void tearDown() { helper.tearDown(); } 

GAE requires these dependencies:

 <properties> <gae.version>1.9.17</gae.version> </properties> ... <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-api-labs</artifactId> <version>${gae.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-api-stubs</artifactId> <version>${gae.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-testing</artifactId> <version>${gae.version}</version> <scope>test</scope> </dependency> 
+2
source share

All Articles