java - Google Appengine with Jersey 2.1x works fine in dev server but not in Appengine servers -


i have been using jersey v2.19 google appengine v1.9.22 , works fine in local devserver without issue, when tried deploy application appengine. multiple exceptions

frameworks used :

appengine java 1.9.22

jersey 2.19

objectify 5.1.5

guice 3.x

gradle

following exception in log:

org.glassfish.jersey.internal.errors logerrors: following warnings have been detected: warning: unknown hk2 failure detected:

multiexception stack 1 of 4

java.security.accesscontrolexception: access denied ("java.lang.runtimepermission" "getclassloader") @ com.google.appengine.runtime.request.process-84bc59f0ba240851(request.java) @ java.security.accesscontrolcontext.checkpermission(accesscontrolcontext.java:382) @ java.security.accesscontroller.checkpermission(accesscontroller.java:572) @ java.lang.securitymanager.checkpermission(securitymanager.java:549) @ java.lang.classloader.checkclassloaderpermission(classloader.java:1606) @ java.lang.classloader.getsystemclassloader(classloader.java:1525) @ org.jvnet.hk2.internal.proxyutilities$1.run(proxyutilities.java:95) @ org.jvnet.hk2.internal.proxyutilities$1.run(proxyutilities.java:90) @ java.security.accesscontroller.doprivileged(accesscontroller.java:34) @ org.jvnet.hk2.internal.proxyutilities.securecreate(proxyutilities.java:90) @ org.jvnet.hk2.internal.proxyutilities.generateproxy(proxyutilities.java:206) @ org.jvnet.hk2.internal.utilities.createservice(utilities.java:2038) @ org.jvnet.hk2.internal.servicehandleimpl.getservice(servicehandleimpl.java:105) @ org.jvnet.hk2.internal.servicehandleimpl.getservice(servicehandleimpl.java:87) @ org.glassfish.jersey.internal.inject.contextinjectionresolver.resolve(contextinjectionresolver.java:126) @ org.jvnet.hk2.internal.clazzcreator.resolve(clazzcreator.java:214) @ org.jvnet.hk2.internal.clazzcreator.resolvealldependencies(clazzcreator.java:237) @ org.jvnet.hk2.internal.clazzcreator.create(clazzcreator.java:360) @ org.jvnet.hk2.internal.systemdescriptor.create(systemdescriptor.java:470) @ org.jvnet.hk2.internal.singletoncontext$1.compute(singletoncontext.java:82) @ org.jvnet.hk2.internal.singletoncontext$1.compute(singletoncontext.java:70) @ org.glassfish.hk2.utilities.cache.cache$originthreadawarefuture$1.call(cache.java:97) @ java.util.concurrent.futuretask.run(futuretask.java:260) @ org.glassfish.hk2.utilities.cache.cache$originthreadawarefuture.run(cache.java:154) @ org.glassfish.hk2.utilities.cache.cache.compute(cache.java:199) @ org.jvnet.hk2.internal.singletoncontext.findorcreate(singletoncontext.java:121) @ org.jvnet.hk2.internal.utilities.createservice(utilities.java:2065) @ org.jvnet.hk2.internal.servicehandleimpl.getservice(servicehandleimpl.java:105) @ org.jvnet.hk2.internal.servicehandleimpl.getservice(servicehandleimpl.java:87) @ org.glassfish.jersey.internal.inject.providers.getallrankedproviders(providers.java:247) @ org.glassfish.jersey.server.applicationhandler.getprocessingproviders(applicationhandler.java:758) @ org.glassfish.jersey.server.applicationhandler.initialize(applicationhandler.java:536) @ org.glassfish.jersey.server.applicationhandler.access$500(applicationhandler.java:183) @ org.glassfish.jersey.server.applicationhandler$3.call(applicationhandler.java:349) @ org.glassfish.jersey.server.applicationhandler$3.call(applicationhandler.java:346) @ org.glassfish.jersey.internal.errors.process(errors.java:315) @ org.glassfish.jersey.internal.errors.process(errors.java:297) @ org.glassfish.jersey.internal.errors.processwithexception(errors.java:255) @ org.glassfish.jersey.server.applicationhandler.(applicationhandler.java:346) @ org.glassfish.jersey.servlet.webcomponent.(webcomponent.java:339) @ org.glassfish.jersey.servlet.servletcontainer.init(servletcontainer.java:170) @ org.glassfish.jersey.servlet.servletcontainer.init(servletcontainer.java:393) @ org.mortbay.jetty.servlet.filterholder.dostart(filterholder.java:97) @ org.mortbay.component.abstractlifecycle.start(abstractlifecycle.java:50) @ org.mortbay.jetty.servlet.servlethandler.initialize(servlethandler.java:662) @ org.mortbay.jetty.servlet.context.startcontext(context.java:140) @ org.mortbay.jetty.webapp.webappcontext.startcontext(webappcontext.java:1250) @ org.mortbay.jetty.handler.contexthandler.dostart(contexthandler.java:517) @ org.mortbay.jetty.webapp.webappcontext.dostart(webappcontext.java:467) @ org.mortbay.component.abstractlifecycle.start(abstractlifecycle.java:50) @ com.google.tracing.tracecontext$tracecontextrunnable.runincontext(tracecontext.java:437) @ com.google.tracing.tracecontext$tracecontextrunnable$1.run(tracecontext.java:444) @ com.google.tracing.currentcontext.runincontext(currentcontext.java:230) @ com.google.tracing.tracecontext$abstracttracecontextcallback.runininheritedcontextnounref(tracecontext.java:308) @ com.google.tracing.tracecontext$abstracttracecontextcallback.runininheritedcontext(tracecontext.java:300) @ com.google.tracing.tracecontext$tracecontextrunnable.run(tracecontext.java:441) @ java.lang.thread.run(thread.java:745)

multiexception stack 2 of 4

java.lang.illegalargumentexception: while attempting create proxy javax.servlet.http.httpservletrequest in scope org.glassfish.jersey.process.internal.requestscoped error occured while creating proxy @ org.jvnet.hk2.internal.proxyutilities.generateproxy(proxyutilities.java:212) @ org.jvnet.hk2.internal.utilities.createservice(utilities.java:2038) @ org.jvnet.hk2.internal.servicehandleimpl.getservice(servicehandleimpl.java:105) @ org.jvnet.hk2.internal.servicehandleimpl.getservice(servicehandleimpl.java:87) @ org.glassfish.jersey.internal.inject.contextinjectionresolver.resolve(contextinjectionresolver.java:126)

... trimmed

multiexception stack 3 of 4

java.lang.illegalargumentexception: while attempting resolve dependencies of com.app.webapp.filters.webapiauthfilter errors found

multiexception stack 4 of 4

java.lang.illegalstateexception: unable perform operation: resolve on com.app.webapp.filters.webapiauthfilter

i have searched possible fix, couldn't able find relates problem, dint use jdo or jpa asm jar incompatibility not cause.

any idea on how resolve issue ?

update :

i tried figure out cause exception, have filter in have injected httpservletrequest , exception thrown because of that, not sure why though.

@provider @webapiauth public class authfilter implements containerrequestfilter {   // problem because of injecting    @context   protected httpservletrequest servletrequest; } 

this late you, in interest of helping others -- facing same problem trying access request.getremoteaddr(). injecting httpservletrequest threw error @ runtime, , none of environment variables, request properties, or headers contained remote address.

https://stackoverflow.com/a/23590606/3037408

provides working solution adds 'remote_addr' header jersey/jaxrs headers. if needed access other remote_addr httpservletrequest, insert relevant data headers or other property later access well.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -