GWT RPC ServerSerializationStreamReader.deserialize throwing java.lang.ClassNotFoundException: https: - google-app-engine

Server code running in Google App Engine cloud environment is throwing an exception related to GWT-RPC serialization / deserialization. It looks like the root cause is:
Caused by: java.lang.ClassNotFoundException: https:
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at com.google.apphosting.runtime.ApplicationClassLoader.findClass(ApplicationClassLoader.java:135)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:349)
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:543)
I believe this started occurring after we upgraded to Java 8 and version 2.8.1 of com.google.gwt libraries.
Our code used to work with an older version of GWT.
The data types being sent between client and server
are Serializable.
The ClassNotFoundException: https: is a mystery so far.

It turns out the issue was an incompatibility between gwt-servlet 2.4.0 and GWT 2.8.1
Switch to use gwt-servlet 2.8.1 made the issue go away
I saw someone else had the same issue, reported here:
https://github.com/gwtproject/gwt/issues/9224
and I verified it with our project also.

Related

java.lang.NoClassDefFoundError: java.lang.reflect.Parameter is a restricted class

When changed to JRE to JDK 1.8.0, Not able to get the server started. It compiled fine. Note, this application runs fine with JRE 1.7
I'm using SDK App Engine - 1.9.71
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0':
BeanPostProcessor before instantiation of bean failed; nested
exception is java.lang.NoClassDefFoundError:
java.lang.reflect.Parameter is a restricted class. Please see the
Google App Engine developer's guide for more details. at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:478)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
... 61 more Caused by: java.lang.NoClassDefFoundError:
java.lang.reflect.Parameter is a restricted class. Please see the
Google App Engine developer's guide for more details. at
com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
at
org.springframework.core.StandardReflectionParameterNameDiscoverer.getParameterNames(StandardReflectionParameterNameDiscoverer.java:56)
at
org.springframework.core.PrioritizedParameterNameDiscoverer.getParameterNames(PrioritizedParameterNameDiscoverer.java:65)
at
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:182)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1143)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1046)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at
org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:648)
at
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1143)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1046)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:201)
at
org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:92)
at
org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:101)
at
org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator.findCandidateAdvisors(AnnotationAwareAspectJAutoProxyCreator.java:85)
at
org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.shouldSkip(AspectJAwareAdvisorAutoProxyCreator.java:103)
at
org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessBeforeInstantiation(AbstractAutoProxyCreator.java:243)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:988)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:959)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:472)
... 66 more
You say in your question:
"I'm using SDK App Engine - 1.9.34"
App Engine SDK 1.9.34 is an old version base on Java 7 that doesn't support Java 8.
Try with a newer App Engine SDK version.

Executing Spring Cloud application in Google AppEngine

