You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Out of the box, Spring Boot uses a public static void main entry-point that launches an embedded web tomcat server packaged into the .war file, thus running java -jar target/my-app.war launches the app. Tough, flow seems unable to find resources packaged into the .war file. The same war deployed in a tomcat works as expected.
You can reproduce e.g. by checking out bakery and packaging it:
I'm facing the same error when I changed the packaging to jar with Spring Boot 2.0,
it's running fine with error in console when I use
mvn spring-boot:run
but when I use:
java -jar target/bakery-app.jar
I got the following exception error
ERROR 3103 --- [nio-8002-exec-2] c.v.flow.router.InternalServerError : There was an exception while trying to navigate to 'login'
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.thalesgroup.ife.dutyfree.dutyfreeframework.ui.views.login.LoginView': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.thalesgroup.ife.dutyfree.dutyfreeframework.ui.views.login.LoginView]: Constructor threw exception; nested exception is java.lang.IllegalStateException: Can't find resource 'frontend://src/views/login/login-view.html' via the servlet context
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1232) ~[spring-beans-5.0.4.RELEASE.jar!/:5.0.4.RELEASE]
I just ran into this as well. This is the default behavior when you deploy to AWS Beanstalk. But what AWS does by default is rename your WAR file to "application.jar" and then executes "java -jar application.jar". Took me half a day to figure out renaming the WAR to JAR breaks everything. I had simple views before, but now that I'm including HTML in the views I'm seeing the same errors. I will change my deployment package to execute the WAR with mvn spring-boot:run until there is fix.
Current version of our spring starter pack has the resources by default in the wrong directory:
the resources are in src/main/webapp while they should be in src/main/resources/static/
To workaround this problem you can move the resources to the correct directory src/main/resources/static/ and make the following changes to your pom.xml
@manolo commented on Mon Mar 12 2018
Out of the box, Spring Boot uses a public static void main entry-point that launches an embedded web tomcat server packaged into the
.war
file, thus runningjava -jar target/my-app.war
launches the app. Tough, flow seems unable to find resources packaged into the.war
file. The same war deployed in a tomcat works as expected.You can reproduce e.g. by checking out bakery and packaging it:
The error in console is:
Can't find resource 'frontend://src/views/login/login-view.html' via the servlet context'
@deyaeddin commented on Sat Mar 24 2018
I'm facing the same error when I changed the packaging to jar with Spring Boot 2.0,
it's running fine with error in console when I use
but when I use:
I got the following exception error
@docwho2 commented on Mon Mar 26 2018
I just ran into this as well. This is the default behavior when you deploy to AWS Beanstalk. But what AWS does by default is rename your WAR file to "application.jar" and then executes "java -jar application.jar". Took me half a day to figure out renaming the WAR to JAR breaks everything. I had simple views before, but now that I'm including HTML in the views I'm seeing the same errors. I will change my deployment package to execute the WAR with mvn spring-boot:run until there is fix.
@Legioth commented on Wed Mar 28 2018
Similar messages also observed with
mvn spring-boot:run
for thevaadin_push.zip
project referenced in vaadin/flow#3738 (comment).The text was updated successfully, but these errors were encountered: