Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Latest commit

 

History

History
71 lines (51 loc) · 2.5 KB

Using-cmd-line.md

File metadata and controls

71 lines (51 loc) · 2.5 KB

Building and running the sample using the command line

Clone Git Repo

📌 Switch to Eclipse example

$ git clone https://github.com/WASdev/sample.daytrader3.git
$ cd sample.daytrader3

Building the sample

📌 Switch to Eclipse example

This sample can be built using either Gradle or Maven.

Gradle commands
$ gradle build
Apache Maven commands
$ mvn install

The built ear file is copied into the apps directory of the server configuration located in the daytrader3-ee6-wlpcfg directory:

daytrader3-ee6-wlpcfg
 +- servers
     +- daytrader3-ee6-wlpcfg                   <-- specific server configuration
        +- server.xml                          <-- server configuration
        +- apps                                <- directory for applications
           +- daytrader3-ee6.ear                <- sample application
        +- logs                                <- created by running the server locally
        +- workarea                            <- created by running the server locally

Running the application locally

📌 Switch to Eclipse example

Pre-requisite: Download WAS Liberty

Use the following to start the server and run the application:

$ export WLP_USER_DIR=/path/to/sample.daytrader3/daytrader3-ee6-wlpcfg
$ /path/to/wlp/bin/installUtility install daytrader3_Sample
$ /path/to/wlp/bin/server start daytrader3_Sample

1.  Confirm web browser opens on "http://localhost:9083/daytrader" 
2.  In the web browser, Click on the configuration tab.
3.  Click on '(Re)-create  DayTrader Database Tables and Indexes' to create the database.
4.  Click on '(Re)-populate  DayTrader Database' to populate the database.
5.  Restart the server-> .  Now the application will be ready for use.
$ /path/to/wlp/bin/server stop daytrader3_Sample
$ /path/to/wlp/bin/server start daytrader3_Sample
  • start runs the server in the background. Look in the logs directory for console.log to see what's going on, e.g.
  • stop stop the server in the background. Look in the logs directory for console.log to see what's going on, e.g.
  • run runs the server in the foreground.
$ tail -f ${WLP_USER_DIR}/servers/daytrader3_Sample/logs/console.log