Access the Samples (Samples Gallery)
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.
You can upgrade the Samples Gallery, including the server samples and client samples. For detailed information, refer to...
app_server_root/samples/readme.htmlYour appserver must be running. The Samples must be installed.
On Windows systems, click (for example)...
Start | Programs | IBM WebSphere | Application Server v6.1 | Profiles | profile_name | Samples GalleryTo access...
Client Samples...
app_server_root/samples/index.html...local file system
The Samples are for demonstration purposes only. See the following limitations for details.
First time here? Read the following information. A little setup is involved.
Samples Gallery
- Samples Gallery contents
- Installing and accessing the Samples Gallery
- Change the Samples Gallery port number and troubleshooting
Client Samples Gallery
General information
Samples Gallery contents
The Samples Gallery includes the following materials:
- Plants by WebSphere
- This application demonstrates several Java 2 Platform, Enterprise Edition (J2EE) functions, using an online store that specializes in plant and garden tool sales.
- Faces Client Tutorial - Sample Portfolio
- Sample Portfolio is a sample application that demonstrates the use of faces client components. The Hello world sample demonstrates how the faces client framework keeps a data model consistent in the browser.
- Technology Samples
- These Samples demonstrate various core components in J2EE applications.
- Web Services Samples
- These Samples demonstrate J2EE beans and JavaBeans components that are available as Web services.
- Service Data Objects (SDO) Sample
This Sample demonstrates data access to a relational database through Service Data Objects (SDO) and JDBC Mediator technologies.
- BeenThere workload management Sample
This Sample demonstrates the workload management and clustering capabilities of the product, and is the only Sample that is supported in a multi-server, clustered environment.
- JACL scripts
- These scripts enable you to configure resources and install the Sample applications.
- Programming model extensions Samples in the Samples Gallery
- These Samples demonstrate WebSphere programming model extension features such as dynamic query service, work area service, internationalization service, ActivitySessions service, application profiling, Java Transaction API (JTA) extensions, asynchronous beans, and scheduler.
Installing and accessing the Samples Gallery
To view the WAS Samples Gallery, perform the following steps.
- Install the product.
Select to install the Application Server Samples package.
The Samples are installed in the app_server_root/samples directory.
- Create a stand-alone appserver profile.
See Creating profiles through the graphical user interface for more information.
If you already created a profile without the Samples, and you want to create additional profiles that contain the Samples, you have to use the graphical profile creation interface.
The Samples are installed in the directory profile_root/installedApps/cell_name. The Sample source code is placed in the directory profile_root/installedApps/cell_name/samples.
You can build or modify the Samples source code to support your project.
To run the Samples in a distributed WebSphere Application Server ND environment, install and configure the Samples in a stand-alone appserver 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:
addNode.sh/bat dmgr_hostname -includeapps -includebusesStart the appserver.
- Access the Samples Gallery.
Try it out! See the quick start instructions on this page.
If you have difficulty accessing the Samples Gallery, check the port number.
The Plants by WebSphere application is installed on the appserver by default. That is, we need not deploy the PlantsByWebSphere.ear file onto the appserver. This application is listed as an installed Sample in the Samples Gallery.
- Install additional Samples.
Additional Samples are initially listed as installable Samples in the Samples Gallery.
To deploy them to the appserver, use the install script in the app_server_root/samples/bin directory. See the Samples Gallery for more detailed instructions.
For information about configuring security for Samples, see the Samples Gallery.
Change the Samples Gallery port number and troubleshooting
If you are unable to access the Samples Gallery, verify the following items.
- Verify that the appserver is running.
- Verify that the samples are installed. In the console, click Applications > Enterprise Applications. Confirm that the Samples Gallery is listed as an installed application.If the Samples Gallery is not listed as an installed application:
- Create a new profile using the default profile template.
- Verify the port number.
The default port is 9080, which is the default value of the HTTP transport of the appserver. If the Samples Web address fails, confirm the port number.
- You must specify a Samples password when using the manageprofiles command to create a profile for which administrative security is enabled. Otherwise, you will be allowed to create the profile successfully, but when you run the appserver containing the Samples, exceptions and failures will be thrown to the server system out log.
Client Samples Gallery contents
The Client Samples Gallery demonstrates the following clients.
- J2EE application client
- Java thin client
- Applet client
- ActiveX to EJB Bridge client
Installing and viewing the Client Samples Gallery
To view the Client Samples Gallery, install the WAS client on a distributed machine.
See Installing Application Client for WAS for more information.
Access the Client Samples Gallery on your local file system at app_server_root/samples/samples/index.html.
Limitations of the Samples
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.
Additional Samples and examples
- Samples on developerWorks
- Additional WAS Samples are available on WebSphere developerWorks
- Samples in tutorials
- Many tutorials rely on Sample code. To find tutorials that demonstrate specific technologies, browse the links in Tutorials.
- Examples in the product documentation
- The product documentation contains many code snippets and examples. To locate these examples easily, see the developer examples in the Reference section of the information center navigation for the product edition that you are using.
- Java Samples on the Sun Microsystems Web site
- Although they do not showcase the capabilities added by purchasing WebSphere Application Server, the Samples on the java.sun.com Web site demonstrate the basic functionality of various technologies.