JRun 4.0: Configuring an Empty Web Application (.war)
JRun 3.x facilitated the creation of blank web applications using the JRun Management Console (JMC). This TechNote will describe the procedure for creating blank web applications using JRun4.
JRun 3.x provided the ability to create blank web applications (for test or production purposes) through the JRun Management Console. With the introduction of JRun4, the procedure for creating and deploying web applications has changed slightly. JRun4 now requires that the J2EE open directory structure for web applications (as described in the Servlet API specification, version 2.3) be created manually, prior to deploying the application. This directory structure may reside within the JRun server's root folders (as described by the Servlet Specification), or it may reside within the web server's root area. The hot deploy feature of JRun4 will automatically deploy any web application that is located within the JRun server root area.
Creating the new web application in the web server root area will require adding the application to the JRun server using the JMC. The following procedures will outline both techniques.
Deploying to the JRun server's root:
- Create a new folder to contain the web application (for examplemyapp) in {jrun_root}/servers/default.
- Under the myapp folder, create a sub-directory calledWEB-INF (must be all upper-case).
- Within the myapp\WEB-INF folder, create theweb.xml file and jrun-web.xml file configuration files (simply copy both files from the default application - {jrun_root}\servers\default\default-ear\default-war\WEB-INF - and modify as required).
- Under the WEB-INF folder create a sub-folder calledclasses. Copy the three .properties files from the default application's WEB-INF\classes folder into the new classes folder.
- Add <context-root>/myapp</context-root> to thejrun-web.xml file.
* What happens if you don't set<context-root>/myapp</context-root> in the jrun-web.xml file? The jrun-web.xml file is specific to JRun, and is not portable to different web containers. If no context-root is defined, JRun will use either the WAR file name or the directory name as the context-root. - Edit the <display-name> and <description> attributes in the web.xml file to reflect your application requirements.
Once deployed you should see a message similar to the following in the JRun java console:
10/21 11:59:05 info Deploying web application "My Blank JRun Web Application" from: file:/D:/JRun4/servers/default/myapp/
Deploying to the web server's root:
- Start both the admin and default servers and log into the JMC.
- Click on the default server (in the left panel) and then on theJ2EE Components link (in the right panel).
- Scroll to the Web Applications section of the J2EE Components panel and click the Add button at the bottom of the section. The Deploy Web Application window will display.
- Browse to the location of the web application, located within the web server root directory (for example, inetpub/wwwroot/myapp). Keep the file type set to WAR Files (*.war).
- Click the Open button to select the directory.
- Returning back to the Deploy Web Application screen, click the Deploy button to deploy the web application.
- Finally, on the Web Application Overview screen click the Apply button to deploy the web application.
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
