question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Starting a Wildfly after a Eclipse-Restart causes Vaadin to generate Files in the Wildfly-bin folder

See original GitHub issue

Description of the bug

I noticed recently that after a eclipse start I always have to do a vaadin:prepare-frontend or similar to get my Wildfly with Vaadin working, else it crashes with:

Log (click to toggle)

...
11:55:20,025 INFO  [com.vaadin.cdi.VaadinExtension] (MSC service thread 1-3) VaadinServiceScopedContext registered for Vaadin CDI
11:55:20,025 INFO  [com.vaadin.cdi.VaadinExtension] (MSC service thread 1-3) VaadinSessionScopedContext registered for Vaadin CDI
11:55:20,025 INFO  [com.vaadin.cdi.VaadinExtension] (MSC service thread 1-3) UIScopedContext registered for Vaadin CDI
11:55:20,025 INFO  [com.vaadin.cdi.VaadinExtension] (MSC service thread 1-3) RouteScopedContext registered for Vaadin CDI
11:55:20,344 INFO  [io.undertow.servlet] (ServerService Thread Pool -- 78) Initializing AtmosphereFramework
11:55:20,348 INFO  [com.vaadin.cdi.CdiServletDeployer] (ServerService Thread Pool -- 78) Automatically deploying CDI Vaadin servlet to /*
11:55:20,392 INFO  [com.vaadin.flow.server.startup.DevModeInitializer] (ServerService Thread Pool -- 78) Starting dev-mode updaters in C:\Wildfly\wildfly-19.1.0.Final_Bare\bin folder.
11:55:20,685 INFO  [dev-updater] (ServerService Thread Pool -- 78) Visited 74 classes. Took 14 ms.
11:55:20,699 INFO  [dev-updater] (ServerService Thread Pool -- 78) Skipping `npm install`.
11:55:20,699 INFO  [dev-updater] (ServerService Thread Pool -- 78) Copying frontend resources from jar files ...
11:55:20,765 INFO  [dev-updater] (ServerService Thread Pool -- 78) Visited 12 resources. Took 65 ms.
11:55:20,768 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 78) MSC000001: Failed to start service jboss.deployment.unit."testproject-1.0-SNAPSHOT.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."testproject-1.0-SNAPSHOT.war".undertow-deployment: java.lang.RuntimeException: java.lang.IllegalStateException: 

  Failed to find the following css files in the `node_modules` or `C:\Wildfly\wildfly-19.1.0.Final_Bare\bin\.\frontend` directory tree:
      - ./styles/shared-styles.css
      - ./styles/vaadin-text-field-styles.css
  Unable to locate frontend resources and missing token file. Please run the `prepare-frontend` Vaadin plugin goal before deploying the application


	at org.wildfly.extension.undertow@19.1.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:81)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.jboss.threads@2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
	at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
	at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
	at java.base/java.lang.Thread.run(Thread.java:834)
	at org.jboss.threads@2.3.3.Final//org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: 

  Failed to find the following css files in the `node_modules` or `C:\Wildfly\wildfly-19.1.0.Final_Bare\bin\.\frontend` directory tree:
      - ./styles/shared-styles.css
      - ./styles/vaadin-text-field-styles.css
  Unable to locate frontend resources and missing token file. Please run the `prepare-frontend` Vaadin plugin goal before deploying the application


	at io.undertow.servlet@2.1.0.Final//io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:254)
	at org.wildfly.extension.undertow@19.1.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
	at org.wildfly.extension.undertow@19.1.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
	... 8 more
Caused by: java.lang.IllegalStateException: 

  Failed to find the following css files in the `node_modules` or `C:\Wildfly\wildfly-19.1.0.Final_Bare\bin\.\frontend` directory tree:
      - ./styles/shared-styles.css
      - ./styles/vaadin-text-field-styles.css
  Unable to locate frontend resources and missing token file. Please run the `prepare-frontend` Vaadin plugin goal before deploying the application


	at deployment.testproject-1.0-SNAPSHOT.war//com.vaadin.flow.server.frontend.AbstractUpdateImports.getCssLines(AbstractUpdateImports.java:221)
	at deployment.testproject-1.0-SNAPSHOT.war//com.vaadin.flow.server.frontend.AbstractUpdateImports.run(AbstractUpdateImports.java:105)
	at deployment.testproject-1.0-SNAPSHOT.war//com.vaadin.flow.server.frontend.TaskUpdateImports.execute(TaskUpdateImports.java:378)
	at deployment.testproject-1.0-SNAPSHOT.war//com.vaadin.flow.server.frontend.NodeTasks.execute(NodeTasks.java:445)
	at deployment.testproject-1.0-SNAPSHOT.war//com.vaadin.flow.server.startup.DevModeInitializer.initDevModeHandler(DevModeInitializer.java:316)
	at deployment.testproject-1.0-SNAPSHOT.war//com.vaadin.flow.server.startup.DevModeInitializer.process(DevModeInitializer.java:209)
	at deployment.testproject-1.0-SNAPSHOT.war//com.vaadin.flow.server.startup.ClassLoaderAwareServletContainerInitializer.onStartup(ClassLoaderAwareServletContainerInitializer.java:76)
	at io.undertow.servlet@2.1.0.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:204)
	at io.undertow.servlet@2.1.0.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:186)
	at io.undertow.servlet@2.1.0.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
	at io.undertow.servlet@2.1.0.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
	at org.wildfly.extension.undertow@19.1.0.Final//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
	at org.wildfly.extension.undertow@19.1.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
	at org.wildfly.extension.undertow@19.1.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
	at org.wildfly.extension.undertow@19.1.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
	at org.wildfly.extension.undertow@19.1.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
	at io.undertow.servlet@2.1.0.Final//io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:252)
	... 10 more

11:55:20,770 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "testproject-1.0-SNAPSHOT.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"testproject-1.0-SNAPSHOT.war\".undertow-deployment" => "java.lang.RuntimeException: java.lang.IllegalStateException: 

  Failed to find the following css files in the `node_modules` or `C:\\Wildfly\\wildfly-19.1.0.Final_Bare\\bin\\.\\frontend` directory tree:
      - ./styles/shared-styles.css
      - ./styles/vaadin-text-field-styles.css
  Unable to locate frontend resources and missing token file. Please run the `prepare-frontend` Vaadin plugin goal before deploying the application


    Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: 

  Failed to find the following css files in the `node_modules` or `C:\\Wildfly\\wildfly-19.1.0.Final_Bare\\bin\\.\\frontend` directory tree:
      - ./styles/shared-styles.css
      - ./styles/vaadin-text-field-styles.css
  Unable to locate frontend resources and missing token file. Please run the `prepare-frontend` Vaadin plugin goal before deploying the application


    Caused by: java.lang.IllegalStateException: 

  Failed to find the following css files in the `node_modules` or `C:\\Wildfly\\wildfly-19.1.0.Final_Bare\\bin\\.\\frontend` directory tree:
      - ./styles/shared-styles.css
      - ./styles/vaadin-text-field-styles.css
  Unable to locate frontend resources and missing token file. Please run the `prepare-frontend` Vaadin plugin goal before deploying the application

"}}
11:55:20,811 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 45) WFLYSRV0010: Deployed "testproject-1.0-SNAPSHOT.war" (runtime-name : "testproject-1.0-SNAPSHOT.war")
11:55:20,812 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."testproject-1.0-SNAPSHOT.war".undertow-deployment: java.lang.RuntimeException: java.lang.IllegalStateException: 

  Failed to find the following css files in the `node_modules` or `C:\Wildfly\wildfly-19.1.0.Final_Bare\bin\.\frontend` directory tree:
      - ./styles/shared-styles.css
      - ./styles/vaadin-text-field-styles.css
  Unable to locate frontend resources and missing token file. Please run the `prepare-frontend` Vaadin plugin goal before deploying the application


WFLYCTL0448: 1 additional services are down due to their dependencies being missing or failed
11:55:20,852 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
11:55:20,854 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
11:55:20,854 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
11:55:20,854 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 19.1.0.Final (WildFly Core 11.1.1.Final) started (with errors) in 5265ms - Started 452 of 683 services (3 services failed or missing dependencies, 379 services are lazy, passive or on-demand)

It took me some time to notice, but then it hit me: Starting dev-mode updaters in C:\Wildfly\wildfly-19.1.0.Final_Bare\bin folder.

As you can see in the logs Vaadin tries to compile the frontend-stuff in the Wildfly folder and through that pollutes it with it’s files:

grafik

grafik

The bug doesn’t seem to be always 100% reproducible. Sometimes I have this problem, sometimes not…

Resulting problems ❌

  • I have to do a vaadin:prepare-frontend, refresh the project and restart the server which is uncool and costs a lot of time over a longer period
  • The wildfly-bin folder get’s messed up, I have to clean it regurally (which also costs a lot of time over a longer period)
  • In extrem causes (e.g. if there are the same files already in the wildfly/bin-folder) this can damage the wildfly installation

Minimal reproducible example

Setup

  • Download and install the latest eclipse (2020-03)
  • Download and install the latest Wildfly (19.0.1)
  • Download the Vaadin Starter project (CDI + Java EE)
  • Start eclipse
  • Make a new workspace
  • Add the JBoss Tool via Eclipse Marketplace (requires restart)
  • Remove any preinstalled JREs and set JDK 11 (Preferences>Java>Installed JREs), set also the compiler to Java 11 (Preferences>Java>Compiler)
  • Import the Vaadin Starter project
  • Open the servers tab (Windows>Show View)
  • Add the Wildfly
  • Add the project to the wildfly
Reproduction example

I made a little video: VaadinBuildsFrontendInWildfly.zip Or view it directly as gif: VaadinBuildsFrontendInWildfly mp4

If the following doesn’t work try out my minor modified pom: pom.zip

  • maven → clean install the project
  • Refresh the project in eclipse (F5) or Maven Update it (Alt+F5)
  • Start the server → no compiling problems
  • If everything is working fine try the following at least 2-3 times until the server breaks:
    • Shutdown eclipse
    • Start eclipse again
    • Start the server → server breaks

Expected behavior

  • Vaadin uses the correct folder (not the Wildfly/bin)

Actual behavior

Vaadin uses the Wildfly/bin instead of the project-Folder This behavior is caused due to the non-exsistence of project.basedir in the DeploymentConfiguration while processing DevModeInitalizer grafik which causes a fallback to user.dir. That resolves to the wildfly-bin folder: grafik

Versions:

  • Vaadin / Flow version: 14.2.0 (latest LTS)
  • Java version: OpenJDK 11.0.6
  • OS version: Win 10
  • Browser version (if applicable): -
  • Application Server (if applicable): Wildfly 19.0.1 Final
  • IDE (if applicable): Eclipse 2020-03 (+JBoss Tools)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
joherikscommented, Jul 10, 2020

@AB-xdev Yes, the change will be included in next maintenance release of Vaadin 14.3.

1reaction
AB-xdevcommented, Jul 9, 2020

Looks like the <runOnIncremental>true</runOnIncremental> fixed it, i can’t reproduce the problem after the start of eclipse anymore 👍

Now my pom looks like this:

<plugin>
	<groupId>org.eclipse.m2e</groupId>
	<artifactId>lifecycle-mapping</artifactId>
	<version>1.0.0</version>
	<configuration>
		<lifecycleMappingMetadata>
			<pluginExecutions>
				<pluginExecution>
					<pluginExecutionFilter>
						<groupId>com.vaadin</groupId>
						<artifactId>vaadin-maven-plugin</artifactId>
						<!-- Apply this fix to all versions >= 14 -->
						<versionRange>[14,)</versionRange>
						<goals>
							<goal>prepare-frontend</goal>
						</goals>
					</pluginExecutionFilter>
					<action>
						<execute>
							<!-- Suggested fix at https://github.com/vaadin/flow/issues/8403#issuecomment-655548240 -->
							<runOnIncremental>true</runOnIncremental>
							<runOnConfiguration>true</runOnConfiguration>
						</execute>
					</action>
				</pluginExecution>
			</pluginExecutions>
		</lifecycleMappingMetadata>
	</configuration>
</plugin>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting started with Vaadin on WildFly - Mastertheboss
Click Open and Open as Project when prompted. Let's have a look at some of the generated project files: Within the src/main/java folder...
Read more >
Vaadin application won't get deployed on WildFly 10
Dear, I am trying to deploy my simple Vaadin UI to WildFly 10, but it failed. However, the same UI programs can be...
Read more >
Vaadin 14 + CDI + Wildlfy 15: Problem while deploying app to ...
Hello all, I try to create simple vaadin cdi application using vaadin 14 + cdi + wildfly 15. Attached screenshoot of my project...
Read more >
Spring boot + wildfly 12 + vaadin 14
hi everyone im new with vaadin and springboot, i have a issue and need some help, i can run the application tutorial in...
Read more >
Run Vaadin example app on Wildfly
Hi, I'm new to vaadin and would like to run my apps on a wildfly 10 server. ... tutorial: Creating a Project from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found