0

I was trying to configure Maven to launch WebSphere Liberty Profile from Eclipse. Anyhow I find it working on Linux but doesn't work on Windows. Below is the setup on pom.xml. (Please note only relevant code will be post here)

     <pluginRepositories>
        <pluginRepository>
            <id>WASdev</id>
            <name>WASdev Repository</name>
            <url>http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>
    ...
    ...
    <build>
       <pluginManagement>
          <plugins>
             <plugin>
                <groupId>com.ibm.websphere.wlp.maven.plugins</groupId>
                <artifactId>liberty-maven-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <serverHome>D:\tool\wlp</serverHome>
                    <serverName>LP1</serverName>
                </configuration>

                <executions>
                   <execution>
                      <id>start-server</id>
                      <phase>pre-integration-test</phase>
                      <goals>
                         <goal>start-server</goal>
                      </goals>
                      <configuration>
                         <serverHome>D:\tool\wlp</serverHome>
                         <serverName>LP1</serverName>
                      </configuration>
                   </execution>
                </executions>
             </plugin>
          </plugins>
       </pluginManagement>
    </build>

I have my Liberty Profile install at D:\tool\wlp and have a server created named LP1. When I launch the server with this goal: liberty:start-server, I will hit this error:

[ERROR] Failed to execute goal com.ibm.websphere.wlp.maven.plugins:liberty-maven-plugin:1.0:start-server (default-cli) on project SpringSecurity4: CWWKM2002E: Failed to invoke [D:\tool\wlp\bin\server.bat, start, LP1, --clean]. RC= 22 but expected=0.

I wasn't sure what 22 means? Forget about that mystery number, only IBM guy may decode that number. When I try this on cmd > mvn start LP1, I have this output:

The filename, directory name, or volume label syntax is incorrect. Starting server LP1. Server LP1 start failed. Check server logs for details.

The content of the log was shown below, but still I'm not able to decode the message behind the scene. Hope you guys could help.

arg0=LP1 arg1=--status:start exit=22

                   Command:  "C:\Documents and Settings\kok.hoe.loh\Tool\jdk1.6.0_30\jre\bin\java"
-XX:MaxPermSize=256m  "-javaagent:D:\tool\wlp\bin\tools\ws-javaagent.jar" -jar "D:\tool\wlp\bin\tools\ws-server.jar" --batch-file start LP1 --clean
                 Java home:  C:\Documents and Settings\kok.hoe.loh\Tool\jdk1.6.0_30\jre
              Install root:  D:/tool/wlp/
          System libraries:  D:/tool/wlp/lib/
                 User root:  D:/tool/wlp/usr/
             Server config:  D:/tool/wlp/usr/servers/LP1/
             Server output:  D:/tool/wlp/usr/servers/LP1/
huahsin68
  • 6,819
  • 20
  • 79
  • 113
  • 1
    If the Windows machine is slow/virtualized, then PM91596 might be relevant (http://www-01.ibm.com/support/docview.wss?uid=swg1PM91596). In any case, this is effectively an internal error, so I recommend opening a PMR with IBM. – Brett Kail Aug 29 '13 at 14:27
  • 1
    The process exit codes are documented in the infocenter for WAS (http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-libcore-mp&topic=rwlp_command_server) Since 22 is an internal error this doesn't help in this case, but I thought it would be useful for reference. – Alasdair Aug 29 '13 at 14:35
  • @bkail The report mention that by configuring server.start.wait.time in `bootstrap.properties` to higher value should resolved the problem. But I don't know how could I configure it in server.xml? – huahsin68 Aug 30 '13 at 01:37
  • It's not clear that PM91596 is your issue, but if it is, then you need an iFix for the APAR before the property can be used. To get an iFix, you would need to open a PMR with IBM. Additional information on bootstrap.properties is in the InfoCenter: http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.wlp.nd.doc/ae/twlp_inst_bootstrap.html – Brett Kail Aug 30 '13 at 13:39

2 Answers2

2

I have the same result when trying to start WSLP from the command line. In my case I traced it down to the LOG_FILE environment variable already being set for some reason to:

LOG_FILE=C:\Users\AA_EB0~1\AppData\Local\Temp\ihp_custom_batches.log

WSLP's server.bat also uses this variable but assumes it is relative. When the following command is executed:

start /b "" !JAVA_CMD_QUOTED!w !JVM_OPTIONS! !JAVA_PARAMS_QUOTED! --batch-file !PARAMS_QUOTED! > "%X_LOG_DIR%\%X_LOG_FILE%" 2>&1

it results in the "The filename, directory name, or volume label syntax is incorrect." error

Since I don't know the impact of removing the existing environment variable, I changed

  if not defined LOG_FILE (
    set X_LOG_FILE=console.log
  ) else (
    set X_LOG_FILE=!LOG_FILE!
  )

to

  set X_LOG_FILE=console.log

in server.bat and was able to start WSLP without issues after that.

Sebbe
  • 478
  • 5
  • 13
  • 1
    Well spotted! Very unfortunate clash of LOG_* environment variables, but not something that can easily be changed without breaking established env files. I wonder if setting LOG_FILE to something in server.env would have worked around the LOG_FILE variable set by the other application? – ebullient Jan 16 '14 at 01:40
  • 1
    @huahsin68 Changing the script file is not recommended and supported. Check [this post](http://stackoverflow.com/a/28963232/3701228) for supported solution using `server.env`. – Gas Mar 10 '15 at 15:56
  • @ebullient Yes, it is possible to use `server.env` - see [this](http://stackoverflow.com/a/28963232/3701228) – Gas Mar 10 '15 at 15:59
1

This does look like PMR 91596 issue and you will need to get an iFix for it to configure longer server start timeout ("server.start.wait.time" property in bootstrap.properties file).

jgawor
  • 96
  • 3