WF29 - setlocal cmd added to common.bat breaks COMMON_CONF ?

43 views
Skip to first unread message

Martin Miller

unread,
Sep 13, 2023, 3:02:35 PM9/13/23
to WildFly
Hi,

I've been debugging my (somewhat patched) WildFly install on a server, where the windows service doesn't start WF29. I do create common.conf.bat & ps1 files where I set JAVA_HOME to a WF29\java directory. Those modification always worked before, so I don't think my patches are the problem here.

On installing on a server, the service doesn't start at all wildfly. JAVA_HOME isn't found by the scripts executed by the service.

I've done a diff of WF28 & 29 and I think I found out why, as a setlocal/endlocal was added to bin\common.bat. I'm not sure what this is supposed to do, but If I remove those commands, everything works.

Is setlocal/endlocale somehow erasing the environment variables that I setted in common.conf.bat (that would be my set JAVA_HOME=) ?

Why was this change done ?

$ diff -c wildfly-28.0.1.Final/bin/common.bat  wildfly-29.0.1.Final/bin/common.bat
*** wildfly-28.0.1.Final/bin/common.bat 2023-05-18 15:41:04.000000000 -0400
--- wildfly-29.0.1.Final/bin/common.bat 2023-08-25 11:34:52.000000000 -0400
***************
*** 3,8 ****
--- 3,9 ----
  goto :eof

  :commonConf
+ setlocal
  if "x%COMMON_CONF%" == "x" (
     set "COMMON_CONF=%DIRNAME%common.conf.bat"
  ) else (
***************
*** 13,18 ****
--- 14,20 ----
  if exist "%COMMON_CONF%" (
     call "%COMMON_CONF%" %*
  )
+ endlocal
  goto :eof

Richard Opalka

unread,
Sep 14, 2023, 5:53:24 AM9/14/23
to Martin Miller, WildFly, Yeray Borges Santana
Hello Martin,

   It was added via WFCORE-6206 effort (according to bit blame).
Yeray should provide you with more information.

Rio

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/618ce8c8-8d9c-4a03-a686-56aa4fefcf82n%40googlegroups.com.

Yeray Borges Santana

unread,
Sep 19, 2023, 10:47:07 AM9/19/23
to Martin Miller, WildFly
Hello Martin,

Thanks for reporting this one. We have to remove the setLocal / endLocal on the common.bat. Sadly, it was a mistake made at a very early stage of the Integration Manager development with the intention of not polluting the environment by loading the common.conf.bat twice, which I guess was causing issues at that time. 

This should have been removed from that file since the server environment is already protected and is not polluted when the Installation Manager is executed and loads the common.conf.bat again.

We have corrected it on https://issues.redhat.com/browse/WFCORE-6502 and we plan to release it on the next WildFly release.

On Thu, Sep 14, 2023 at 10:53 AM Richard Opalka <rop...@redhat.com> wrote:
Hello Martin,

   It was added via WFCORE-6206 effort (according to bit blame).
Yeray should provide you with more information.

Thanks, Richard.

Martin Miller

unread,
Sep 19, 2023, 4:55:10 PM9/19/23
to WildFly
Thank you for the explanation.

As I understand, the goal of common.conf.bat is to let us set environment variables that would "stick" in the environment, so I'm glad I'm not misusing that feature and that it will be fixed.
In the mean time I can just remove those 2 lines.

Thanks !
Reply all
Reply to author
Forward
0 new messages