Giter Site home page Giter Site logo

vaadin / flow-spring-examples Goto Github PK

View Code? Open in Web Editor NEW
55.0 14.0 41.0 2.61 MB

Examples for Vaadin and Spring Boot

Home Page: https://vaadin.com/docs/flow/spring/tutorial-spring-basic.html

Java 79.93% JavaScript 10.06% HTML 5.08% TypeScript 4.94%
vaadin-spring spring-boot spring-application tutorial flow java webapp open-source

flow-spring-examples's Introduction

Flow Spring examples

This project contains the source code for the examples for using Vaadin and Spring together with the help of Spring Boot.

The tutorial can be found here.

The topics that are covered in this example project:

  • Getting Started with Vaadin Spring for Flow and Spring Boot: the initial @SpringBootApplication class.
  • Injection and Scopes with Vaadin Spring
  • Navigation with Vaadin Spring
  • Register VaadinServiceInitListener via the Spring DI mechanism
  • Flow template within Spring Boot application
  • Use I18N in Spring application

Running the project from command line

Run mvn clean install spring-boot:run in the project root directory. After the server has started point your browser to http://localhost:8080 to see the resulting application.

Running the project from your IDE

Navigate to the org.vaadin.spring.tutorial.TutorialApplication class and run it as a Java application.

flow-spring-examples's People

Contributors

caalador avatar dependabot[bot] avatar gilberto-torrezan avatar manolo avatar mstahv avatar pekam avatar pleku avatar samie avatar someonetoignore avatar tarekoraby avatar vaadin-bot avatar zhesun88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flow-spring-examples's Issues

Error when first trying to run application Main class

I tried to run this example and received the following error:

java.lang.IllegalArgumentException: Unsupported class file major version 59
	at net.bytebuddy.jar.asm.ClassReader.<init>(ClassReader.java:195) ~[byte-buddy-1.9.13.jar:na]
	at net.bytebuddy.jar.asm.ClassReader.<init>(ClassReader.java:176) ~[byte-buddy-1.9.13.jar:na]
	at net.bytebuddy.jar.asm.ClassReader.<init>(ClassReader.java:162) ~[byte-buddy-1.9.13.jar:na]
	at net.bytebuddy.jar.asm.ClassReader.<init>(ClassReader.java:283) ~[byte-buddy-1.9.13.jar:na]
	at com.vaadin.flow.server.frontend.scanner.FrontendAnnotatedClassVisitor.visitClass(FrontendAnnotatedClassVisitor.java:74) ~[flow-server-2.0.5.jar:2.0.5]
	at com.vaadin.flow.server.frontend.scanner.FrontendAnnotatedClassVisitor.visit(FrontendAnnotatedClassVisitor.java:85) ~[flow-server-2.0.5.jar:2.0.5]
	at net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:533) ~[byte-buddy-1.9.13.jar:na]
	at net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:400) ~[byte-buddy-1.9.13.jar:na]
	at com.vaadin.flow.server.frontend.scanner.FrontendAnnotatedClassVisitor.visitClass(FrontendAnnotatedClassVisitor.java:75) ~[flow-server-2.0.5.jar:2.0.5]
	at com.vaadin.flow.server.frontend.scanner.FrontendAnnotatedClassVisitor.visit(FrontendAnnotatedClassVisitor.java:85) ~[flow-server-2.0.5.jar:2.0.5]
	at net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:533) ~[byte-buddy-1.9.13.jar:na]
	at net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:400) ~[byte-buddy-1.9.13.jar:na]
	at com.vaadin.flow.server.frontend.scanner.FrontendAnnotatedClassVisitor.visitClass(FrontendAnnotatedClassVisitor.java:75) ~[flow-server-2.0.5.jar:2.0.5]
	at com.vaadin.flow.server.frontend.scanner.FrontendDependencies.computePackages(FrontendDependencies.java:374) ~[flow-server-2.0.5.jar:2.0.5]
	at com.vaadin.flow.server.frontend.scanner.FrontendDependencies.<init>(FrontendDependencies.java:152) ~[flow-server-2.0.5.jar:2.0.5]
	at com.vaadin.flow.server.frontend.NodeTasks.<init>(NodeTasks.java:315) ~[flow-server-2.0.5.jar:2.0.5]
	at com.vaadin.flow.server.frontend.NodeTasks.<init>(NodeTasks.java:41) ~[flow-server-2.0.5.jar:2.0.5]
	at com.vaadin.flow.server.frontend.NodeTasks$Builder.build(NodeTasks.java:147) ~[flow-server-2.0.5.jar:2.0.5]
	at com.vaadin.flow.server.startup.DevModeInitializer.initDevModeHandler(DevModeInitializer.java:238) ~[flow-server-2.0.5.jar:2.0.5]
	at com.vaadin.flow.spring.VaadinServletContextInitializer$DevModeServletContextListener.contextInitialized(VaadinServletContextInitializer.java:288) ~[vaadin-spring-12.0.3.jar:na]
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4680) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5143) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140) ~[na:na]
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140) ~[na:na]
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:932) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.apache.catalina.startup.Tomcat.start(Tomcat.java:456) ~[tomcat-embed-core-9.0.21.jar:9.0.21]
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:105) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:86) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:414) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:178) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.vaadin.spring.tutorial.TutorialApplication.main(TutorialApplication.java:17) ~[classes/:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.1.6.RELEASE.jar:2.1.6.RELEASE]

