Type Exception Report
Message Servlet.init() for servlet [com.vaadin.flow.server.startup.ServletDeployer]
threw exception
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
javax.servlet.ServletException: Servlet.init() for servlet [com.vaadin.flow.server.startup.ServletDeployer]
threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:748)
Root Cause
java.lang.NoSuchMethodError: org.apache.commons.io.IOUtils.toString(Ljava/io/InputStream;Ljava/nio/charset/Charset;)Ljava/lang/String;
com.vaadin.flow.server.startup.BundleFilterFactory.readBundleManifest(BundleFilterFactory.java:98)
com.vaadin.flow.server.startup.BundleFilterFactory.createBundleFilterForBrowser(BundleFilterFactory.java:79)
com.vaadin.flow.server.startup.BundleFilterFactory.createFilters(BundleFilterFactory.java:70)
com.vaadin.flow.server.VaadinService.init(VaadinService.java:275)
com.vaadin.flow.server.VaadinServlet.createServletService(VaadinServlet.java:201)
com.vaadin.flow.server.VaadinServlet.createServletService(VaadinServlet.java:182)
com.vaadin.flow.server.VaadinServlet.init(VaadinServlet.java:72)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:748)
Something similar happens with jetty:run-exploded -Pproduction as well, so it does not seem to be just a tomcat issue. Obviously, Jetty reports the issue in a different place, but same basic idea.
HTTP ERROR 500
Problem accessing /. Reason:
Server Error
Caused by:
java.lang.NullPointerException
at com.vaadin.flow.server.VaadinServlet.serveStaticOrWebJarRequest(VaadinServlet.java:271)
at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:229)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:873)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1623)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:214)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1701)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1668)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:502)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:132)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
at java.lang.Thread.run(Thread.java:748)
Powered by Jetty:// 9.4.15.v20190215
It looks like that you could have multiple versions of commons-io in your dependencies (via transitive dependencies). I recall that for example Vaadin 7 version of the Vaadin Charts add-on is using older version of commons-io than is used in Flow and MPR. So then you need to modify your charts dependency e.g.
And the new POM sections. I commented out testbench entirely because I don’t really use it:
...
<dependency>
<groupId>com.vaadin.addon</groupId>
<artifactId>vaadin-charts</artifactId>
<version>3.2.0</version>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
...
<!-- TODO: implement when ready to use for real
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-testbench</artifactId>
<version>4.0.3</version>
<scope>test</scope>
</dependency>
-->
...
<dependency>
<groupId>org.peimari</groupId>
<artifactId>maddon</artifactId>
<version>1.15</version>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- TODO: replace maddon with viritin
<dependency>
<groupId>org.vaadin</groupId>
<artifactId>viritin</artifactId>
<version>1.62</version>
</dependency>
-->
...
Note that the reason I chose the above exlusions was because the errors are occurring inside flow, so I figured I better give flow the preference. Not sure I made the right decision, but it seems logical to me. Anyway, this gives the following exception.
[INFO]
Restart completed.
[WARNING]
/
java.lang.NoSuchMethodError: org.apache.commons.io.IOUtils.toString(Ljava/io/InputStream;Ljava/nio/charset/Charset;)Ljava/lang/String;
at com.vaadin.flow.server.startup.BundleFilterFactory.readBundleManifest(BundleFilterFactory.java:98)
at com.vaadin.flow.server.startup.BundleFilterFactory.createBundleFilterForBrowser(BundleFilterFactory.java:79)
at com.vaadin.flow.server.startup.BundleFilterFactory.createFilters(BundleFilterFactory.java:70)
at com.vaadin.flow.server.VaadinService.init(VaadinService.java:275)
at com.vaadin.flow.server.VaadinServlet.createServletService(VaadinServlet.java:201)
at com.vaadin.flow.server.VaadinServlet.createServletService(VaadinServlet.java:182)
at com.vaadin.flow.server.VaadinServlet.init(VaadinServlet.java:72)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:671)
at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:520)
at org.eclipse.jetty.servlet.ServletHolder.prepare(ServletHolder.java:811)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:537)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1701)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1668)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:502)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
at java.lang.Thread.run(Thread.java:748)
And here is everything before just for comparison:
[INFO]
Scanning for projects...
[INFO]
[INFO]
---------------------< com.mobiwms:vaadinwebsite >----------------------
[INFO]
Building vaadinwebsite 5.0.master-mpr
[INFO]
--------------------------------[ war ]
---------------------------------
[INFO]
[INFO]
--- maven-dependency-plugin:2.8:tree (default-cli) @ vaadinwebsite ---
[INFO]
com.mobiwms:vaadinwebsite:war:5.0.master-mpr
[INFO]
+- com.vaadin:vaadin-core:jar:13.0.8:compile
[INFO]
| \- com.vaadin:flow-server:jar:1.4.5:compile
[INFO]
| \- (commons-io:commons-io:jar:2.5:compile - omitted for conflict with 1.4)
[INFO]
+- com.vaadin:mpr-v7:jar:1.2.0:compile
[INFO]
| \- com.vaadin:mpr-core:jar:1.2.0:compile
[INFO]
| \- (commons-io:commons-io:jar:2.5:compile - omitted for duplicate)
[INFO]
+- com.vaadin.addon:vaadin-charts:jar:3.2.0:compile
[INFO]
| \- commons-io:commons-io:jar:1.4:compile
[INFO]
+- com.vaadin:vaadin-testbench:jar:4.0.3:test
[INFO]
| \- com.vaadin:vaadin-testbench-core:jar:6.0.1:test (version managed from 4.0.3)
[INFO]
| \- org.seleniumhq.selenium:selenium-server:jar:3.11.0:test
[INFO]
| +- (commons-io:commons-io:jar:2.6:test - omitted for conflict with 1.4)
[INFO]
| \- net.sourceforge.htmlunit:htmlunit:jar:2.29:test
[INFO]
| \- (commons-io:commons-io:jar:2.6:test - omitted for conflict with 1.4)
[INFO]
\- org.peimari:maddon:jar:1.15:compile
[INFO]
\- (commons-io:commons-io:jar:2.4:compile - omitted for conflict with 1.4)
[INFO]
------------------------------------------------------------------------
[INFO]
BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO]
Total time: 7.490 s
[INFO]
Finished at: 2019-06-25T13:31:40-04:00
[INFO]
------------------------------------------------------------------------
And here is the corresponding POM sections, once again before changes:
Changing to 13.0.9 and flow version 1.4.6 fixed it for me, it at least runs in jetty now. I did have to do a clean first. There is another problem, but it is not related to this exception.