Google app engine return error log: unsupported major.minor version 51.0 - google-app-engine

I've just build a sample application to test out google app engine and google web toolkit feature, using a RPC service and google app engine with JDO. The service works on local. But after i deploy it to GAE and run, it show me the error as title says.
I use JRE7 to complie the application.
Here is my error log:
Uncaught exception from servlet
java.lang.UnsupportedClassVersionError: com/gwt/myexample/server/EmployeeServiceImpl:
Unsupported major.minor version 51.0
at com.google.appengine.runtime.Request.process-e8c21a25e91f709f(Request.java)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
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:449)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run
(TraceContext.java:455)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.
runInInheritedContextNoUnref(TraceContext.java:333)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.
runInInheritedContext(TraceContext.java:325)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
at java.lang.Thread.run(Thread.java:679)
My application link: http://jdodemo02.appspot.com/
Any suggestion please ):

Compile your application with Java SE 6. GAE doesn't support Java SE 7. Locally it works, because the GAE simulator runs on top of your local JDK.

One thing is to set the JRE 6 to the Build Path and the Compiler as well.
Dont forget, once you created your GAE Web Application project with a different JRE or JDK, always check the java version in the org.eclipse.wst.common.project.facet.core.xml in your .settings folder.

instead of directly editing the org.eclipse.wst.common.project.facet.core.xml in your .settings folder It will be better review it in eclipse as bellow
Right click on your eclipse project
Select Properties
Select "Project Facets" in the left panel
Select the Java version appropriately

I've been fighting for days. I have a Mac and needed to use GCM developing an Android app. The only way I could get GAE working in Android Studio, and also compatible with the installed JVM that I had was:
Install Homebrew.
Customize it with Homebrew Cask (brew install caskroom/cask/brew-cask).
Install Java using homebrew cask (brew cask install java).
Install Android Studio using homebrew cask (brew cask install android-studio).
Update Studio to the latest version.
Go to settings of the project in Studio and change the target JDK to the one that homebrew installed (1.8 located in /Library/Java/Home, which is actually a symlink).
Hope non of you guys run in the same path as I did, One just doesn't walk into Mordor, It has been 5 long days of fighting.

Too run creatjs project from Flash devlop you must downlod:
google compiler from link:
https://developers.google.com/closure/compiler/
haxe compiler from
http://haxe.org/download
jave jre 7

Related

Eclipse Oxygen and Google Cloud Tools Missing javax.servlet Classes from Build Path

