redeploy feature not working ?

327 views
Skip to first unread message

Luis Trigueiros

unread,
Dec 3, 2016, 11:49:27 AM12/3/16
to vert.x
Hi,

Does the redeploy feature works on windows ?  
I am testing with the plain gradle-reploy examples that comes with the vertx-examples and I keep getting the following error on redeply:

---------
C:\tools\vertx.io\vertx-examples\gradle-redeploy (master)
λ gradlew run
:compileJava
:processResources UP-TO-DATE
:classes
:run
Dec 03, 2016 4:43:23 PM io.vertx.core.impl.launcher.commands.Watcher
INFO: Watched paths: [C:\tools\vertx.io\vertx-examples\gradle-redeploy\.\src]
Dec 03, 2016 4:43:23 PM io.vertx.core.impl.launcher.commands.Watcher
INFO: Starting the vert.x application in redeploy mode
Starting vert.x application...
c7ab32ab-0858-41c0-b9f0-0e1b96f7e27c-redeploy
Dec 03, 2016 4:43:24 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
INFO: Succeeded in deploying verticle
Dec 03, 2016 4:43:54 PM io.vertx.core.impl.launcher.commands.Watcher
Stopping vert.x application 'c7ab32ab-0858-41c0-b9f0-0e1b96f7e27c-redeploy'INFO: Redeploying!

Failed to stop application 'c7ab32ab-0858-41c0-b9f0-0e1b96f7e27c-redeploy'
java.io.IOException: Cannot run program "WMIC": CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at io.vertx.core.impl.launcher.commands.StopCommand.terminateWindowsApplication(StopCommand.java:129)
        at io.vertx.core.impl.launcher.commands.StopCommand.run(StopCommand.java:82)
        at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:230)
        at io.vertx.core.spi.launcher.ExecutionContext.execute(ExecutionContext.java:81)
        at io.vertx.core.impl.launcher.commands.RunCommand.stopBackgroundApplication(RunCommand.java:314)
        at io.vertx.core.impl.launcher.commands.Watcher.trigger(Watcher.java:316)
        at io.vertx.core.impl.launcher.commands.Watcher.run(Watcher.java:298)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
        at java.lang.ProcessImpl.start(ProcessImpl.java:137)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 8 more
'.' is not recognized as an internal or external command,
operable program or batch file.
Dec 03, 2016 4:43:54 PM io.vertx.core.impl.launcher.commands.Watcher
INFO: User command terminated with status 1
Starting vert.x application...
c7ab32ab-0858-41c0-b9f0-0e1b96f7e27c-redeploy
Dec 03, 2016 4:43:54 PM io.vertx.core.impl.launcher.commands.Watcher
INFO: Redeployment done in 57 ms.
---------


Thank you.

Clement Escoffier

unread,
Dec 3, 2016, 1:17:23 PM12/3/16
to ve...@googlegroups.com
Hi,

Which windows version are you using ? 

Clement

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/9f035d0c-0999-4308-95ea-58106f3d7f5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luis Trigueiros

unread,
Dec 3, 2016, 1:56:21 PM12/3/16
to ve...@googlegroups.com
Windows 10 home.

To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "vert.x" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vertx/OdidFzydcqk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vertx+unsubscribe@googlegroups.com.

Alexander Lehmann

unread,
Dec 3, 2016, 4:32:21 PM12/3/16
to vert.x
I tried it with windows 10 home and it doesn't work for me either.

The WMIC error doesn't appear, but the error with "." is not a valid command:


'.' is not recognized as an internal or external command,
operable program
or batch file.
Dec 03, 2016 4:43:54 PM io.vertx.core.impl.launcher.commands.Watcher
INFO
: User command terminated with status 1

it looks like it starts a new Launcher java process, which means that the recompile doesn't work as the port is still taken by the old process.
Windows 10 home.

To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "vert.x" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vertx/OdidFzydcqk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vertx+un...@googlegroups.com.

Luis Trigueiros

unread,
Dec 3, 2016, 4:51:55 PM12/3/16
to ve...@googlegroups.com
Yes I have noticed the it  that I got a lot of java processes hanging around when trying to use this and just had to go back and kill these manually so it makes the feature unusable.  

To unsubscribe from this group and all its topics, send an email to vertx+unsubscribe@googlegroups.com.

Alexander Lehmann

unread,
Dec 3, 2016, 5:11:36 PM12/3/16
to vert.x
I have used that before by calling the Launcher java class directly, which worked, but that may have been when I still was on Windows 7.
To unsubscribe from this group and all its topics, send an email to vertx+un...@googlegroups.com.

Luis Trigueiros

unread,
Dec 3, 2016, 5:36:20 PM12/3/16
to ve...@googlegroups.com
I also tried this it does the redeploy but it does not do any code changes, my run configuration in idea has the following:

----io.vertx.core.Launcher
run groovy:com.company.ServerVerticle --redeploy="src/main/groovy/**/*.groovy" --launcher-class=io.vertx.core.Launcher
----

