0

i am trying run the websphere liberty profile server from the command line. I am following the steps told here : https://developer.ibm.com/wasdev/downloads/liberty-profile-using-non-eclipse-environments/

I have created the server with the name server1.

But when the extraction completes and I try to start the server using the command : server start server1

the server throws an error : CWWKE0054E: Unable to open file C:\wlp\wlp\usr\servers\server1\logs\C:\Users\Furquan\AppData\Local\Temp\\ihp_custom_batches.log.. Now I know this cant be a valid path, but I dont know where and how to change it. Please help !!

  • You need to find where in your code you are referring to the `ihp_custom_batches.log`. As this is not Liberty file, but your application log file. As it looks like it probably is constructed in the form of incorrect relative path. – Gas Mar 10 '15 at 09:00
  • no I am not using this log file anywhere. What actually is happening is, I am trying to use liberty profile of WAS through command line, but when I try to start the server then it shows the error, none of my code is being run at this time. I am unable to resolve it , please help – sensitive_piece_of_horseflesh Mar 10 '15 at 11:22

2 Answers2

5

This error is related to the LOG_FILE environment variable that you have defined in your environment by some other program. To solve that, you have the following opions:

  • Remove LOG_FILE env variable, if it is no longer needed by your system
  • If you cant do that, override it via server.env file, that you can create in the wlp\usr\servers\serverName directory with the following content:

    LOG_FILE=console.log
    
  • As last resort (this is not recommended, will make your installation NOT SUPPORTED and in certain installations might get overwritten by updates) - modify the server.bat command line script - in the script find the following section:

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

And after the line set X_LOG_FILE=!LOG_FILE! just add another line that will override it with the default like this set X_LOG_FILE=console.log

In general, I'd recommend second solution (with the server.env file), as it is the most portable and will work in any environment.

Gas
  • 17,601
  • 4
  • 46
  • 93
  • 2
    I would not suggest modifying server.bat at all since IBM does not support modifications to files in the wlp/bin/ directory. For more information about files that you should not change, see the Liberty profile externals support topic: https://www-01.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_profile_externals.html – Brett Kail Mar 10 '15 at 14:05
  • 1
    @bkail I agree, that's why I recommended second option. I'll add a comment that it's not recommended and supported. Thanks for comment. – Gas Mar 10 '15 at 14:10
0

I have the similar problem for IBM Support Assistant V5. After I deleted %LOG_FILE% from Environment Variables, it worked.