I have a GAE project in Eclipse that has been working without a problem. I recently upgraded to the Google Cloud SDK 179.0.0 and Eclipse Oxygen.1a Release (4.7.1a) and now, when I open the project, I'm getting build path errors on classes in the javax.servlet.http package. Specifically, the following classes are missing from my project's build path.
javax.servlet.ServletContext
javax.servlet.http.HttpServlet
If you start Eclipse from the console using the following commands (assuming Eclipse is installed in your /Applications folder):
cd /Applications/Eclipse.app/Contents/MacOS
./eclipse
And you watch the terminal window, you'll see a bunch of stack traces similar to the following:
Nov 10, 2017 9:24:57 AM com.google.cloud.tools.eclipse.appengine.localserver.ServletClasspathProvider doResolveClasspathContainer
WARNING: Failed to initialize libraries
org.eclipse.core.runtime.CoreException: Could not resolve artifact com.google.appengine:appengine-api-1.0-sdk:jar:1.9.57
at org.eclipse.m2e.core.internal.embedder.MavenImpl$5.call(MavenImpl.java:776)
at org.eclipse.m2e.core.internal.embedder.MavenImpl$5.call(MavenImpl.java:1)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:743)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:720)
at com.google.cloud.tools.eclipse.util.MavenUtils.resolveArtifact(MavenUtils.java:69)
at com.google.cloud.tools.eclipse.appengine.libraries.repository.MavenHelper.resolveArtifact(MavenHelper.java:46)
at com.google.cloud.tools.eclipse.appengine.libraries.repository.M2RepositoryService.resolveArtifact(M2RepositoryService.java:50)
at com.google.cloud.tools.eclipse.appengine.libraries.repository.LibraryClasspathContainerResolverService.resolveLibraryFileAttachSourceSync(LibraryClasspathContainerResolverService.java:245)
at com.google.cloud.tools.eclipse.appengine.libraries.repository.LibraryClasspathContainerResolverService.resolveLibraryAttachSourcesSync(LibraryClasspathContainerResolverService.java:106)
at com.google.cloud.tools.eclipse.appengine.localserver.ServletClasspathProvider.doResolveClasspathContainer(ServletClasspathProvider.java:100)
at com.google.cloud.tools.eclipse.appengine.localserver.ServletClasspathProvider.resolveClasspathContainer(ServletClasspathProvider.java:79)
at org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate.resolveClasspathContainerImpl(RuntimeClasspathProviderDelegate.java:135)
at org.eclipse.jst.server.core.internal.RuntimeClasspathProviderWrapper.resolveClasspathContainerImpl(RuntimeClasspathProviderWrapper.java:155)
at org.eclipse.jst.server.core.internal.RuntimeClasspathContainer.getClasspathEntries(RuntimeClasspathContainer.java:77)
at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2693)
at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2851)
at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1956)
at org.eclipse.jdt.internal.core.ExternalFolderChange.updateExternalFoldersIfNecessary(ExternalFolderChange.java:39)
at org.eclipse.jdt.internal.core.ChangeClasspathOperation.classpathChanged(ChangeClasspathOperation.java:59)
at org.eclipse.jdt.internal.core.SetContainerOperation.executeOperation(SetContainerOperation.java:111)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:724)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:795)
at org.eclipse.jdt.internal.core.JavaModelManager$10.run(JavaModelManager.java:3001)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
at org.eclipse.jdt.internal.core.JavaModelManager.initializeAllContainers(JavaModelManager.java:3017)
at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:2038)
at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore.java:3497)
at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2687)
at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2851)
at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1956)
at org.eclipse.jdt.internal.core.DynamicProjectReferences.getDependentProjects(DynamicProjectReferences.java:34)
at org.eclipse.core.internal.resources.ProjectDescription.computeDynamicReferencesForProject(ProjectDescription.java:950)
at org.eclipse.core.internal.resources.ProjectDescription.getAllBuildConfigReferences(ProjectDescription.java:265)
at org.eclipse.core.internal.resources.ProjectDescription.getAllReferences(ProjectDescription.java:221)
at org.eclipse.core.internal.resources.Project.getReferencedProjects(Project.java:469)
at org.eclipse.ui.actions.CloseUnrelatedProjectsAction.buildConnectedComponents(CloseUnrelatedProjectsAction.java:78)
at org.eclipse.ui.actions.CloseUnrelatedProjectsAction.computeRelated(CloseUnrelatedProjectsAction.java:195)
at org.eclipse.ui.actions.CloseUnrelatedProjectsAction.getSelectedResources(CloseUnrelatedProjectsAction.java:211)
at org.eclipse.ui.actions.SelectionListenerAction.selectionIsOfType(SelectionListenerAction.java:240)
at org.eclipse.ui.actions.CloseResourceAction.updateSelection(CloseResourceAction.java:187)
at org.eclipse.ui.actions.BaseSelectionListenerAction.selectionChanged(BaseSelectionListenerAction.java:124)
at org.eclipse.ui.internal.navigator.resources.actions.ResourceMgmtActionProvider.updateActionBars(ResourceMgmtActionProvider.java:254)
at org.eclipse.ui.internal.navigator.resources.actions.ResourceMgmtActionProvider.fillActionBars(ResourceMgmtActionProvider.java:84)
at org.eclipse.ui.navigator.NavigatorActionService$3.run(NavigatorActionService.java:265)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.navigator.NavigatorActionService.fillActionBars(NavigatorActionService.java:258)
at org.eclipse.ui.navigator.CommonNavigatorManager$UpdateActionBarsJob$1.run(CommonNavigatorManager.java:95)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.navigator.CommonNavigatorManager$UpdateActionBarsJob.runInUIThread(CommonNavigatorManager.java:89)
at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4033)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3700)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1044)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
Contains: Missing com.google.appengine:appengine-api-1.0-sdk:jar:1.9.57
With the 179.0 version of the Google Cloud SDK installed, I now have App Engine 1.9.59 installed versus 1.9.57.
The Eclipse build path contains the following libraries:
App Engine Standard Runtime [App Engine Standard Runtime]
EAR Libraries
JRE System Library [JavaSE-1.8]
TestNG
Web App Libraries
I encounter this same problem with the following Eclipse releases:
4.7.0 (Build Id: 20170620-1800)
4.7.1a (Build Id: 20171005-1200)
The following is a list of errors my project now has:
RequestDispatcher cannot be resolved to a type
The project was not built since its build path is incomplete. Cannot find the class for javax.servlet.ServletContext. Fix the build path then try building this project
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
The type javax.servlet.ServletContext cannot be resolved. It is indirectly referenced from required .class files
Creating a new App Engine Standard Edition project as a Maven project specifies a dependency on the 1.9.57 version of the App Engine API.
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.9.57</version>
<scope>provided</scope>
</dependency>
Created issue #2754 for this problem on GitHub under the "GoogleCloudPlatform/google-cloud-eclipse" project.
https://github.com/GoogleCloudPlatform/google-cloud-eclipse/issues/2574
Version Information
Eclipse Oxygen.1a Release (4.7.1a Build: 20171005-1200)
Google Cloud Platform for Eclipse 4.5 and later 1.4.1.201710261936
Google Cloud SDK 179.0.0
alpha 2017.09.15
app-engine-java 1.9.59
app-engine-python 1.9.62
beta 2017.09.15
bq 2.0.27
core 2017.11.06
gcd-emulator v1beta3-1.0.0
gcloud
gsutil 4.28
kubectl
pubsub-emulator 2017.09.15
I don't know the exact cause of the problem, but rebooting my computer resolved the problem reported in this bug. In the course of trying to resolve this problem, I did stop and start Eclipse several times in an effort to address the problem. I started new terminal window sessions in an effort to fix the problem, but that didn't work.
After completely rebooting my machine, the problem reported in this bug went away.