We are trying to deploy a Spring Cloud (Boot + Netflix API wrappers) based project in Google AppEngine. We want to use spring-cloud-starter-zuul as an API Gateway.
For reasons beyond the development team, we have to deploy this in the AppEngine Standard Environment (Java7, Servlet 2.5). We can't use the newer AppEngine Flexible Environment (container based, Java 8).
We have created a sample Gradle+AppEngine project based on these guidelines.
Sample project code is on Github.
We see this stacktrace when running the command ./gradlew appengineRun:
java.lang.ClassNotFoundException: com.google.appengine.api.ThreadManager
at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_80]
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_80]
at java.security.AccessController.doPrivileged(Native Method) [na:1.7.0_80]
at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_80]
at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[na:1.7.0_80]
at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:198) ~[appengine-local-runtime.jar:na]
at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[na:1.7.0_80]
at java.lang.Class.forName0(Native Method) ~[na:1.7.0_80]
at java.lang.Class.forName(Class.java:195) ~[na:1.7.0_80]
at com.netflix.hystrix.util.PlatformSpecific.getAppEngineThreadFactory(PlatformSpecific.java:64) ~[hystrix-core-1.5.5.jar:1.5.5]
at com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsPoller.<init>(HystrixMetricsPoller.java:86) ~[hystrix-metrics-event-stream-1.5.5.jar:1.5.5]
at org.springframework.cloud.netflix.hystrix.HystrixCircuitBreakerConfiguration$HystrixMetricsPollerConfiguration.start(HystrixCircuitBreakerConfiguration.java:135) ~[spring-cloud-netflix-core-1.2.0.RELEASE.jar:1.2.0.RELEASE]
What are we missing to be getting this error during application startup?
Is this related to Hystrix code trying to ascertain if it is running in an AppEngine environment? Ref: Netflix Hystrix Pull Request 1066 (due to few reputation points on SO, I can't post more than two links).
Thank you.

Jersey 1.17 on Google App Engine

I deployed my REST service on Google App Engine and I receive following error each time I try to query the service:
com.sun.jersey.core.spi.component.ProviderFactory __getComponentProvider: The provider class, class com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider, could not be instantiated. Processing will continue but the class will not be utilized
java.lang.SecurityException: Unable to get members for class com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider
at com.google.appengine.runtime.Request.process-7d6711107bb7eaaa(Request.java)
at java.lang.Class.getDeclaredMethods(Class.java:253)
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:131)
at com.sun.jersey.core.spi.component.ComponentConstructor.<init>(ComponentConstructor.java:123)
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:256)
at com.sun.jersey.core.spi.component.ProviderServices.getServices(ProviderServices.java:160)
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.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1310)
at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:168)
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:774)
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:770)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:770)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:765)
at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:489)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:319)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:374)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:557)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:454)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:461)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:703)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:338)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:330)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:458)
at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
... 41 more
Caused by: java.lang.NoClassDefFoundError: javax/mail/MessagingException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2444)
... 41 more
Caused by: java.lang.ClassNotFoundException: javax.mail.MessagingException
at com.google.appengine.runtime.Request.process-7d6711107bb7eaaa(Request.java)
... 41 more
This service doesn't use or send any mail messages. Only one thing it does is writing JSON response from some POJO. It works locally of course (on local GAE and local Tomcat).
It might be a compatibility problem with versions. According to this, Jersey versions that are compatible with Google App Engine are 1.5 and 1.1.5.
I had similar problems and I don't like this version compatibility issues, so I opted for:
To offer REST web services from GAE, use Google Cloud Endpoints, which is still an experimental technology but as far as I've tried, it works pretty well. Furthermore it is very well integrated with GAE and the Google Plugin for Eclipse.
To cosume REST services from GAE, I've opted for using just Java build-in HTTP client library as explained here. I don't know if it's the best way, but it is very simple and you avoid compatibility problems that could arise between GAE and external APIs such as Jersey.
I created a GAE REST skeleton app on GitHub. It's at https://github.com/deege/gae-rest-skeleton
The app just has two REST calls defined, but it will give you a starting point. It uses GAE 1.9.4, and Jersey 1.17.1.
You can fork the code from https://github.com/deege/gae-rest-skeleton.git

Using maven-gae-plugin behind proxy

I'm using maven-gae-plugin 0.9.2 happily except one issue: it can not use proxy to connect to internet, and every time i call the run goal it will throw an exception:
INFO: Unable to access
https://appengine.google.com/api/updatecheck?runtime=java&release=1.6.1&timestamp=1323730393&api_versions=[
'1.0'] java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:564)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:141)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:395)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)
at sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:272)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329) ....
i tried use <jvmflags> under <configuration> to give my proxy address but with no luck, and Google didn't give me any useful info too. Any ideas?
I had the same problem and I resolved it in other way, by putting this line in the goals of my eclipse run configuration:
-DproxySet=true -DproxyHost=X.X.X.X -DproxyPort=8080 appengine:update
I hope it could help other people with the same problem :)
Eclipse Run Configurations:
Problem solved, <jvmflags> should be <jvmFlags>

Error when connecting Apache with Glassfish - Bad request

I am trying to frontend a glassfish server with Apache so that pages requested on port 80 go to the glassfish server for a certain application.I am using mod_jk to do this. When I call my url in the browser the mod_jk.log contains a 'bad request' response from glassfish.
The glassfish server log has the following error
[#|2011-07-10T15:02:39.491+0100|SEVERE|glassfish3.0.1|org.apache.jk.common.HandlerRequest|_ThreadID=25;_ThreadName=Thread-1;|Error decoding request
java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.put(Unknown Source)
at com.sun.grizzly.tcp.Request.setAttribute(Request.java:446)
at org.apache.jk.common.HandlerRequest.decodeAttributes(HandlerRequest.java:501)
at org.apache.jk.common.HandlerRequest.decodeRequest(HandlerRequest.java:451)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:303)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:814)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:743)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:936)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:682)
at java.lang.Thread.run(Unknown Source)
|#]
Any ideas on this greatly appreciated!
Probably too late but...
I believe you are hitting a bug in GlassFish 3.1 (and I think it's in 3.1.1 as well) which is described here: http://java.net/jira/browse/GLASSFISH-17068. There is a patch in the bug available in report until 3.1.2 is release..

Resources