Accessing 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.

Table 1. Quick start - Accessing the Samples Gallery. Start the application server and then view the Samples.

Your application server must be running. The Samples must be installed and running.

[Windows] On Windows® systems, click (for example) Start > Programs > IBM WebSphere > Application Server v7.0 > Profiles > profile_name > Samples Gallery.

You can view the Samples in a Web browser at http://hostname:port/WSsamples. hostname is a variable that represents the application server host name. port is the port number for the application server internal HTTP transport.

For example, http://localhost:9080/WSsamples.

[AIX Solaris HP-UX Linux Windows] [z/OS] Client Samples: app_server_root/samples/index.html (local file system)

The Samples are for demonstration purposes only. See the following limitations for details.

What is new First time here? Read the following information. A little setup is involved.

Samples Gallery contents

The Samples Gallery includes the following materials:
Plants by WebSphere application
This application demonstrates several Java Platform, Enterprise Edition (Java EE) 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 Java EE applications.
Web Services Samples

These Samples demonstrate both Java API for XML-based RPC (JAX-RPC) and Java API for XML Web Services (JAX-WS) Web services that use Java Platform, Enterprise Edition (Java EE) beans and JavaBeans components.

The JAX-WS Web services Samples demonstrate the implementation of one-way and two-way Web services that highlight the use of Web services standards such as WS-Addressing (WS-A) , WS-Reliable Messaging (WS-RM), and WS-Secure Conversation (WS-SC) and the SOAP Message Transmission Optimization Mechanism (MTOM) technology.

Service Data Objects (SDO) Sample
This Sample demonstrates data access to a relational database through Service Data Objects (SDO) and Java DataBase Connectivity (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 product Samples Gallery, perform the following steps.

  1. Install the product.

    [AIX Solaris HP-UX Linux Windows] When specifying installation or profile options, select to install the sample applications.

    [z/OS] See "Configuring the WebSphere Application Server for z/OS® product after installation" in this information center.

    By default, only the Samples Gallery and Plants by WebSphere applications are installed on an application server. However, the Samples are installed in the app_server_root/samples directory. The app_server_root/samples/lib directory contains several installable Samples.

    If you selected to install the sample applications when defining a profile, the Samples are installed in the directory profile_root/installedApps/cell_name. The Sample source code is placed in the directory profile_root/samples/src.

    You can build or modify the Samples source code to support your project.

  2. 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 add the stand-alone application server profile as a managed node of the deployment manager cell.

    For information on adding the node using the administrative console, see Adding, managing, and removing nodes. For information on adding the node using the wsadmin addNode command, see addNode command. For the wsadmin addNode command, use the dmgr_host argument with the -includeapps and -includebuses options.

    [AIX Solaris HP-UX Linux Windows] [z/OS] For example:
    addNode.sh/bat dmgr_hostname -includeapps -includebuses

    where dmgr_hostname is name of the machine that hosts your deployment manager profile.

  3. Start the application server.
  4. Ensure that the Samples Gallery application is running.
    • Using the administrative console, click Applications > Application Types > WebSphere enterprise applications to access the Enterprise applications page. A green arrow beside the application name indicates that the application is running.
    • Using wsadmin, run the AdminControl completeObjectName command to see if the SamplesGallery application is running. See Querying the application state using wsadmin scripting. If the command returns information on the application and deployment target, then the Samples Gallery application is running. If the command returns nothing, then the application is not running.
  5. 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.

    [AIX Solaris HP-UX Linux Windows] [z/OS] The Plants by WebSphere application is installed on the application server by default. That is, you need not deploy the PlantsByWebSphere.ear file onto the application server. This application is listed as an installed Sample in the Samples Gallery.

  6. Install additional Samples.

    Additional Samples are initially listed as installable Samples in the Samples Gallery.

    [AIX Solaris HP-UX Linux Windows] [z/OS] To deploy them to the application server, you can use the administrative console or use the install script in the app_server_root/samples/bin directory. See the Samples Gallery for more instructions.

For information about configuring security for Samples, see the Samples Gallery.

Changing the Samples Gallery port number and troubleshooting

If you are unable to access the Samples Gallery, verify the following items.
  • Verify that the application server is running.
  • Verify that the samples are installed. In the administrative console, click Applications > Application Types > WebSphere enterprise applications . Confirm that the Samples Gallery is listed as an installed application.
    If the Samples Gallery is not in the list of installed applications:
    • Create a new profile using the default profile template.
  • Verify the port number.

    [AIX Solaris HP-UX Linux Windows] [z/OS] The default port is 9080, which is the default value of the HTTP transport of the application server. If the Samples Web address fails, confirm the port number.

    1. In the administrative console navigation frame, click Servers > Server Types > WebSphere application servers.
    2. Click the application server name. For the default application server profile, the server name is server1.
    3. Click Ports.
    4. Verify the WC_defaulthost port number.
    5. If you need to change the port number:
      1. Click WC_defaulthost.
      2. Type the new port number in the Port field.
      3. Click OK.
      4. To save the configuration changes, click Save.
      5. Restart the application server.
      6. Click Save.
  • [AIX Solaris HP-UX Linux Windows] You must specify a Samples password when using the manageprofiles command to create a profile for which administrative security is enabled. Otherwise, you are allowed to create the profile successfully, but when you run the application server containing the Samples, exceptions and failures are thrown to the server system out log.

Client Samples Gallery contents [AIX Solaris HP-UX Linux Windows] [z/OS]

The Client Samples Gallery demonstrates the following clients.
  • J2EE application client
  • Java thin client
  • JAX-WS thin application client
  • Applet client
  • ActiveX to EJB Bridge client
  • Java Web Start Sample

[z/OS] A line mode client is used for the Calculator Client Sample and the MDBSamples client.

Installing and viewing the Client Samples Gallery [AIX Solaris HP-UX Linux Windows]

To view the Client Samples Gallery, install the WebSphere Application Server client on a distributed machine.

See Installing Application Client for WebSphere Application Server for more information.

Access the Client Samples Gallery on your local file system at app_server_root/samples/index.html.

Limitations of the Samples

Additional Samples and examples

Service Component Architecture (SCA) Samples
Samples that support SCA specifications are located in app_server_root/samples/SCA and app_server_root/installableApps. SCA services are packaged in Java archive (JAR) files that you import as assets to the product repository and then add as composition units to business-level applications. For a description of the Samples, refer to readme files in the /samples/SCA directories or SCA Samples.
Samples on developerWorks®
Additional product Samples are available on WebSphere developerWorks
Samples in tutorials
Many product 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 the product, the Samples on the java.sun.com Web site demonstrate the basic functionality of various technologies.



Related concepts
SCA Samples
Related tasks
Installing enterprise application files
Concept topic Concept topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Jun 11, 2013 8:40:09 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v701sca&product=was-nd-mp&topic=covr_samples
File name: covr_samples.html