Getting a java.util.nosuchelementexception error when launching GUI designer

I've created a new Codename One project. In the src folder I've created a Codename One Form:
image showing project hierarchy
When I right-click the form and select Codename One > GUI Builder I get this message:
null
java.util.NoSuchElementException
at java.util.StringTokenizer.nextToken(StringTokenizer.java:349)
at com.codename1.plugin.intellij.actions.GUIBuilderAction.actionPerformed(GUIBuilderAction.java:48)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:215)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:232)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:309)
at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:929)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:136)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:299)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:116)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:86)
at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:109)
at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:118)
at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:122)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:116)
at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:513)
at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:45)
at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:533)
at java.awt.Component.processMouseEvent(Component.java:6541)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6306)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4897)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4719)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4719)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:737)
at java.awt.EventQueue$4.run(EventQueue.java:735)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:827)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:651)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
The GUI Builder does not launch.
I'm using Java 8, a completely fresh install of IntelliJ IDEA 2017.1.1 with the Codename One plugin installed, version 3.6.0. And I can't find a single thing on the net to help me solve this. (I tested uninstalling the plugin and instead installing the previously available version, 3.5.3, nothing changed.)
Here's some more stats about my environment:
$ uname -a
Linux asus 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1+deb8u2 (2017-03-07) x86_64 GNU/Linux
$ cat /etc/debian_version
8.7
$ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
This appears to be a case of this issue. This has been fixed and should be part of the next plugin update on Friday.

GAE 500 server error