2021-07-02 21:02:42.576 ERROR 20988 --- [  restartedMain] o.apache.catalina.core.StandardContext   : One or more listeners failed to start. Full details will be found in the appropriate container log file
2021-07-02 21:02:42.576 ERROR 20988 --- [  restartedMain] o.apache.catalina.core.StandardContext   : Context [] startup failed due to previous errors
2021-07-02 21:02:42.629  INFO 20988 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2021-07-02 21:02:42.632  WARN 20988 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2021-07-02 21:02:42.639  INFO 20988 --- [  restartedMain] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-07-02 21:02:42.643 ERROR 20988 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:155) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.vaadin.spring.tutorial.TutorialApplication.main(TutorialApplication.java:17) ~[classes/:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.1.6.RELEASE.jar:2.1.6.RELEASE]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:124) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:86) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:414) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:178) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	... 13 common frames omitted
Caused by: java.lang.IllegalStateException: StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[] failed to start
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.rethrowDeferredStartupExceptions(TomcatWebServer.java:169) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:108) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
	... 18 common frames omitted

Could it be possible, that i have to change my java-version?
Thanks in advance for any help!

Application returns 404 after booting

Goal

My goal is to simply start the application on my machine and have a look at the frontend in the browser.

Issue

The application boots but the browser receives a 404 response on http://localhost:8080/
Maybe I am missing something, but I simply followed the steps written in the Readme and it does not start accordingly.
It looks like it starts an empty Spring application without any Vaadin views.

Steps to reproduce

  1. Clone the repo (default branch v23)
  2. Run mvn clean install spring-boot:run or run org.vaadin.spring.tutorial.TutorialApplication from within IntelliJ as stated in the Readme
  3. Wait a little
  4. Open a browser window and go to http://localhost:8080/

Browser output

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Tue Jan 31 10:54:16 CET 2023
There was an unexpected error (type=Not Found, status=404).
No message available

Console output

[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------< org.vaadin.spring:spring-flow-examples >---------------
[INFO] Building Spring Flow examples 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] >>> spring-boot-maven-plugin:2.6.6:run (default-cli) > test-compile @ spring-flow-examples >>>
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ spring-flow-examples ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO] 
[INFO] --- vaadin-maven-plugin:23.3.5:prepare-frontend (default) @ spring-flow-examples ---
[INFO] Reflections took 1362 ms to scan 125 urls, producing 5349 keys and 28262 values
[WARNING] 

**************************************************************************
*  Webpack related config file 'webpack.config.js' is detected in your   *
*  project while Vite is the default frontend build tool as of V23.2.0.  *
*  This warning is to prevent any confusion or any accidental            *
*  misconfiguration in webpack related config files while using Vite.    *
*  Apparently, the 'webpack.config.js' file in your project seems not to *
*  have any custom changes/configurations (it contains the default       *
*  content which is generated by Vaadin). Thus to be sure, you can first *
*  make a backup and then safely delete it to get rid of this warning.   *
*  If you are migrating from an earlier version and you are still unsure *
*  about using Vite, you can reactivate webpack via setting the          *
*  'com.vaadin.experimental.webpackForFrontendBuild=true' feature flag   *
*  in [project-root]/src/main/resources/vaadin-featureflags.properties   *
*  (you can create the file if not exists) and restart the application.  *
*  Using webpack with Vaadin applications is deprecated and the support  *
*  for reactivating it would be removed in the next major release.       *
**************************************************************************


[INFO] Copying frontend resources from jar files ...
[INFO] Visited 124 resources. Took 93 ms.
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ spring-flow-examples ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ spring-flow-examples ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /Users/[...]/flow-spring-examples/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ spring-flow-examples ---
[INFO] No sources to compile
[INFO] 
[INFO] <<< spring-boot-maven-plugin:2.6.6:run (default-cli) < test-compile @ spring-flow-examples <<<
[INFO] 
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.6.6:run (default-cli) @ spring-flow-examples ---
[INFO] Attaching agents: []
10:53:26.247 [Thread-0] DEBUG org.springframework.boot.devtools.restart.classloader.RestartClassLoader - Created RestartClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@5e121775

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.6.6)

