运行 Java IntelliJ 2017.2.2 预发布下的 Vaadin 8.1 应用程序

Run Vaadin 8.1 app under Java 9 prerelease in IntelliJ 2017.2.2

在 IntelliJ 2017.2.2 中,我能够 运行 Vaadin 8.1.2 应用程序(全新的 vaadin-archetype-application 原型)Tomcat 8.5.20 在 Java 9+181 如果 Project Structure > Project SDK 设置为 Java 1.8。

如果 Project Structure > Project SDK 设置为 Java 9 我在 FillIn 附近收到此编译器错误,断言错误与 filling 有关Vaadin 鼠标事件。我试过谷歌搜索但没有找到任何线索。

Information:java: An exception has occurred in the compiler (9). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
Information:java:   at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:340)
Information:java:   at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:285)
Information:java:   at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:633)
Information:java:   at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1314)
Information:java:   at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.flags(Symbol.java:1248)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve.isAccessible(Resolve.java:405)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve.isAccessible(Resolve.java:389)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve.findImmediateMemberType(Resolve.java:2170)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMemberType(Resolve.java:2225)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve.findIdentInType(Resolve.java:2403)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.selectSym(Attr.java:3588)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3453)
Information:java:   at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2104)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:653)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attribType(Attr.java:713)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attribType(Attr.java:706)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attribBase(Attr.java:859)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$AbstractHeaderPhase.attribSuperTypes(TypeEnter.java:669)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$HierarchyPhase.runPhase(TypeEnter.java:742)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.doCompleteEnvs(TypeEnter.java:270)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$HierarchyPhase.complete(TypeEnter.java:785)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$HierarchyPhase.doCompleteEnvs(TypeEnter.java:730)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:245)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:254)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.TypeEnter.complete(TypeEnter.java:195)
Information:java:   at jdk.compiler/com.sun.tools.javac.code.Symbol.isInterface(Symbol.java:393)
Information:java:   at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readMethod(ClassReader.java:2353)
Information:java:   at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:2641)
Information:java:   at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassBuffer(ClassReader.java:2706)
Information:java:   at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:2719)
Information:java:   at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:348)
Information:java:   at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.complete(Type.java:1139)
Information:java:   at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.getTypeArguments(Type.java:1065)
Information:java:   at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.isErroneous(Type.java:1095)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Check.checkNonCyclicInternal(Check.java:2316)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Check.checkNonCyclicInternal(Check.java:2327)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Check.checkNonCyclicInternal(Check.java:2330)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Check.checkNonCyclicInternal(Check.java:2323)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Check.checkNonCyclic(Check.java:2277)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.checkBase(Attr.java:901)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attribBase(Attr.java:860)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:577)
Information:java:   at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:554)
Information:java:   at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1052)
Information:java:   at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:923)
Information:java:   at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall[=12=](JavacTaskImpl.java:100)
Information:java:   at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142)
Information:java:   at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96)
Information:java:   at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90)
Information:java:   at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:190)
Information:java:   at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:473)
Information:java:   at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:328)
Information:java:   at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:255)
Information:java:   at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:208)
Information:java:   at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1260)
Information:java:   at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:937)
Information:java:   at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1009)
Information:java:   at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:900)
Information:java:   at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:733)
Information:java:   at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:385)
Information:java:   at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:192)
Information:java:   at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138)
Information:java:   at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:295)
Information:java:   at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125)
Information:java:   at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0[=12=](BuildMain.java:236)
Information:java:   at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread[=12=](SharedThreadPoolImpl.java:42)
Information:java:   at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
Information:java:   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
Information:java:   at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
Information:java:   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
Information:java:   at java.base/java.lang.Thread.run(Thread.java:844)
Information:java: Errors occurred while compiling module 'vnine'
Information:javac 9 was used to compile java sources
Information:Module "vnine" was fully rebuilt due to project configuration/dependencies changes
Information:2017-08-18, 15:40 - Compilation completed with 2 errors and 0 warnings in 1s 866ms
Error:java: java.lang.AssertionError: Filling jar:file:///Users/basilbourque/.m2/repository/com/vaadin/vaadin-server/8.1.2/vaadin-server-8.1.2.jar!/com/vaadin/ui/Component$Event.class during JarFileObject[/Users/basilbourque/.m2/repository/com/vaadin/vaadin-server/8.1.2/vaadin-server-8.1.2.jar:/com/vaadin/event/MouseEvents$ClickEvent.class]
Error:java:     at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:162)

那么,两个问题:

内嵌为时间线

  • 在我使用全新的未修改 Vaadin 应用程序 Maven 原型的情况下,问题可能是什么?

为了具体找出您案例的根本原因,我们肯定需要您在代码定义方面尝试的更多详细信息。

  • IntelliJ + Vaadin + Tomcat 可以在 Java 9 下工作吗?*

On 22 August 2017

。你可以使这个特定的组合起作用。在解决了我 的问题后,我终于可以使用 mvn package 到 运行 使用 tomcat 创建 war。

详情:您需要使用 Java 9 兼容版本的 Tomcat。 (apache-tomcat-9.0.0.M26 在我的例子中)并将其配置为以

开头

Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/

服务器启动后,您可以访问应用程序@ localhost:8080/vaadinjavanine/,其中 vaadinjavanine 是我的 tomcat 中的 war 文件名的 webapps 文件夹。

On 21 August 2017

遗憾的是,具体到组合的答案仍然是。我相信还不可能使这种组合起作用。

码头服务器

这是我更新的 sample application 在我的 localhost:8080 上与 IntelliJ + Vaadin + Jetty 一起工作使用 Jetty 服务器,无论我的项目 SDK 设置为 Java1.8 还是 Java9。它的工作原理是这样的:

这是在克服 #jetty.project/1758 by upgrading to the 6.0_BETA of asm and asm-commons libraries and using the custom 9.4.7-SNAPSHOT built on my local used in the project(commit - #e34415 之后获得的。)

Tomcat服务器

  1. 按照创建 war 的推荐方法,我使用以下命令创建了应用程序 war(在我的例子中是 <finalName>vaadinjavanine</finalName>):

    mvn package
    
  2. 确保 CATALINA_HOME/webapps 包含此文件。基本复制了。

  3. 在默认端口上启动 tomcat 以访问应用程序的 url:localhost:8080/vaadinjavanine/

但最终在当前链中发现了另一个问题:


On 20 August 2017

问题的答案是。 我所做的是,在 getting started guide 之后,尝试从头开始创建基于 java9 的基于 maven 的 vaadin 应用程序。使用以下配置:

apache-tomcat-8.0.22 

intelliJ-IDEA 2017.2.2

<vaadin.version>8.1.2</vaadin.version>

Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T01:09:06+05:30)
Maven home: /usr/local/Cellar/maven/3.5.0/libexec
Java version: 9, vendor: Oracle Corporation (jdk-9+181)

使用共享指南中共享的 vaadin-archetype-application 创建了一个 Maven 模块。已更新

  1. pom.xml 与

    <maven.compiler.source>1.9</maven.compiler.source>
    <maven.compiler.target>1.9</maven.compiler.target>
    
  2. 在开发中的模块中添加了一个module-info.java

我能够同时执行 mvn package 但是 运行ning mvn jetty:run 到 运行 应用程序最终实现了 MultiException | java.lang.RuntimeException: Error scanning UI and Servlet class