I'm developing app on GAE, I test the website locally fine however, every time I tried to deploy it to the GAE it reports with
Error: Server Error
The server encountered an error and could not complete your request.
Please try again in 30 seconds.
I searched a lot in google, seems no answer could solve my question. When I look for the log in the GAE app, following is the major problem I found so far. Initially, I thought it's due to JDK8 but when I set JDK8 I can't even run the app locally!
Uncaught exception from servlet
java.lang.UnsupportedClassVersionError: org/apache/jsp/index_jsp : Unsupported major.minor version 52.0
at com.google.appengine.runtime.Request.process-aea5c804a9f29902(Request.java)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:795)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.lang.ClassLoader.loadClass(ClassLoader.java:360)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
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:437)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:188)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)
at java.lang.Thread.run(Thread.java:724)
This is the telltale: Unsupported major.minor version 52.0. This happens when you compile on higher version JDK (52 = java8) and then execute it on lower JRE version (GAE uses java7).
GAE does not yet support Java8, so you should compile under Java7.
I had the same problem on Windows when Java 8 was installed.
I tried modifying the project/workspace settings but it didn't help me.
So, I created the following batch file as a workaround for GAE projects:
eclipse_gae.bat:
SET JAVA_HOME="C:\Program Files\Java\jdk1.7.0_55"
SET PATH="%JAVA_HOME%\bin"
START eclipse.exe
there is no need to fully remove Java 8 from MacOS. Just reconfigure Eclipse as shown here to force it to compile JSPs as Java 7:
http://java.wildstartech.com/Java-Platform-Standard-Edition/mac-os-x-java-development/how-to-configure-eclipse-to-run-with-java-7-when-java-8-is-installed
Make sure, that the version of Project Properties -> Project Facets -> Java is set to 1.7 and not to 1.8.
This is also nicely explained in the plugin's documentation section 'Changing the JDK Compliance Level'
I ran into a similar issue now. My setup is OS X + JDKs 6, 7 and 8, and in my eclipse.ini I had:
-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java
Apparently it will use that compiler no matter what you set in global/project preferences (I even removed JDK 8 from the Installed JRE list, no success).
Once I've changed that to use JDK 7 and redeployed my GAE app, it worked.
You have to compile with Java 1.7. But if you have *.jsp files, you should also completely remove Java 1.8 from the system. If you use Mac, here is how you can do it.
If you are using gradle (e.g. Android Studio) on a mac, you can work around this problem by adding the following lines to the top of your gradlew script:
# Insist on java 7
JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
Variations of this method should work on other platforms.
I'm sure this has been resolved, but here is the solution
GAE runs on java7 (as indicated by Mr. Knego) so maven must be compiling with java7. Do the following:
I prefer to do all this in the terminal
Edit bash profile:
touch ~/.bash_profile; open ~/.bash_profile
Set Java Home Directory
#set JAVA_HOME
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home
export JAVA_HOME
# For Apache Maven Commands
export M2_HOME=/Users/your-username/your/path/to/maven/apache-maven-3.3.3
export PATH=$PATH:$M2_HOME/bin
Navigate to your project folder (with pom.xml) and reinstall a clean version of maven
mvn clean install
Navigate to EAR or WAR directory and deploy with a new runtime
mvn appengine:update
If you are using endpoints, you should update your endpoint libraries

Updating Play app from JDK 6 to 7 on GAE

