Oc4j-Servers
03:45Show all | Close all
-
Overview
-
What is server
In most common use, a server is a physical computer (a computer hardware system) dedicated to run one or more services (as a host), to serve the needs of the users of other computers on the network. Depending on the computing service that it offers it could be a database server, file server, mail server, print server, web server, gaming server, or some other kind of server. In the context of client-server architecture, a server is a computer program running to serve the requests of other programs, the "clients". Thus, the "server" performs some computational task on behalf of "clients". The clients either run on the same computer or connect through the network. In the context of Internet Protocol (IP) networking, a server is a program that operates as a socket listener. Servers often provide essential services across a network, either to private users inside a large organization or to public users via the Internet. -
Usage
The term server is used quite broadly in information technology. Despite the many server-branded products available (such as server versions of hardware, software or operating systems), in theory any computerised process that shares a resource to one or more client processes is a server. To illustrate this, take the common example of file sharing. While the existence of files on a machine does not classify it as a server, the mechanism which shares these files to clients by the operating system is the server. Similarly, consider a web server application (such as the multiplatform "Apache HTTP Server"). This web server software can be run on any capable computer. For example, while a laptop or personal computer is not typically known as a server, they can in these situations fulfill the role of one, and hence be labelled as one. It is, in this case, the machine's role that places it in the category of server. In the hardware sense, the word server typically designates computer models intended for hosting software applications under the heavy demand of a network environment. In this client-server configuration one or more machines, either a computer or a computer appliance, share information with each other with one acting as a host for the other[s]. While nearly any personal computer is capable of acting as a network server, a dedicated server will contain features making it more suitable for production environments. These features may include a faster CPU, increased high-performance RAM, and increased storage capacity in the form of a larger or multiple hard drives. Servers also typically have reliability, availability and serviceability (RAS) and fault tolerance features, such as redundancy in power supplies, storage (as in RAID), and network connections. Servers became common in the early 1990s as businesses increasingly began using personal computers to provide services formerly hosted on larger mainframes or minicomputers. Early file servers housed multiple CD-ROM drives, which were used to host large database applications.[citation needed] Between the 1990s and 2000s an increase in the use of dedicated hardware saw the advent of self-contained server appliances. One well-known product is the Google Search Appliance, a unit that combines hardware and software in an out-of-the-box packaging. Simpler examples of such appliances include switches, routers, gateways, and print server, all of which are available in a near plug-and-play configuration. Modern operating systems such as Microsoft Windows or Linux distributions rightfully seem to be designed with a client-server architecture in mind. These operating systems attempt to abstract hardware, allowing a wide variety of software to work with components of the computer. In a sense, the operating system can be seen as serving hardware to the software, which in all but low-level programming languages must interact using an API. These operating systems may be able to run programs in the background called either services or daemons. Such programs, such as the aforementioned Apache HTTP Server software, may wait in a sleep state for their necessity to become apparent. Since any software that provides services can be called a server, modern personal computers can be seen as a forest of servers and clients operating in parallel. The Internet itself is also a forest of servers and clients. Merely requesting a web page from a few kilometers away involves satisfying a stack of protocols that involve many examples of hardware and software servers. The least of these are the routers, modems, domain name servers, and various other servers necessary to provide us the world wide web. -
Types of servers
In a general network environment the following types of servers may be found. Application server, a server dedicated to running certain software applications Catalog server, a central search point for information across a distributed network Communications server, carrier-grade computing platform for communications networks Database server, provides database services to other computer programs or computers Fax server, provides fax services for clients File server, provides remote access to files Game server, a server that video game clients connect to in order to play online together Home server, a server for the home Name server or DNS Print server, provides printer services Proxy server, acts as an intermediary for requests from clients seeking resources from other servers Sound server, provides multimedia broadcasting, streaming. Standalone server, an emulator for client-server (web-based) programs Web server, a server that HTTP clients connect to in order to send commands and receive responses along with data contents
-
-
OC4J
OC4J is a slimmed down version of Oracle Application Server. For those that have done an OBIEE install, you are familiar with the one installation prompt where you can choose either the standard or advanced option. If you choose advanced you are prompted to provide Oracle Application Server connection information. Otherwise, you are defaulted to OC4J. And, this version of OC4J that you get with OBIEE is a pre-packaged "StandAlone" (or, unmanaged) version that only has a little more than the basic functionality that the full-blown Oracle Application Server (OAS) has. Think of OC4J as OAS-lite. Now to some specifics. OC4J is entirely written in Java. It is a complete J2EE compliant environment that provides all the containers, APIs, and services that enable a J2EE product to run. It runs on the Java Virtual Machine (JVM) which is provided inside of the JDK (version 1.5 or higher). This is the reason why during the install you must actually reference where your JDK install directory exists. It is because it's heavily used by OC4J. All of these relationships to Java is why OC4J stands for Oracle Containers for J2EE. Most people don't even know that OC4J standalone comes with a application server administration tool. You could re-deploy another instance of analytics or deploy any other J2EE compliant application just like you would with WebLogic or WebSphere using OC4J. Remember that password that you entered for OC4JAdmin during the installation? Well just navigate to the following URL on your OC4J installation box, http://:9704/em, enter that password, and presto, you are able to now manage the deployed analytics.war application that got deployed during your OBIEE installation. -
Steps to follow to configure oc4j server
OC4J Readme OC4J ReadMe
========================================= Oracle Containers for J2EE 10g (10.1.3.1) ========================================= OC4J Zip Distribution ReadMe Contents -------- * Introduction * Prerequisites * Extracting OC4J * OC4J Command Script * First Time Initialization * Starting and Stopping OC4J * Directly Starting and Stopping OC4J * Testing the OC4J Installation * Using Application Server Control * Using the admin_client.jar Command Line Utility * Example usages of admin_client.jar Introduction ------------ The Oracle Containers for J2EE (OC4J) zip distribution provides a complete J2EE 1.4 server environment distributed as a simple zip file. The OC4J zip distribution includes an HTTP/S server, all of the required J2EE 1.4 APIs and services, a complete EJB 3.0 and JPA implementation, Oracle TopLink, extensive Web Services capabilities and the browser-based Application Server Control Console management interface to configure the server and deploy applications. Prerequisites -------------- In order to use the OC4J zip distribution, a Java2 Standard Edition (J2SE) SDK version 5.0 (or 1.4.2) must be installed on the host machine. Extracting OC4J --------------- Extract the oc4j_extended.zip file using any archive utility which handles zip files, including the jar utility in the J2SE. The following directory structure will be created:
/ant /bin /diagnostics /j2ee /javacache /javavm /jdbc /jlib /lib /opmn /rdbms /sqlj /toplink /webservices /xqs Where is the directory into which the oc4j_extended.zip file was extracted. OC4J Command Script ------------------- The OC4J zip distribution provides a script that can be used to start and stop a local OC4J instance. The oc4j script is located in the /bin directory. Usage: oc4j [Options] The commands supported by the OC4J command script are: Usage: oc4j [Options] Options: -start : start OC4J -shutdown -port -password : stop OC4J -version : display the version -help : display this message Before using the OC4J command script, the following environment variables must be set: ORACLE_HOME : directory where oc4j_extended.zip was extracted. JAVA_HOME : location of the J2SE SDK to be used. For example, if oc4j_extended.zip was extracted to /java/oc4j-10131 and the J2SDK was installed in /java/j2se15 then JAVA_HOME and ORACLE_HOME would be set as: JAVA_HOME=/java/j2se15 ORACLE_HOME=/java/oc4j-10131 First Time Initialization ------------------------- There are no specific tasks that need to be performed to ready the new OC4J instance for use. The new OC4J instance can be used immediately after the unzip operation has completed. ** Note: on the first use of OC4J, you will be prompted to enter a password for the OC4J administrator account. The username for this account defaults to "oc4jadmin". Change to the /bin directory, and issue the following command: > cd /bin > oc4j -start Starting OC4J from /java/oc4j-10131/j2ee/home ... ... 06/08/23 13:57:17 Set OC4J administrator's password (password text will not be displayed as it is entered) Enter password: ****** Confirm password: ******** The password for OC4J administrator "oc4jadmin" has been set. 06/08/23 13:57:17 The OC4J administrator "oc4jadmin" account is activated. 06/08/23 13:57:22 The OC4J administrator "oc4jadmin" account is activated. 06/08/23 13:57:31 Oracle Containers for J2EE 10g (10.1.3.1.0) initialized OC4J is configured with a set of defaults that includes a Web site from which deployed applications and the management console can be accessed. These are provided so OC4J can be started and used immediately without requiring additional configuration tasks to be performed. Starting and Stopping OC4J -------------------------- The OC4J command script can be used to start and stop OC4J processes. Start OC4J using the command script as follows: >cd /bin >oc4j -start Starting OC4J from /java/oc4j-10131/j2ee/home ... 06/08/23 14:00:38 Oracle Containers for J2EE 10g (10.1.3.1.0) initialized Stop OC4J using the command script as follows: >cd /bin >oc4j -shutdown -port 23791 -password welcome Shutdown OC4J instance... Where : -port specifies the ORMI port in use with the local OC4J process. -password specifies the administration password entered as described in the "Basic Installation" section of this document. Directly Starting and Stopping OC4J ----------------------------------- In addition to the OC4J command script, it possible to directly start OC4J using oc4j.jar on the command line. Directly start OC4J server by changing to the J2EE_HOME directory and issuing one of the following commands: Option 1: Start OC4J using the default configuration files, which are located in the j2ee/home/config directory. > cd /j2ee/home > java -jar oc4j.jar Option 2: Start OC4J using a customized server.xml OC4J configuration file located in a non-default directory (/mypath). > cd /j2ee/home > java -jar oc4j.jar -config /mypath/server.xml The server outputs an initialization string with the version number when it is ready to accept requests. For example: Oracle Containers for J2EE 10g (10.1.3.1.0) initialized Stop OC4J using one of these methods: - Use the "stop" button from within Application Server Control - Use the shutdown command in the admin_client.jar command-line utility - Press ^c (Ctrl+c) in the window where the process was started - Use the process termination command (for example "kill" on Unix/Linux) for the operating system in use.OC4J will indicate on the console window that it is shutting down when it receives a shutdown signal. Testing the OC4J Installation ----------------------------- Test the installation by starting the OC4J instance and accessing the welcome page from a Web browser. http:// :8888 Where is the name of the server on which OC4J is running. The OC4J welcome page will be displayed. On the right hand side of the welcome page is a portlet with links to enable the testing of the JSP and Servlet environments using standard examples. If the default port number in the default-web-site.xml file has been changed, access the Web server using : http:// : Where is the value specified in the "port" attribute of the element in the file. Using Application Server Control Console ---------------------------------------- The OC4J zip distribution contains the JMX-based Application Server Control Console, which enables you to perform server configuration tasks as well as deploy and manage applications. Application Server Control Console provides: + JSR-77 management and JSR-88 based deployment support + Extensive deployment support, including a comprehensive deployment plan editor + Configuration and management support for Web Services + An MBean browser for directly accessing OC4J System MBeans as well as application-specific MBeans + A JNDI browser Application Server Control Console is configured to be auto-deployed when the OC4J instance is started for the first time. Application Server Control Console can be accessed using the URL: http:// :8888/em To logon to Application Server Control Console use the "oc4jadmin" username and the password you set during the first initialization of OC4J. Using the admin_client.jar Command-Line Utility ----------------------------------------------- OC4J provides a command-line utility, admin_client.jar,that can be used to perform operations on a running OC4J instance. Among other things, you can use admin_client.jar to restart and stop OC4J, deploy applications, and configure various resources. The admin_client.jar utility can operate against OC4J instances running in a standalone mode or when in an Oracle Application Server environment. Note: the admin_client.jar utility is the replacement utility of the earlier admin.jar. It operates using the OC4J MBeans and the J2EE Deployment API. It has a similar usage model to admin.jar but provides more comprehensive support for deployment operations. The admin_client.jar utility uses ORMI to connect to a running OC4J process. This means OC4J must be started before using the utility. Note that OC4J can't be started using admin_client.jar. The admin_client.jar utility is exercised using the following command: > java -jar admin_client.jar Usage Notes: - The deployment URI specifies the target OC4J on which to perform the specified command. A deployment URI can be one of three forms OC4J Standalone: deployer:oc4j:hostname:ormi_port deployer:oc4j:localhost:23791 deployer:oc4j:localhost (defaults to 23791) Oracle Application Server - Single Instance: deployer:oc4j:opmn://opmn_host:opmn_port/oc4jInstanceName deployer:oc4j:opmn://localhost:6003/home deployer:oc4j:opmn://localhost/home (defaults to 6003) Oracle Application Server - Group: deployer:cluster:opmn://opmn_host:opmn_port/groupName deployer:cluster:opmn://localhost/Colors - The admin_user should be specified as "oc4jadmin" by default. - The admin_pwd is the "oc4jadmin" account password you configured during the first time initialization of the OC4J instance. Use the -help option see all of the available admin_client.jar commands. > java -jar admin_client.jar -help Use the -usage option to see detailed information for a specific command. > java -jar admin_client.jar -usage > java -jar admin_client.jar -usage deploy Example usages of admin_client.jar ---------------------------------- Note: all these examples are executed from within the /j2ee/home directory. To restart OC4J: > java -jar admin_client.jar deployer:oc4j:localhost oc4jadmin -restart To shutdown OC4J: > java -jar admin_client.jar deployer:oc4j:localhost oc4jadmin -shutdown To deploy a WAR: >java -jar admin_client.jar deployer:oc4j:localhost oc4jadmin -deploy -file -deploymentName -contextRoot
Versions
Versions:
- Oracle9iAS (1.0.2.2)
- Oracle9iAS (1.0.2.3)
- OC4j 10g (10.0.3)
How to configure oc4j in eclispe
Eclipse Corner Article |
WTP Tutorials - Deploy Web Applications to the Oracle Application Server
Summary
This tutorial will step you through the details of deploying a Web Application to the Oracle Application Server Containers for J2EE (OC4J). By Raghu Srinivasan, Oracle Corporation.
October 27, 2005
Introduction
The Eclipse Web Tools Platform project release 1.0 M8 has added support for deploying Web Applications to the Oracle Application Server Containers for J2EE (OC4J). This tutorial will step you through the details of installing and configuring the Oracle Application Server Container for J2EE (OC4J) and deploying a Web Applications from the Eclipse Web Tools Platform to the Oracle Application Server.Getting Started
This section will walk you through the software that you need to download, install and configure. Following is the list of software you will need to install:- Java 2 Platform, Standard Edition(J2SE) 1.4
- Eclipse and WTP
- Oracle Application Server Containers for J2EE (OC4J
Java 2 Platform, Standard Edition(J2SE) 1.4
You must first install the Jaav2 Platform, Standard Edition (J2SE) version 1.4.2. You can get the latest release of J2SE 1.4.2 from the Sun's web site.. Install the JDK.
Eclipse and WTP
You need to download and install the WTP 1.0 release build. Download the WTP all-in-one package. It includes the complete set of software to start using wtp immediately.Oracle Application Server Containers for J2EE (OC4J)
And finally, you need to download, install and configure the Oracle Application Server Containers for J2EE (OC4J). The server adapter in the WTP 1.0 release is certified for the OC4J 10g (10.1.3.0.0) release.The Oracle Application Server Containers for J2EE (OC4J) zip distribution provides a complete J2EE 1.4 server environment, distributed as a simple zip file. You can download the server from the Oracle download site.
Extract OC4J
Extract the oc4j_extended_101300.zip file using any archive utility which handles zip files, including the jar utility in the J2SE.Initialize OC4J
You need to start the OC4J instance once to set the password for the OC4J administrator account. The username for this account defaults to "oc4jadmin". Set the following environment variables:- JAVA_HOME: Directory where J2SE was installed
- ORACLE_HOME: Directory where oc4j_extended_101300.zip was extracted.
- JAVA_HOME=C:\j2sdk1.4.2_09
- ORACLE_HOME=C:\Oracle\oc4j
- oc4j -start

Stop the server.From the bin directory of oc4j, issue the following command:
- Starting OC4J from C:\Oracle\oc4j\j2ee\home ...
- 05/10/20 14:09:58 Set OC4J administrator's password (password text will not be displayed as it is entered)
- Enter password:
- Confirm password:
- Confirm password: The password for OC4J administrator "oc4jadmin" has been set.
- 05/10/20 14:10:41 The OC4J administrator "oc4jadmin" account is activated.
- 05/10/20 14:10:51 Oracle Containers for J2EE 10g (10.1.3.0.0) -Developer Preview 4 initialized
- oc4j -shutdown -port 23791 -password admin password

- User name of the OC4J administrator account is oc4jadmin.
- The password for the administrator account.
Run a Web Application on the Oracle Application Server
In this section you will build a simple JSP Web Application, deploy and run it on the Oracle Application Server. Following is the list of tasks:- Create a server
- Build a JSP Web Application
- Deploy and Run the Web Application
Create a Server
Launch Eclipse.Open the J2EE perspective; select Window > Open Perspective > Other menu and in the resulting dialog, choose J2EE. The J2EE perspective includes the Servers view, which is the focus for the rest of the tutorial.
You will also need the Console view to see the output of the Server. Select Window > Show View > Console menu.

$EclipseInstallFolder\eclipse\eclipse.exe -vm "$J2SEInstallFolder\bin\javaw.exe" -clean -data "$WorkspaceFolder"
where $EclipseInstallFolder is folder where you installed Eclipse and $WorkspaceFolder is where you want to create new or access an existing Eclipse workspace.
Figure 1 shows the Eclipse Workbench displaying the J2EE perspective. Note the Servers view and the Console view.
Figure 1. The Eclipse Workbench with the Servers view and the Console view.

Register the JDK you installed with Eclipse.
- Open Windows>Preferences.
- Select Java>Installed Runtimes.
- Select the Add button and in the resulting dialog, add the JDK you installed above.

Right-click in the Servers View and select New > Server menu. This launches the New Server wizard.
Figure 2 shows the New Server Wizard with the Generic Oracle OC4J Standalone 10.1.3 DP4 Runtime selected.
Figure 2. The New Server Wizard

- In the Define a New Server panel, Select Oracle > Generic Oracle OC4J Standalone Server 10.1.3 DP4. Click Next.
- In the Define a new Generic Oracle OC4J Standalone 10.1.3 DP4 Runtime panel,
- For JRE, select the JDK you registered above.
- For Oracle J2EE Home, browse to the subdirectory j2ee\home in the folder where you installed the Oracle Application Server. Click Next.
Figure 3. Register the Generic Oracle OC4J Standalone 10.1.3 DP4 Runtime
- In the Create a new Generic Oracle OC4J Standalone 10.1.3 DP4 server panel,
- Set the password to the password for the administrator account you created during the Oracle Application Server install.
- Accept the defaults for all the other fields. Click Finish.
Figure 4. Oracle OC4J Standalone 10.1.3 DP4 Preview server in the Servers view

Build a JSP Web Application
You will now build a simple JSP application that you will then run on the server. The Eclipse WTP web site has a several tutorials that can help you build sophisticated applications using the WTP tools.The first step to build a JSP application is to create a Dynamic Web Project.
- From the ProjectExplorer view, right-click on the Dynamic Web Projects folder and select New Dynamic Web Project menu.
- Enter a name for the project, say, DemoOC4J.
- Click on the button, ShowAdvanced.
- Note that the Target runtime field is pre-populated with the entry for OC4J: Generic Oracle OC4J Standalone 10.1.3 DP4.
- Accept the default values for all the fields in this dialog. Click Finish.
- Open the Dynamic Web projects folder. Expand the project you created to the WebContent folder.
- Right-click on the WebContent folder and select New JSP menu.
- Enter a name for the file, say, index.jsp. Click Finish.
- The file is opened in a JSP Editor. Enter the text between the body tags:
<% out.print("Hello World!!"); %>
- Save the file.
Deploy and Run the Web Application
Right-click on the jsp file, index.jsp, in the ProjectExplorer. Select Run As > Run on Server menu.In the Run On Server dialog, ensure that the server, Oracle OC4J Standalone Server v10.1.3 DP4 Preview, is selected. Click on Finish.
The Eclipse WTP tool will now do the following:
- Package the Web Application
- Start the server if it is not running
- Publish the Web Application to the Server
- Launch the application in a browser
Figure 5. Running the application on Oracle OC4J Standalone 10.1.3 DP4 Preview server.

Conclusion
In this tutorial you have learned to configure the Eclipse Web Tools Platform Project to deploy and run a web application on the Oracle Application Server. The WTP web site has articles and tutorials that explain the numerous tools provided in WTP to help you build and deploy web applications. The Oracle web site has extensive resources to help you explore the capabilities of the Oracle Application Server.References
Download
Cilck here to download application server
0 comments: