質問

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/
役に立ちましたか?

解決

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.

他のヒント

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).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top