jiakuan / gwt-gradle-plugin

Gradle plugin to support GWT related tasks.
https://gwt-gradle.docstr.org
Other
66 stars 34 forks source link

Dev mode fails with NullPointerException in EclipseFileManager.concatFiles #41

Closed Hollerweger closed 3 years ago

Hollerweger commented 4 years ago

I get following Exception after running gwt dev mode and opening index_jsp:

   Module setup completed in 2205 ms

The code server is ready at http://127.0.0.1:9876/
2020-11-16 09:47:19 Compiler [ERROR] Javac exception 
Compile failed; see the compiler error output for details.
    at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:933)
    at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
       ....
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:748)

2020-11-16 08:51:39 Compiler [ERROR] Error compiling file: /C:/Users/martin/AppData/Local/Temp/1/jetty-127.0.0.1-8888-war-_-any-/jsp//org/apache/jsp\index_jsp.java     [javac] Compiling 1 source file
java.lang.NullPointerException
    at org.eclipse.jdt.internal.compiler.apt.util.EclipseFileManager.concatFiles(EclipseFileManager.java:204)
    at org.eclipse.jdt.internal.compiler.apt.util.EclipseFileManager.handleOption(EclipseFileManager.java:674)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.BatchProcessingEnvImpl.<init>(BatchProcessingEnvImpl.java:88)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.BatchAnnotationProcessorManager.configure(BatchAnnotationProcessorManager.java:69)
    at org.eclipse.jdt.internal.compiler.batch.Main.initializeAnnotationProcessorManager(Main.java:3966)
    at org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:4084)
    at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1689)
    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.jdt.core.JDTCompilerAdapter.execute(JDTCompilerAdapter.java:79)
    at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:931)
    at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:68)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:370)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:748)
> Task :gwt-project:gwtDev FAILED

This is my build.gradle setup:

plugins {
  id "org.wisepersist.gwt" version "1.1.10"
}

apply plugin: 'war'
apply plugin: 'gwt'

gwt {
    gwtVersion='2.7.0'
    logLevel = "INFO"
    modules "obfuscatedModule1", "obfuscatedModule2", "obfuscatedModule3"
            "com.googlecode.gxtforms.GXTForms"

    minHeapSize = "512M"
    maxHeapSize = "2048M"
}

compileJava.options.encoding = 'UTF-8'

dependencies {
    implementation project(":jpa")

    gwt group: 'com.extjs', name: 'gxt', version: '2.3.1a-gwt22'

    implementation group: 'commons-lang', name: 'commons-lang', version: '2.5'
    implementation group: 'org.imgscalr', name: 'imgscalr-lib', version: '4.2'
    implementation group: 'commons-fileupload', name: 'commons-fileupload', version: '1.2.2'
    implementation group: 'org.im4java', name: 'im4java', version: '1.4.0'
    implementation group: 'net.sf.jasperreports', name: 'jasperreports', version: '6.0.3'
    implementation group: 'net.sourceforge.cardme', name: 'cardme', version: '0.3.3'
    implementation group: 'com.googlecode.gwtupload', name: 'gwtupload', version: '0.6.4'
    implementation group: 'org.apache.pdfbox', name: 'pdfbox-app', version: '1.8.1'
}

Running on Windows 10 with Java 1.8.0.202 and gradle 6.7.

Is there something wrong in my build setup?

jiakuan commented 4 years ago

It seems the NPE was thrown while compiling the JSP, not sure if it’s related to the GWT plugin.

Also I noticed a very old GWT version is being used, perhaps try 2.9.0? (Although I don’t think it’s related to the NPE)

On Mon, 16 Nov 2020 at 4:51 pm, Martin notifications@github.com wrote:

I get following Exception after running gwt dev mode and opening index_jsp:

Module setup completed in 2205 ms

The code server is ready at http://127.0.0.1:9876/ 2020-11-16 http://127.0.0.1:9876/2020-11-16 09:47:19 Compiler [ERROR] Javac exception Compile failed; see the compiler error output for details. at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:933) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) .... at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:748)

2020-11-16 08:51:39 Compiler [ERROR] Error compiling file: /C:/Users/martin/AppData/Local/Temp/1/jetty-127.0.0.1-8888-war-_-any-/jsp//org/apache/jsp\index_jsp.java [javac] Compiling 1 source file java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.apt.util.EclipseFileManager.concatFiles(EclipseFileManager.java:204) at org.eclipse.jdt.internal.compiler.apt.util.EclipseFileManager.handleOption(EclipseFileManager.java:674) at org.eclipse.jdt.internal.compiler.apt.dispatch.BatchProcessingEnvImpl.(BatchProcessingEnvImpl.java:88) at org.eclipse.jdt.internal.compiler.apt.dispatch.BatchAnnotationProcessorManager.configure(BatchAnnotationProcessorManager.java:69) at org.eclipse.jdt.internal.compiler.batch.Main.initializeAnnotationProcessorManager(Main.java:3966) at org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:4084) at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1689) 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.jdt.core.JDTCompilerAdapter.execute(JDTCompilerAdapter.java:79) at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:931) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:68) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:370) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:748)

Task :gwt-project:gwtDev FAILED

This is my build.gradle setup:

plugins { id "org.wisepersist.gwt" version "1.1.10" }

apply plugin: 'war' apply plugin: 'gwt'

gwt { gwtVersion='2.7.0' logLevel = "INFO" modules "obfuscatedModule1", "obfuscatedModule2", "obfuscatedModule3" "com.googlecode.gxtforms.GXTForms"

minHeapSize = "512M"
maxHeapSize = "2048M"

}

compileJava.options.encoding = 'UTF-8'

dependencies { implementation project(":jpa")

gwt group: 'com.extjs', name: 'gxt', version: '2.3.1a-gwt22'

implementation group: 'commons-lang', name: 'commons-lang', version: '2.5'
implementation group: 'org.imgscalr', name: 'imgscalr-lib', version: '4.2'
implementation group: 'commons-fileupload', name: 'commons-fileupload', version: '1.2.2'
implementation group: 'org.im4java', name: 'im4java', version: '1.4.0'
implementation group: 'net.sf.jasperreports', name: 'jasperreports', version: '6.0.3'
implementation group: 'net.sourceforge.cardme', name: 'cardme', version: '0.3.3'
implementation group: 'com.googlecode.gwtupload', name: 'gwtupload', version: '0.6.4'
implementation group: 'org.apache.pdfbox', name: 'pdfbox-app', version: '1.8.1'

}

Running on Windows 10 with Java 1.8.0.202 and gradle 6.7.

Is there something wrong in my build setup?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jiakuan/gwt-gradle-plugin/issues/41, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAECF5DU2EWKKZNBW3X3SKTSQDRXLANCNFSM4TW4CSKQ .

Hollerweger commented 4 years ago

When I run war and deploy the war to a Tomcat then I see following error:

org.apache.catalina.LifecycleException: Failed to start component
Caused by: java.lang.NoClassDefFoundError: com/extjs/gxt/ui/client/data/BeanModelTag
org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive

Do I need to add the gxt client jar also as a normal dependency? I only have it in the gwt one: gwt group: 'com.extjs', name: 'gxt', version: '2.3.1a-gwt22'

Edit: This solved the issue in the compiled war. Still get same error when running in dev mode...

jiakuan commented 4 years ago

Looks like com/extjs/gxt/ui/client/data/BeanModelTag is used at runtime, so yes, the dependency needs to be available for compile and runtime.