Open-liberty "Unable to verify if the server was started after 30 seconds." after changing logDirectory

Viewed 139

When I set a logDirectory in my server.xml I get the following error when starting up the server:

Unable to verify if the server was started after 30 seconds. Consider increasing the serverStartTimeout value if this continues to occur.

I created an issue on github: https://github.com/OpenLiberty/ci.maven/issues/1224 And it looks like they're aware of this issue and already resolved it but it still occurs. Anyone knows a workaround?

1 Answers

Looks like you found another part of the problem which obviously was not fully resolved (thank you for raising the issue).

One approach for a workaround might be just to set the entire output directory to an alternate location, rather than only trying to set your logs directory to an alternate location. So something like:

  1. REMOVE the logDirectory attribute from the <logging> element in server.xml.

  2. Set the output directory via liberty-maven-plugin:

        <plugin>
                <groupId>io.openliberty.tools</groupId>
                <artifactId>liberty-maven-plugin</artifactId>
                <configuration>
                    <outputDirectory>C:/liberty-output</outputDirectory>
  1. OR, (as an alternate to 2.), instead of using plugin config, you can set the output directory in src/main/liberty/config/server.env:

WLP_OUTPUT_DIR=C:/liberty-output

NOTE

Note that you'll get some extra directories nested in this solution.

You'll get something like:

C:/liberty-output/defaultServer/logs/messages.log

Rather than:

C:/liberty-output/messages.log
Related