Tomcat failed to start: SpringBoot + Vaadin 14 npm mode + gradle

Hello, I am migrating projects from Vaadin 13 to Vaadin 14.

Tech. stack: Java 8, Gradle, SpringBoot

In compatibility mode everything works fine, but I want to migrate to npm mode.

./gradlew bootRun - command works fine and application starts (if I have npm + NodeJS installed on my local machine)

When I try to build JAR file, (./gradlew build) it writes me, that BUILD SUCCESSFUL, but when I try to start application using this generated JAR file, it crashes with:

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:/home/user/Development/composer/build/libs/composer-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/atmosphere-runtime-2.4.30.slf4jvaadin1.jar!/org/atmosphere/inject/AtmosphereRequestIntrospector.class]
; nested exception is java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy

So I have a few questions:

  1. How to build JAR file using SpringBoot + Gradle + NPM mode?
  2. Is it possible to make it work without having NPM + NodeJS installed globally? (we are using separate server to build and deploy our applications and it will be complicated to install other software globally on this server, because of security policies, so maybe there is a way to install)
  3. Maybe there is already some gradle plugin with “prepare-frontend” task?

Output of application startup and my build.gradle files you can find in attachments.
17830620.gradle (1012 Bytes)
17830623.log (17.5 KB)

You might want to follow this Vaadin Flow Gradle Plugin issue: https://github.com/devsoap/gradle-vaadin-flow/issues/240

Olli Tietäväinen:
You might want to follow this Vaadin Flow Gradle Plugin issue: https://github.com/devsoap/gradle-vaadin-flow/issues/240

Thank you, I am already following this issue.

Just was wondering if someone have similar tech. stack and already found “fast-hack” solution.

I am having the same problem.

Is there currently a way to build an executable Jar in Vaadin 14.0.3 NPM Mode with Gradle and Spring Boot without any extra Vaadin Plugin (as it is not ready yet)?

I got the same stack as you and I don’t really understand why Vaadin still doesn’t have built-in Gradle support. There is only a 3rd party plugin which in not even free for Vaadin 14.
No examples on Vaadin website, no Vaadin docs, no “starter apps”, nothing.
Can we get any official Vaadin position on supporting Gradle?

Jonas TM:
I am having the same problem.

Is there currently a way to build an executable Jar in Vaadin 14.0.3 NPM Mode with Gradle and Spring Boot without any extra Vaadin Plugin (as it is not ready yet)?

I am having the same issue while migrating to vaadn 14.0.10.

Now that the Dev Soap/John Ahlroos Plugin is commercial (10$ per License and Month) it is really time for offical Gradle support from Vaadin. With a Vaadin 8 gradle project you now have to choose to pay a additional charge to fully use Vaadin 14 or drop Vaadin or Gradle. It’s a very annoying situation.

The commercialisation of the Gradle plugin is litterally a slap in the face of the Vaadin customers because last year with Vaadin 11 it was declared that Vaadin now has “offical” support for Gradle and development of the Gradle plugin was sponsored by Vaadin.

Apologies for the confusion of the situation. We just ended our negotiations with John who has maintained the plugin so far.

We decided that Vaadin will take over development and maintenance of the plugin and that it will continue to be available for free.

We are still organizing around this decision internally, but are planning to release the latest plugin version for free shortly.

That are terrific news!

I probably need to clarify a bit what Niko means here as I feel it is not really the whole truth.

Vaadin has decided to no longer support the Gradle plugin by Devsoap due to the fact that I (the author) wanted to provide a subscription model for the plugin users and provide the community with commercial content. Vaadin does not want other in the community to provide commercial services or products, rather provide all of them itself (as paid PRO features) and only allow the community to provide FREE plugins itself can use vie its own directory store.

So to clarify, there has been no hand-off of the plugin to Vaadin of any kind. Vaadin has decided to take that into its own hands.

