The product provides sample applications and coding examples. Use the sample applications to test your product installation and for guidance on deploying and testing applications. Use coding examples for help on programming.
Samples are for demonstration purposes only. See Limitations
of Samples for details.
Samples Gallery
General information
The Samples Gallery offers a set of Samples that demonstrate common enterprise application tasks. The Gallery also contains descriptions of where to find additional Samples and coding examples.
Quick start - Accessing the Samples Gallery |
---|
The Application Server Samples must be installed. You can select to install Samples during product installation or, after the product is installed, separately install the Samples feature. Your application server and the SamplesGallery and PlantsByWebSphere applications must be running. To view the Samples Gallery, open a browser at http://host_name:server_port/WSsamples where host_name is the name of your server and server_port is the port number for the application server internal HTTP transport. The default URL is: http://localhost:9080/WSsamples |
The PlantsByWebSphere.ear file is installed by default on your application server when you create an application server profile.
To view the Samples Gallery, perform the following steps.
Select to install the sample applications. If you do not select to install Samples during the product installation, you can install the Application Server Samples feature later. Installing the Application Server Samples feature adds files and subdirectories to the samples directory:
To see if the Samples are already deployed, click Applications > Enterprise Applications in the console navigation tree to access the Enterprise Applications page. When the Samples are deployed, SamplesGallery and PlantsByWebSphere are in the list of applications.
By default, only the Samples Gallery and the Plants by WebSphere applications are installed on the application server. They are installed in the directory profile_root/installedApps/cell_name.
You can build or modify the Samples source code to support your project. To run the Samples in a distributed WebSphere Application Server Network Deployment environment, install and configure the Samples in a stand-alone application server profile installation, and then use addNode to federate the node into the deployment manager cell. When running the addNode command, use the dmgr_host argument, and -includeapps and -includebuses options. For a complete list of the addNode parameters and their usage, see addNode command. For example, where dmgr_host_name is the name of the machine that hosts your deployment manager profile:
addNode dmgr_host_name -includeapps -includebuses
In a console navigation tree, click Applications > Enterprise Applications to access the Enterprise Applications page. When the Samples are running, the SamplesGallery and PlantsByWebSphere applications have a Started status (green arrow).
Try it out! See the quick start instructions on this page.
If you have difficulty accessing the Samples Gallery, check the port number.
Additional Samples are initially listed as installable Samples in the Samples Gallery. For further instructions on installing each sample, refer to the Installable Samples section of the Samples Gallery in your Web browser, from Step 4.
Note: To install additional samples on non-default profiles, specify the -server myServer parameter. Additional information about -server parameter and other script values can be found in Installable Samples, Samples install help section.
For information about configuring security for Samples, see the Samples Gallery.
app_server_root/samples/bin/install -profileName profile_name -server server_name -samples SamplesGalleryFor the default profile, server_name is server1. The server name for additional profiles is generally the profile name. If your profile contains more than one node, also specify the -node node_name option. For a stand-alone application server profile, you will have multiple nodes if you have created a Web server definition for profile. This happens automatically when you associate an IBM HTTP Server for iSeries HTTP server instance with your application server through the HTTP administrative console.
The Samples are for demonstration purposes only.
The code that is provided is not intended to run in a secured production environment. The Samples support Java 2 Security, therefore the Samples implement policy-based access control that checks for permissions on protected system resources, such as file I/O.
The Samples also support administrative security.
The BeenThere workload management Sample is the only Sample that is supported in a multi-server, clustered environment. For information on the BeenThere Sample, see the readme_BeenThere.html file in the Samples directory.
Many of the WebSphere Application Server Samples connect to a Cloudscape database using the Cloudscape-embedded framework. The Cloudscape-embedded framework has a limitation that only one JVM can access a given database instance. As a result, in a clustered WebSphere environment, the second server in the node fails to start the Sample applications, because the first server (JVM) already holds a connection to that database instance.
For applications that require multiple Java virtual machines to access the same Cloudscape instance, use the Cloudscape networkServer framework.