I’ve the following, strange behaviour.
I launch my application from Eclipse and it works.
But if I restart Eclipse and launch my app I get an error :
Caused by: java.lang.IllegalStateException: Failed to determine project directory for dev mode. Directory ‘C:\Eclipse\eclipse’ does not look like a Maven or Gradle project. Ensure that you have run the prepare-frontend Maven goal, which generates ‘flow-build-info.json’, prior to deploying your application
at com.vaadin.flow.server.startup.DevModeInitializer.getBaseDirectoryFallback(DevModeInitializer.java:377)
at com.vaadin.flow.server.startup.DevModeInitializer.initDevModeHandler(DevModeInitializer.java:252)
at com.vaadin.flow.server.startup.DevModeInitializer.process(DevModeInitializer.java:211)
at com.vaadin.flow.server.startup.ClassLoaderAwareServletContainerInitializer.onStartup(ClassLoaderAwareServletContainerInitializer.java:76)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
Then I do again prepare frontend and everything works until next restart.
It should not be needed but apparently the project directory is incorrectly identified by the dev mode.
You may create a ticket about this.
As a workaround it should be possible to use the project.basedir property.
So if you run the project with the command line argument -Dvaadin.project.basedir=path_to_your_project then it should use the provided path as a project path.
I don’t think this is a project problem.
I think there is an issue in Flow code.
To be able to understand where the issue is please make a ticket here https://github.com/vaadin/flow/issues.
Please provide all the details to reproduce the issue.
As I said: try to use project.basedir property for workaround.
Tks for your help but I need to understand a little bit better.
I say there’s an issue in the flow code. do you mean in my flow code ?
If yes why when I prepare again the frontend it disappears ?
If you mean in the Vaadin Flow code why other projects I’ve with the same Vaadin version works normally ?
Tks
Tullio
If you mean in the Vaadin Flow code why other projects I’ve with the same Vaadin version works normally ?
Perfect question. That’s why this is not a conversation for the forum.
That’s why I ask you to make a ticket and provide all the details there to be able to identify the issue.
I face the same issue. Can I have the link to the issue to know if it is corrected or not ?
I confirm that adding the parameter “-Dvaadin.project.basedir=${project_loc:YOURPRJECT}” in to the VM args panel of the Tomcat server launch configuration works.