This won’t effect however the Devsoap plugin in any way. I will continue to provide updates and new releases to the plugin in the future as well just as before. The plugin has transitioned to a Creative Commons license (https://devsoap.com/product-licensing-changing-to-creative-commons/) to ensure the the project can continue as usual, all new features will be under that license.

It saddens me to see this kind of false information coming out of Vaadin, the company sure has changed over the years (and not in a good way).

Just my personal opinion (I haven’t been part of any of the discussions or decisions about this), but I don’t think Vaadin wants to remove all other commercial products around Vaadin from the market. The case here is rather that Vaadin sees Gradle support as something that should be free, and that comes through the community comments in this thread as well (only a small sample of course). Also, I think Vaadin feels the development and maintenance of the Gradle support can’t be left for the community at this point, it would not progress fast enough.

Not a redeeming observation by any means, but this is what Apple is always doing: taking a thing the community has been making a business with for a while and making it part of their free offering. That doesn’t always kill the community/commercial offering. They might still have additional value over the one that Apple is providing for free.

Since I wrote the plugin for Vaadin 6 and maintained it through 7,8,10,11,12,13 and 14 the plugin has over the years always been free for the community to use. To this day, the Vaadin 8 plugin has never been sponsored by Vaadin in any way.

I am, and will always be a strong believer of keeping things available for the community.

But until this date, Vaadin has also never contributed to the Gradle plugin while for the Vaadin 8 plugin the community has majorly stepped up and provided pull requests and issues. That is why that plugin still is not under the DS PRO subscription and never will be.

If Gradle support has been deemed so vital and so urgent for Vaadin’s success where are all the pull requests from Vaadin fixing the issues Vaadin have broken over the years? To this date there is not a single commit in the repository for the Vaadin Flow plugin from Vaadin, instead Vaadin has continued to break stuff in the framework and assumed the community will fix them for free. So, the only assumption I can make is that Vaadin is not really interested in working with the community, rather taking into use successful projects by the community for its own uses (free or not). Basically leveraging the communities work for free. Who will want to contribute addons to the Directory for example if everyone has to worry about Vaadin sweeping in once an addon becomes popular?

I’m sorry Jouni, I know many at Vaadin are good people, but I don’t really buy your argument. If what you are saying is true then Niko would have just came out saying that instead of morphing the truth into something that was not agreed.

The formulation of my post was sloppy.

We (as in Vaadin) decided to invest in the development and maintainenance of the plugin, to ensure support for V14 for free. We will do this by forking the existing implementation.

Is there some kind of timetable for the release of the new “official” vaadin gradle plugin with NPM supports?

Our target is to release a free MVP add-on around the time of Vaadin 14.1 release (December 4th). That will be based on the existing implementation, supplemented with documentation.

Bug fixes, adding missing features, proper documentation to Vaadin/docs, app examples to Vaadin web page, and all other standard development and maintenance will be started sometime early next year.

Päivi Soinio:
Our target is to release a free MVP add-on around the time of Vaadin 14.1 release (December 4th). That will be based on the existing implementation, supplemented with documentation.

What is the current status of the Plugin? (As it was not released today with Vaadin 14.1)

Jonas TM:

What is the current status of the Plugin? (As it was not released today with Vaadin 14.1)

Hi! We have about finished the initial version of the free Vaadin Gradle Plugin, including basic documentation. It just needs some review and then we’ll look into publishing it, and also make the repository available. As Friday is a holiday in Finland, it might go to next week.

Currently, the only major issue is support for Gradle 6, which we won’t include in this initial release.

There’s some more work to be done with the initial release, so it probably goes at least to next week.

Is there any update regarding the plugin?

Martin Grzenia:
Is there any update regarding the plugin?

Hi, looks like we didn’t mention it in this thread, but we made a prerelease in December and made the repository public. Please see https://github.com/vaadin/vaadin-gradle-plugin/ .

The plugin is not yet in the Gradle’s plugin repository and the dependencies need to be given explicitly, so there’s a bit more boilerplate, but otherwise it seems to work. Only Gradle 5.6.4 is supported in the prerelease; 6 is not yet, and maybe we try to support that before the final release.