And the following is a sample of the console output, as you can see the redeploy happens but the the code change is not picked up

-----
Dec 03, 2016 10:30:10 PM io.vertx.core.impl.launcher.commands.Watcher
INFO: Watched paths: [C:\tools\vertx.io\study\vertx-demo\.\src\main\groovy]
Starting vert.x application...
Dec 03, 2016 10:30:10 PM io.vertx.core.impl.launcher.commands.Watcher
3eada2cc-2d25-4a97-9aa4-a06473c5052a-redeploy
INFO: Starting the vert.x application in redeploy mode
Dec 03, 2016 10:30:12 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
INFO: Succeeded in deploying verticle
zzzzzzzz ....yyyyyy
Stopping vert.x application '3eada2cc-2d25-4a97-9aa4-a06473c5052a-redeploy'
Dec 03, 2016 10:30:32 PM io.vertx.core.impl.launcher.commands.Watcher
INFO: Redeploying!
Application '3eada2cc-2d25-4a97-9aa4-a06473c5052a-redeploy' terminated with status 0
Dec 03, 2016 10:30:32 PM io.vertx.core.impl.launcher.commands.Watcher
INFO: Redeployment done in 202 ms.
Starting vert.x application...
3eada2cc-2d25-4a97-9aa4-a06473c5052a-redeploy
Dec 03, 2016 10:30:33 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
INFO: Succeeded in deploying verticle
zzzzzzzz ....yyyyyy
-----

-----



To unsubscribe from this group and all its topics, send an email to vertx+unsubscribe@googlegroups.com.

Alexander Lehmann

unread,
Dec 3, 2016, 5:38:55 PM12/3/16
to vert.x
Ok, I know why it doesn't work when recompiling the project in Windows

The command to run when redeploying is in the build.gradle file and is def doOnChange = './gradlew classes', this means that it tries to run

cmd /c ./gradlew classes

to recompile, which doesn't work since cmd parses / not as path char.

When you change the line to def doOnChange = '.\\gradlew classes'

it should work.

(not sure about the WMCI error though, the program is available when I try it)
To unsubscribe from this group and all its topics, send an email to vertx+un...@googlegroups.com.

Luis Trigueiros

unread,
Dec 3, 2016, 6:09:10 PM12/3/16
to ve...@googlegroups.com
Thank you I tried this unfortunatly it did not worked:

my build.gradle:
-------------------------
def mainVerticleName = 'groovy:com.company.ServerVerticle'
def watchForChange = 'src/**/*.groovy'
def doOnChange = '.\\gradlew.bat classes'

run {
  args = ['run', mainVerticleName, "--redeploy=$watchForChange", "--launcher-class=$mainClassName", "--on-redeploy=$doOnChange"]
}
-------------------------


And the error I get is:
----------------------------
λ gradlew run
:compileJava UP-TO-DATE
:compileGroovy UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:run
Dec 03, 2016 11:03:53 PM io.vertx.core.impl.launcher.commands.Watcher
INFO: Watched paths: [C:\tools\vertx.io\study\vertx-demo\.\src]
Dec 03, 2016 11:03:53 PM io.vertx.core.impl.launcher.commands.Watcher
INFO: Starting the vert.x application in redeploy mode
Starting vert.x application...
79a6b2d3-03c3-4604-aeb9-90aabcf583cf-redeploy
Dec 03, 2016 11:03:54 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
INFO: Succeeded in deploying verticle
zzzzzzzz yyyyyyyyyyyyyyyyyyy....
Dec 03, 2016 11:04:33 PM io.vertx.core.impl.launcher.commands.Watcher
INFO: Redeploying!
Stopping vert.x application '79a6b2d3-03c3-4604-aeb9-90aabcf583cf-redeploy'
Failed to stop application '79a6b2d3-03c3-4604-aeb9-90aabcf583cf-redeploy'
java.io.IOException: Cannot run program "WMIC": CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at io.vertx.core.impl.launcher.commands.StopCommand.terminateWindowsApplication(StopCommand.java:129)
        at io.vertx.core.impl.launcher.commands.StopCommand.run(StopCommand.java:82)
        at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:230)
        at io.vertx.core.spi.launcher.ExecutionContext.execute(ExecutionContext.java:81)
        at io.vertx.core.impl.launcher.commands.RunCommand.stopBackgroundApplication(RunCommand.java:314)
        at io.vertx.core.impl.launcher.commands.Watcher.trigger(Watcher.java:316)
        at io.vertx.core.impl.launcher.commands.Watcher.run(Watcher.java:298)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
        at java.lang.ProcessImpl.start(ProcessImpl.java:137)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 8 more
:compileJava UP-TO-DATE
:compileGroovy
:processResources UP-TO-DATE
:classes

BUILD SUCCESSFUL

Total time: 5.169 secs
Dec 03, 2016 11:04:38 PM io.vertx.core.impl.launcher.commands.Watcher
Starting vert.x application...
INFO: User command terminated with status 0
79a6b2d3-03c3-4604-aeb9-90aabcf583cf-redeployDec 03, 2016 11:04:39 PM io.vertx.core.impl.launcher.commands.Watcher