I have been developing a web app using play framework for a while (using eclipse). I was using Play 1.2.3 and JDK6 then I had to change my development environment (new pc) where I use JDK7.
My dependencies were:
require:
- play
- play -> crudsiena 2.0.1
- play -> siena 2.0.5
- play -> secure
- play -> gae 1.6
- provided -> opencsv 2.3
- provided -> ddlutils_siena 1.0
- provided -> gae_aws_sdk 1.1.7.1
#- provided -> play 1.2.4
#- provided -> httpclient 4.1.1
#- provided -> httpcore 4.1
repositories:
- provided:
type: local
artifact: "${application.path}/jar/[module]-[revision].jar"
contains:
- provided -> *
After the update I could not get the app running even on my localhost so I started the research. I found out the Play 1.2.3 does not support JDK7, so I changed to 1.2.4. Then I also updated the Siena version to 2.0.7 and I included the following line to my application.conf:
java.source=1.7
I even created a new project with play and copied the necessary files to the new project.
I set the proper JAVA_HOME environment variable. The application on my localhost is working fine. however when I update the version on Google App Engine I still get the following error:
Uncaught exception from servlet
java.lang.UnsupportedClassVersionError: controllers/Admin : Unsupported major.minor version 51.0
at com.google.appengine.runtime.Request.process-1921becf6a885374(Request.java)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:174)
at play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:118)
at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:401)
at play.Play.preCompile(Play.java:570)
at play.Play.init(Play.java:299)
at play.server.ServletWrapper.contextInitialized(ServletWrapper.java:77)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
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:452)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:459)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:701)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:336)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:328)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:456)
at java.lang.Thread.run(Thread.java:679)
I do realise that it has something to do with the transition from JDK6 to JDK7 however I have no more idea where else to look in order to get the app running on GAE. Additionally the compiler is set to 1.7 in eclipse.
Please help me sort this out with me.
To use Java on App Engine, you must use JDK 6:
https://developers.google.com/appengine/docs/java/overview
They have an issue for it, in their issue-tracker: http://code.google.com/p/googleappengine/issues/detail?id=6972
Sorry! But I think that you will have to change.
(Note that this is true for now. I suspect that the Google has some sort of upgrade plan, but I haven't heard any announcement of Java 7. They would probably have a limited "trusted tester" program for that, for a significant amount of time before general availability.)

java.lang.IncompatibleClassChangeError: Implementing class deploying to app engine

I wrote a couple of REST services using Jersey 1.13 on JRE 1.6. Everything runs fine locally, but after I deploy to GAE I get this error:
****Uncaught exception from servlet
java.lang.IncompatibleClassChangeError: Implementing class
at com.google.appengine.runtime.Request.process-139e1bda14d5aebc(Request.java)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:79)
at com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:104)
at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:78)
at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:89)
at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:700)
at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:678)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:203)
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:452)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:458)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:698)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:336)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:328)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:456)
at java.lang.Thread.run(Thread.java:679)****
Any help would be appreciated.
This exception is caused by compatibility issues between asm-4.0.jar and asm-3.1.jar. With the new Version of AppEngine, asm-4.0.jar is used and it is not compatible with Jersey, which relies on asm-3.1.jar. To make Jersey still work on GAE 1.7, you have to remove the dependency on asm-4.0.jar.
See this post : http://cloudvane.com/2012/09/23/problem-with-google-appengine-and-jersey-with-java/
It s tested and verified, like that:
add asm-3.3.1.jar to your war->lib
add it to you re build path
remove physically the asm-4.0.jar
Project -> Properties -> Google -> AppEngine: switch Datanuclueus to v1
That s it!
The instructions on this post took care of my problem.
Apparently the jersey-server 1.13 jar is compatible with asm3.1 and GAE 1.7.1 needs ASM 4.
Using the Jar repackaging tool jarjar you can deploy a asm 3.1 jar that will play with asm 4.
You may need to use JarJar version 1.3 if 1.4 gives an error message.
The new Jersey version 1.18.1 doens't depend on Asm 3, so it's compatible with GAE!
Maybe this will help: java.lang.IncompatibleClassChangeError: Implementing class Mongo
It's not exactly the same class, but the problem occurs when you have a library with 2 different version jars. Make sure you did not include any extra libraries or (I'll explain what happened to me):
You have A-1.0.jar and A-1.0.jar has inside another jar, let's say B-1.0.jar, but you have included separately a B-2.0.jar and in this way the two different version B jars are the problem.
Make sure you did not make this.
Same problem here, but I believe I've fixed it!
The trick was running a clean inside of eclipse, which notified me of the following error:
java.lang.RuntimeException: Unexpected exception
at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:76)
at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java:71)
at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:51)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:74)
... 2 more
Caused by: org.datanucleus.exceptions.NucleusUserException: You seem to have ASM v3 in the CLASSPATH and you need ASM v4
at org.datanucleus.enhancer.DataNucleusEnhancer.<init>(DataNucleusEnhancer.java:173)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1133)
... 7 more
The important bit . . .
Caused by: org.datanucleus.exceptions.NucleusUserException: You seem to have ASM v3 in the CLASSPATH and you need ASM v4
Apparently, GAE does not like having two versions of ASM loaded. On a whim, I went into the eclipse project properties and changed the datanucleus version from v2 to v1. I redeployed and now my app works. So much for catching these kinds of issues in the local dev environment . . .
I think I spent more time configuring GAE to run with jersey than I did actually writing the app. This may be my first and last GAE hosted app.
Did you update your App engine's SDK? (Recently the App engine SDK was updated from 1.7.0 to 1.7.1.)
Try to revert your app engine's SDK to 1.7.0. I have tried many solutions that I found on the Internet, none of them worked for me, but this one worked.
I have no idea how I can safely change my app engine project's sdk version for now. If anyone knows how to change the SDK version of the app, please let me know.
I got this error working on a maven project using Jersey-1.11 to develop a REST service:
cglib-3.0 depends on asm-4.0, and so I excluded it, leaving asm-3.0 to stand. This is because the Jersey version I am using uses asm-3.0.
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>3.0</version>
<exclusions>
<exclusion>
<artifactId>asm</artifactId>
<groupId>org.ow2.asm</groupId>
</exclusion>
</exclusions>
</dependency>
I changed the Persistence from JAP2 to JPA1 and it worked for me.

Resources