2023-01-31 10:53:31.573  INFO 80637 --- [  restartedMain] o.v.spring.tutorial.TutorialApplication  : Starting TutorialApplication using Java 19.0.2 on MacBook-Pro.local with PID 80637 (/Users/[...]/flow-spring-examples/target/classes started by [...] in /Users/[...]/flow-spring-examples)
2023-01-31 10:53:31.574  INFO 80637 --- [  restartedMain] o.v.spring.tutorial.TutorialApplication  : No active profile set, falling back to 1 default profile: "default"
2023-01-31 10:53:31.683  INFO 80637 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2023-01-31 10:53:31.683  INFO 80637 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2023-01-31 10:53:32.655  INFO 80637 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-01-31 10:53:32.661  INFO 80637 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-01-31 10:53:32.662  INFO 80637 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.60]
2023-01-31 10:53:32.726  INFO 80637 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-01-31 10:53:32.726  INFO 80637 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1043 ms
2023-01-31 10:53:33.018  INFO 80637 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2023-01-31 10:53:33.042  INFO 80637 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2023-01-31 10:53:33.052  INFO 80637 --- [  restartedMain] o.v.spring.tutorial.TutorialApplication  : Started TutorialApplication in 6.792 seconds (JVM running for 7.228)
2023-01-31 10:54:09.637  INFO 80637 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-01-31 10:54:09.638  INFO 80637 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2023-01-31 10:54:09.642  INFO 80637 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 4 ms

System

  • macOS 13.1
  • IntelliJ IDEA 2022.3

Throuble with the new VAADIN 14 resource location

### ERROR when using vaadin 14 + spring boot 2 in Production MODE

IT seems SPRING can´t find CSS file in production.

2019-11-26 16:21:02.035 DEBUG 6944 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : GET "/frontend-es6/com/github/appreciated/app-layout/app-layout-styles-lumo.css", parameters={}
2019-11-26 16:21:02.035 DEBUG 6944 --- [nio-8080-exec-7] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to org.springframework.web.servlet.mvc.ServletForwardingController@1d97afdc
2019-11-26 16:21:02.051 DEBUG 6944 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : Completed 404 NOT_FOUND
2019-11-26 16:21:02.051 DEBUG 6944 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet : GET "/frontend-es6/com/github/appreciated/app-layout/left/left-responsive-hybrid.css", parameters={}
2019-11-26 16:21:02.051 DEBUG 6944 --- [nio-8080-exec-8] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to org.springframework.web.servlet.mvc.ServletForwardingController@1d97afdc
2019-11-26 16:21:02.067 DEBUG 6944 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet : Completed 404 NOT_FOUND

DOES NOT happens when using in DEBUG MODE

2019-11-26 17:32:38.367 DEBUG 6444 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet : GET "/frontend/com/github/appreciated/app-layout/app-layout-styles-lumo.css", parameters={}
2019-11-26 17:32:38.382 DEBUG 6444 --- [nio-8080-exec-2] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to org.springframework.web.servlet.mvc.ServletForwardingController@e31a27
2019-11-26 17:32:38.601 DEBUG 6444 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : GET "/frontend/com/github/appreciated/app-layout/left/left-responsive-hybrid.css", parameters={}
2019-11-26 17:32:38.601 DEBUG 6444 --- [nio-8080-exec-3] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to org.springframework.web.servlet.mvc.ServletForwardingController@e31a27
2019-11-26 17:32:38.679 DEBUG 6444 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet : Completed 200 OK
2019-11-26 17:32:38.710 DEBUG 6444 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : Completed 200 OK
@linspinho linspinho added the question label now

Flow + Spring + Polymer 3

Does Flow support Polymer 3? The current docs and this demo are all in Polymer 2, so I was wondering if this demo can be updated to a Polymer 3 example? What needs to be done for migration, if any?

PiT 24.2: usage of deprecated import in frontend code

Running the project there is an error in browser console

download project and run for production

git clone https://github.com/vaadin/flow-spring-examples.git
cd flow-spring-examples
mvn -B package -Pproduction 
java -jar target/*.jar

see browser's console error

The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information. - http://localhost:8080/VAADIN/build/generated-flow-imports-ef80aee5.js

ProductionMode build has an error on finding resource.

can be easily reproduced by running mvn install spring-boot:run -D vaadin.productionMode then navigate to localhost:8080.

There was an exception while trying to navigate to '' with the exception message 'Error creating bean with name 'org.vaadin.spring.tutorial.RootComponent': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'exampleTemplate' defined in file [C:\WorkFolder\flow-spring-tutorial\target\classes\org\vaadin\spring\tutorial\ExampleTemplate.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.vaadin.spring.tutorial.ExampleTemplate]: Constructor threw exception; nested exception is java.lang.IllegalStateException: Can't find resource 'frontend://ExampleTemplate.html' via the servlet context'

refresh the page, the app starts to work.

the ExampleTemplate.html is in ${project.basedir}/src/main/resources/META-INF/resources/frontend/.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.