INFO: Redeployment done in 5846 ms.
Dec 03, 2016 11:04:40 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
INFO: Succeeded in deploying verticle
Dec 03, 2016 11:04:40 PM io.vertx.core.http.impl.HttpServerImpl
SEVERE: java.net.BindException: Address already in use: bind
> Building 80% > :run
---------------------------

To unsubscribe from this group and all its topics, send an email to vertx+unsubscribe@googlegroups.com.

Alexander Lehmann

unread,
Dec 3, 2016, 7:03:07 PM12/3/16
to vert.x
It looks like vertx uses the WMIC command to kill windows processes, could you please check if that is available in your windows cmd?

wmic process

should list all running processes, maybe that is not working in some cases.

To unsubscribe from this group and all its topics, send an email to vertx+un...@googlegroups.com.

Clement Escoffier

unread,
Dec 4, 2016, 4:33:06 AM12/4/16
to ve...@googlegroups.com
Hi,

I will try to reproduce it. I used windows 10 pro, so I may have different settings. 
Typically, can you check if `wmic` is installed ? Wmic is a command line tools to do a bunch of administration stuff (https://msdn.microsoft.com/en-us/library/bb742610.aspx). It includes listing and killing (terminating) processed. The Vert.x redeploy feature uses it to detect running apps and terminate them. 

Clement

Luis Trigueiros

unread,
Dec 4, 2016, 6:21:28 AM12/4/16
to ve...@googlegroups.com
Hi,

I have looked at vert.x code doing this and tried to rebuild the command line at the windows prompt to test and it looks like either I am missing something or there is some difference on the level of supported features in this version of windows for the WMIC command, bellow is what I am getting:

----------------------
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\luist>wmic process where CommandLine like '%vertx.id%'
like - Invalid alias verb.
----------------------

To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "vert.x" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vertx/OdidFzydcqk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vertx+unsubscribe@googlegroups.com.

Luis Trigueiros

unread,
Dec 4, 2016, 6:28:59 AM12/4/16
to vert.x
By the way the following works:
---------------------------------
wmic process where name='java.exe'

                                                                                                                                                                                         Win32_Process      20161204111205.430635+000  Win32_ComputerSystem  DESKTOP-KICVG34  java.exe     C:\tools\oracle.com\jdk\1.8.0_77\jre\bin\java.exe                     9864    392                       4687500         1380                   200                    java.exe  Win32_OperatingSystem  Microsoft Windows 10 Home|C:\WINDOWS|\Device\Harddisk0\Partition3  17055                965776              36672       293764         6772             304048             3725709312       113752
8         300814336         9864       41                      207                  43                          207                      9881                12876192           21                                  26           17656250      3722563584   10.0.14393      106405888       2                    177


C
-------------------------------

Alexander Lehmann

unread,
Dec 4, 2016, 6:31:34 AM12/4/16
to vert.x
Hi Clement,

I have created a pr for the ./gradlew issue:

https://github.com/vert-x3/vertx-examples/pull/164

Can you please take a look and merge it?


Thanks, Alexander

Alexander Lehmann

unread,
Dec 4, 2016, 6:39:19 AM12/4/16
to vert.x
I think the where is a single argument:


wmic process where "CommandLine like '%vertx.id%'"

I have the same windows build I think:

λ ver

Microsoft Windows [Version 10.0.14393]

--
You received this message because you are subscribed to a topic in the Google Groups "vert.x" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vertx/OdidFzydcqk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vertx+un...@googlegroups.com.

Alexander Lehmann

unread,
Dec 4, 2016, 6:58:18 AM12/4/16
to vert.x
I wonder if the path for the command is missing in the java environment.

The program is present in C:\Windows\System32\wbem and C:\Windows\SysWOW64\wbem, the system32 path is included in the PATH env in my case.

Maybe it would work if the absolute path of the command is used.

--
You received this message because you are subscribed to a topic in the Google Groups "vert.x" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vertx/OdidFzydcqk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vertx+un...@googlegroups.com.

Luis Trigueiros

unread,
Dec 4, 2016, 7:22:58 AM12/4/16
to ve...@googlegroups.com
Dear Alexander,

Thank for all the help and support this was may issue I was missing these folders:
  • C:\Windows\System32\wbem  
  • C:\Windows\SysWOW64\wbem
On my system path variable,I have a special my of configuring  my system path using batch script and  don't use the default windows way off doing it as this allows more flexibility when changing for example java versions.
As a side comment maybe this feature should not be part of the Vert.x core but give as an additional jar the same way as spring-boot does it and in this separate jar maybe you could bundle native code to do this using JNI, also gradle as this continues build mode that maybe could be used as alternative.

Thank you, kindly
 Luis Oscar Trigueiros

To unsubscribe from this group and all its topics, send an email to vertx+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages