Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Spring boot war #294

Open
jarkko-sokeila opened this issue Oct 19, 2019 · 6 comments
Open

Spring boot war #294

jarkko-sokeila opened this issue Oct 19, 2019 · 6 comments

Comments

@jarkko-sokeila
Copy link

  • OS: Windows
  • JDK version: 11
  • Gradle version: 5.6.3
  • Vaadin Plugin version: 1.3.beta1

I created vaadin 14 project with productionMode true and compatibilityMode false. When I run bootRun gradle task or run project in eclipse with spring tool suite 4 everything works fine. But when I build project and run war in command line I get this error

2019-10-19 12:07:56.510 ERROR 14032 --- [nio-8080-exec-6] c.v.flow.server.DefaultErrorHandler
java.lang.IllegalStateException: Couldn't find the definition of the element with tag 'hello-button' in any template file declared using '@jsmodule' annotations. Check the availability of the template files in your WAR file or provide alternative implementation of the method getTemplateContent() which should return an element representing the content of the template file

Is this bug in plugin or what I do wrong?

@jarkko-sokeila
Copy link
Author

Any comment why war/jar doesn't work?

@johndevs
Copy link
Member

johndevs commented Nov 7, 2019

Hi, could you try the latest beta version and see if you still get the same? (1.3.beta6)

@jarkko-sokeila
Copy link
Author

jarkko-sokeila commented Nov 8, 2019

Hi, same exception come with 1.3.beta6
What I do is I create project with vaadinCreateProject gradle task, then run bootRun task and everything works fine. But when I run build task and run generated war in command line I will get this error when I try to use example application. Full stack trace in file
My build.gradle looks like this

plugins {
id 'java'
id 'eclipse-wtp'
id 'war'
id 'org.springframework.boot' version '2.2.0.RELEASE'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
}

apply from: 'C:/gradle-vaadin-flow/local.plugin'

sourceCompatibility = 11.0

vaadin {
version = '14.0.11'
productionMode = true
compatibilityMode = false
}

vaadin.autoconfigure()

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
}

error.txt

@flefebure
Copy link

Hi John,

I 've made some comments in your #240 some monthes ago.

We are still in dev-mode. So packaging is not yet a priority. Anyway we keep an eye to your plugin. (but we a Maven comeback is still an option).
In the first 14x versions, Flow and its Maven plugin had bugs with Spring layout, but it has been corrected in september, in the 14.0.3, I think.
vaadin/flow#6306

Today I gave a try to your latest version 1.3.1.
So I converted my multimodule spring test project to Gradle
https://github.com/flefebure/flow-spring-examples

With Maven I can do without problem
mvn -PproductionMode clean package
java -jar ui-bootstrap/target/ui-bootstrap-1.0.0-SNAPSHOT.jar

With gradle there is problem with
gradle -PproductionMode clean bootWar
java -DproductionMode=true -jar ui-bootstrap/build/libs/ui-bootstrap-1.0.0-SNAPSHOT.war

Be sure that we will pay the plugin if it is useable.

Franck

@johndevs
Copy link
Member

johndevs commented Dec 9, 2019

Hi @flefebure

There was just some small changes that needed to be done, so I created a PR to fix your issues with your example Gradle project (flefebure/flow-spring-examples#1).

Since the project is using the NPM you will need a PRO subscription to build it.

@flefebure
Copy link

Thanks for your quick answer,

Yeah we are going to buy the pro

Just a question, I saw you moved the resources in src/main/[javascript|stylesheets]
But the Vaadin documentation says that resources are supposed to be located in src/main/resources/META-INF/resources/frontend

Actually, we are working using the embedded vaadin "webpack-dev-server"
After your PR, it looks that becomes impossible, may be due to theses resources locations change

You can try it by yourself by running "TutorialApplication" directly in Idea/Eclipse compare the current trunk with before the pr merge

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants