UnsupportedClassVersionError: com/google/apphosting/runtime/security/WhiteList : Unsupported major.minor version 51.0: com/google/apphosting/runtime/security/WhiteList

--- So at one point I had java 1.8 in use on this project file of mine.  I then removed java 1.8... going back to 1.7... and then added some google app engine stuff.  Anyway -- I now get this error above in my event log very very frequently.   Normally I'd just ignore it -- but I think that some other features are not being run -- because the thread that is getting that exception is bailing.  (most notably I seem to have out of date and obviosuly wrong inspection results frequently)....  

Anyway -- what is the best way to track down the 1.8 portion of the project file that is lingering around?  I've gone through all of the modules and made sure theya reusing the same version of java as the root project.. which is set to 1.7..  I've invalided caches and restarted...hmmm.. any other ideas?

6 comments

Do you see this error on TeamCity or in IntelliJ IDEA? In case of TeamCity as with any other CI server it is recommended to run some cleanup task before any other tasks in your build are performed. Chances are you have some class file left on the agent which was compiled under Java 1.8 and for some reason it is not re-compiled again in your build.

0

The error itself is being thrown by the app engine plugin..here is the full trace...  

com/google/apphosting/runtime/security/WhiteList : Unsupported major.minor version 51.0: com/google/apphosting/runtime/security/WhiteList : Unsupported major.minor version 51.0
java.lang.UnsupportedClassVersionError: com/google/apphosting/runtime/security/WhiteList : Unsupported major.minor version 51.0
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:471)
 at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:189)
 at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:185)
 at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:146)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:249)
 at com.intellij.appengine.sdk.impl.AppEngineSdkUtil.computeWhiteList(AppEngineSdkUtil.java:103)
 at com.intellij.appengine.sdk.impl.AppEngineSdkImpl.isClassInWhiteList(AppEngineSdkImpl.java:122)
 at com.intellij.appengine.inspections.AppEngineForbiddenCodeInspection$1.visitReferenceElement(AppEngineForbiddenCodeInspection.java:127)
 at com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl.accept(PsiJavaCodeReferenceElementImpl.java:949)
 at com.intellij.psi.impl.source.tree.SharedImplUtil.acceptChildren(SharedImplUtil.java:185)
 at com.intellij.psi.impl.source.JavaStubPsiElement.acceptChildren(JavaStubPsiElement.java:173)
 at com.intellij.psi.JavaRecursiveElementVisitor.visitElement(JavaRecursiveElementVisitor.java:55)
 at com.intellij.psi.JavaElementVisitor.visitImportStatement(JavaElementVisitor.java:144)
 at com.intellij.psi.impl.source.PsiImportStatementImpl.accept(PsiImportStatementImpl.java:52)
 at com.intellij.psi.impl.source.tree.SharedImplUtil.acceptChildren(SharedImplUtil.java:185)
 at com.intellij.psi.impl.source.JavaStubPsiElement.acceptChildren(JavaStubPsiElement.java:173)
 at com.intellij.psi.JavaRecursiveElementVisitor.visitElement(JavaRecursiveElementVisitor.java:55)
 at com.intellij.psi.JavaElementVisitor.visitImportList(JavaElementVisitor.java:140)
 at com.intellij.psi.impl.source.PsiImportListImpl.accept(PsiImportListImpl.java:171)
 at com.intellij.psi.impl.source.tree.SharedImplUtil.acceptChildren(SharedImplUtil.java:185)
 at com.intellij.psi.impl.source.PsiFileImpl.acceptChildren(PsiFileImpl.java:798)
 at com.intellij.psi.JavaRecursiveElementVisitor.visitElement(JavaRecursiveElementVisitor.java:55)
 at com.intellij.psi.PsiElementVisitor.visitFile(PsiElementVisitor.java:32)
 at com.intellij.psi.JavaElementVisitor.visitJavaFile(JavaElementVisitor.java:328)
 at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.accept(PsiJavaFileBaseImpl.java:411)
 at com.intellij.appengine.inspections.AppEngineForbiddenCodeInspection.checkFile(AppEngineForbiddenCodeInspection.java:60)
 at com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool$1.visitFile(AbstractBaseJavaLocalInspectionTool.java:98)
 at com.intellij.psi.JavaElementVisitor.visitJavaFile(JavaElementVisitor.java:328)
 at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.accept(PsiJavaFileBaseImpl.java:411)
 at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:74)
 at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$5.process(LocalInspectionsPass.java:382)
 at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass$5.process(LocalInspectionsPass.java:377)
 at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:119)
 at com.intellij.concurrency.ApplierCompleter.access$000(ApplierCompleter.java:42)
 at com.intellij.concurrency.ApplierCompleter$1.run(ApplierCompleter.java:82)
 at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1166)
 at com.intellij.concurrency.ApplierCompleter$2.run(ApplierCompleter.java:91)
 at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
 at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
 at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:103)
 at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:79)
 at jsr166e.CountedCompleter.exec(CountedCompleter.java:684)
 at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
 at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
 at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
 at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
 at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)

0

I can work around it by disabling that particular inspection... "Forbidden code in App engine applications"...      but that is a useful inspection!

0

Thanks for this tip! Helpful to avoid seeing hundreds of IntelliJ errors over short period of time. I will disable whitelist class for now and leave the inspection to "myself" during coding...until this issue is resolved at least.

0

+1: I am waiting for a solution as well - I have the same error:
14:01:55 UnsupportedClassVersionError: com/google/apphosting/runtime/security/WhiteList : Unsupported major.minor version 51.0: com/google/apphosting/runtime/security/WhiteList : Unsupported major.minor version 51.0

0

Please sign in to leave a comment.