5 Sample Application and Code Examples

Through a custom installation and selecting to install the Server Examples, you have access to code examples and sample applications that offer several approaches to learning about and working with WebLogic Server.

API Examples

WebLogic Server optionally installs API code examples in WL_HOME\samples\server\examples\src\examples, where WL_HOME is the top-level directory of your WebLogic Server installation, and makes them available from the Start menu. On Linux and other platforms the Examples Server can be started from the WL_HOME/samples/domains/wl_server directory.

The default administration username and password for the Examples domain is weblogic/welcome1.


If you change the password of the user weblogic, WebLogic Server may fail to boot. For more information and workarounds, see "Limitation Regarding User weblogic" in Oracle Fusion Middleware Managing Server Startup and Shutdown for Oracle WebLogic Server.

The examples are grouped in the following categories; the directory that contains the examples of a particular category is in parentheses:

  • Database Connectivity (jdbc): Use DataSources, MultiDataSources, and Rowsets.

  • EJB (ejb): Create stateless, stateful, entity, and message-driven EJBs, and more.

  • Internationalization (i18n): Internationalize an application using simple message catalogs.

  • Messaging (jms): Use JMS topics, queues, and message-driven beans.

  • Resource Adapter (resadapter): Use an entity EJB to interact with a Java EE Connector resource adapter.

  • Security (security): Configure authentication, authorization, and SSL.

  • Transactions (jta): Use JTA to perform distributed transactions using the two phase commit protocol across two XA resources.

  • Web Application (webapp): Create simple servlets and JSPs, use the HTTP Publish-Subscribe server, and more.

  • Web Services (webservices): Create a variety of Web Services using JWS annotations.

  • XML (xml): Use the StAX API and XMLBeans.

  • Cluster (cluster): Cluster an EJB and use HTTP session state replication.

  • WebLogic Scripting Tool (wlst): Use the WebLogic Scripting Tool (WLST) to configure and manage a running WebLogic Administration Server.

  • Split Development (splitdir): Use the WebLogic split development directory structure to build, package, and deploy Enterprise Applications.

Avitek Medical Records

Avitek Medical Records (or "MedRec") is a comprehensive educational sample application that demonstrates WebLogic Server and Java EE features, as well as best practices. If you select to install the Server Examples, Avitek Medical Records is available from the Start menu on Windows machines. On Linux and other platforms it can be started from the WL_HOME/samples/domains/medrec directory, where WL_HOME is the top-level installation directory for WebLogic Server.

In this release, a new sample application, MedRec (Spring) demonstrates Spring application development practices.

The default administration username and password for the Medical Records domain is weblogic/welocome1.

PointBase Licensing Restriction

PointBase Server is an all-Java DBMS product included in the WebLogic Server distribution that is intended solely to support WebLogic Server evaluation, either in the form of custom trial applications or through packaged sample applications provided with WebLogic Server. Documentation is located in the WL_HOME/common/eval/pointbase/docs/ directory. Non-evaluation development and/or production use of the PointBase Server requires a separate license that can be obtained by the end user directly from PointBase at http://www.pointbase.com.