google-app-engine


Jersey throwing exception in Google App Engine


I am trying to use mail gun API for sending messages.
public Map sendMail(String toMailId, String subject, String html) {
String useremail = CommonAttributesHelper.getLoggedInUser(getThreadLocalRequest());
log.info("Logged in user email is " + useremail);
Preconditions.checkNotNull(toMailId);
Preconditions.checkNotNull(useremail);
Preconditions.checkNotNull(html);
UserMessagesAndErrors ume = ThreadLocalObjects.getThreadLocalUserMessagesAndErrors().get();
Map<String, Object> map = new HashMap<String, Object>();
map.put("ume", ume);
Client client = Client.create();
client.addFilter(new HTTPBasicAuthFilter("api", "key-XXXXXXXXXXXXXXXXX"));
WebResource webResource =
client.resource("https://api.mailgun.net/v3/sandboxXXXXXXXX.mailgun.org/messages");
MultivaluedMapImpl formData = new MultivaluedMapImpl();
formData.add("from", useremail);
formData.add("to", toMailId);
formData.add("subject", subject);
formData.add("html", html);
webResource.type(MediaType.APPLICATION_FORM_URLENCODED).post(ClientResponse.class, formData);
ume.addMessage("Mail sent successfully");
return map;
}
It works fine in local, but i am getting the exception in the remote google app engine server even though mail is sent. I have copied the error stack trace and pasted below.
com.sun.jersey.core.spi.component.ProviderFactory __getComponentProvider: The provider class, class com.sun.jersey.atom.rome.impl.provider.entity.AtomFeedProvider, could not be instantiated. Processing will continue but the class will not be utilizedjava.lang.SecurityException: Unable to get members for class com.sun.jersey.atom.rome.impl.provider.entity.AtomFeedProvider
at com.google.appengine.runtime.Request.process-274b4b6665811552(Request.java)
at java.lang.Class.getDeclaredMethods(Class.java:289)
at com.sun.jersey.core.reflection.MethodList.getAllDeclaredMethods(MethodList.java:70)
at com.sun.jersey.core.reflection.MethodList.<init>(MethodList.java:64)
at com.sun.jersey.core.spi.component.ComponentConstructor.getPostConstructMethods(ComponentConstructor.java:132)
at com.sun.jersey.core.spi.component.ComponentConstructor.<init>(ComponentConstructor.java:124)
at com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(ProviderFactory.java:165)
at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:137)
at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:283)
at com.sun.jersey.core.spi.component.ProviderServices.getServices(ProviderServices.java:163)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.java:176)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.java:162)
at com.sun.jersey.api.client.Client.init(Client.java:343)
at com.sun.jersey.api.client.Client.access$000(Client.java:119)
at com.sun.jersey.api.client.Client$1.f(Client.java:192)
at com.sun.jersey.api.client.Client$1.f(Client.java:188)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
at com.sun.jersey.api.client.Client.<init>(Client.java:188)
at com.sun.jersey.api.client.Client.<init>(Client.java:160)
at com.sun.jersey.api.client.Client.create(Client.java:673)
at com.veersoft.gwt.server.CommonGwtServiceImpl.sendMail(CommonGwtServiceImpl.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:44)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:265)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:305)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.veersoft.filter.ResetUserMessagesAndErrorsFilter.doFilter(ResetUserMessagesAndErrorsFilter.java:30)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.googlecode.objectify.cache.AsyncCacheFilter.doFilter(AsyncCacheFilter.java:59)
at com.googlecode.objectify.ObjectifyFilter.doFilter(ObjectifyFilter.java:49)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:439)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:446)
at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:256)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:310)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:302)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:443)
at java.lang.Thread.run(Thread.java:745)Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
... 63 moreCaused by: java.lang.NoClassDefFoundError: com/sun/syndication/io/FeedException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2621)
... 63 moreCaused by: java.lang.ClassNotFoundException: com.sun.syndication.io.FeedException
at com.google.appengine.runtime.Request.process-274b4b6665811552(Request.java)
... 63 more
Also I am using the standard Jersey dependencies which GAE recommended,
Where am I doing wrong?

Related Links

GWT: form post works only on the local server, not with the app engine
NoClassDefFoundError: com/google/api/client/util/Lists when setting up oauth2 on app engine
Objectify with Cloud Endpoints
Access extrenal db service from App engine
“Sample DB” for Google App Engine Datastore
What is the Entity Key for in the Datastore Viewer?
How to get custom attribues of User using Admin Sdk.?
'Model is not immutable' TypeError
How to store data from SmartGWT ListGrid?
BigQuery OAuth access token on Java App Engine dev server
Google App Engine ancestor query in JPA
Google App Engine Go memory management
How to build Many-to-Many relations in Google App-engine using JPA
Currently experiencing frequent DeadlineExceededExceptions when it was fine a few hours ago
How to get related to db.Model entity from datastore - what API allows it?
GAE-Python: Can Appstats record RPC made in background thread?

Categories

HOME
string
angular-formly
3d
camera
jsf-2.2
owl-carousel
r-googlesheets
database-normalization
tivoli
mips
big-o
jquery-ui
nfs
modal-dialog
radgridview
atlassian
flatpak
cumulocity
http-post
event-sourcing
mathprog
template-engine
smartclient
sse
delphi-xe5
enterprise-miner
visual-glitch
guzzle
squashfs
jquery-ias
gulp-watch
react-toolbox
tosca
gmock
beta
froala
stackexchange
nstimer
panoramas
testbed
kodi
sammy.js
gnat-gps
graphhopper
timing
sessionstorage
tex
p4merge
hackintosh
tasm
laravel-elixir
android-softkeyboard
parser-generator
naming
lpsolve
smoothstate.js
http-request
flask-login
oim
mesosphere
wcftestclient
globalize
rserve
identification
scalding
sundials
libjpeg
swingworker
pocketsphinx-android
restore
cronexpression
node-request
docpad
pytables
burrows-wheeler-transform
wso2developerstudio
scaffolding
inf
doctype
dronekit-android
mraid
beatsmusic
formview
psr-4
imagefilter
wcm
create.js
paste
extjs2
vbe
square-bracket
android-usb
mysql-error-1044
intersect
node-redis
denied
fsevents
u2netdk
tournament
dataform
qtabbar
web-application-project
firefox-3

Resources

Encrypt Message