1. Setup Unix environments (user/group ids, filesystems, tools, access - sudo, etc.)
2. Install WebLogic, JDK, Web Application Development Tools (ant, XML editors EditiX)
3. If production requires middle tier High Availability, setup Veritas VCS application agent monitoring java process and filesystems. I posted a Weblogic HA setup procedure in 2002 at THIS SITE.
4. Setup Web Application Containers in Weblogic environment
Weblogic Admin port 7001
Variables:
export JRE_HOME=/opt/SDK/jdk
export JAVA_HOME=/opt/SDK/jdk
export CLASSPATH=/data/lib/servlet-api.jar
Sample servlet WAR structure:
myServletWAR\
META-INF\
WEB-INF\
classes\
HelloServlet.class
web.xml
web.xml deployment descriptor
<servlet>
web.xml
<servlet>
<servlet-name>myHello</servlet-name>
<servlet-class>HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>myHello</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
<servlet-name></servlet-name></servlet><servlet-mapping><url-pattern></url-pattern>
</servlet-mapping>
Sample Weblogic Installation:
The following Products and JDKs will be installed:
--------------------------------------------------
WebLogic Platform 10.3.2.0
|_____WebLogic Server
| |_____Core Application Server
| |_____Administration Console
| |_____Configuration Wizard and Upgrade Framework
| |_____Web 2.0 HTTP Pub-Sub Server
| |_____WebLogic SCA
| |_____WebLogic JDBC Drivers
| |_____Third Party JDBC Drivers
| |_____WebLogic Server Clients
| |_____WebLogic Web Server Plugins
| |_____UDDI and Xquery Support
|_____Oracle Enterprise Pack for Eclipse
| |_____Common Files
|_____JDKs
|_____Sun SDK 1.6.0_14
|_____Oracle JRockit 1.6.0_14 SDK
*Estimated size of installation: 1,251.9 MB
Production Mode
Sun SDK 1.6
JRocket SDK 1.6
admin server ipc4.shanjing.com:7001
Startup of Weblogic
./wlserver_10.3/samples/domains/wl_server/
-bash-3.00$ ./startWebLogic.sh
.
.
JAVA Memory arguments: -Xms512m -Xmx512m
.
WLS Start Mode=Development
.
CLASSPATH=/data/weblogic/mw/wlserver_10.3/samples/server/examples/build/serverclasses:/data/weblogic/mw/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/data/weblogic/mw/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/data/weblogic/mw/jrockit_160_14_R27.6.5-32/lib/tools.jar:/data/weblogic/mw/utils/config/10.3/config-launch.jar:/data/weblogic/mw/wlserver_10.3/server/lib/weblogic_sp.jar:/data/weblogic/mw/wlserver_10.3/server/lib/weblogic.jar:/data/weblogic/mw/modules/features/weblogic.server.modules_10.3.2.0.jar:/data/weblogic/mw/wlserver_10.3/server/lib/webservices.jar:/data/weblogic/mw/modules/org.apache.ant_1.7.0/lib/ant-all.jar:/data/weblogic/mw/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar::/data/weblogic/mw/wlserver_10.3/common/eval/pointbase/lib/pbembedded57.jar:/data/weblogic/mw/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:/data/weblogic/mw/wlserver_10.3/server/lib/xqrl.jar
.
PATH=/data/weblogic/mw/wlserver_10.3/server/bin:/data/weblogic/mw/modules/org.apache.ant_1.7.0/bin:/data/weblogic/mw/jrockit_160_14_R27.6.5-32/jre/bin:/data/weblogic/mw/jrockit_160_14_R27.6.5-32/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
.
***************************************************
* To start WebLogic Server, use a username and *
* password assigned to an admin-level user. For *
* server administration, use the WebLogic Server *
* console at http://hostname:port/console *
***************************************************
starting weblogic with Java version:
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
BEA JRockit(R) (build R27.6.5-32_o-121899-1.6.0_14-20091001-2113-linux-ia32, compiled mode)
Starting WLS with line:
/data/weblogic/mw/jrockit_160_14_R27.6.5-32/bin/java -jrockit -Xms512m -Xmx512m -Dweblogic.Name=examplesServer -Djava.security.policy=/data/weblogic/mw/wlserver_10.3/server/lib/weblogic.policy -Xverify:none -da -Dplatform.home=/data/weblogic/mw/wlserver_10.3 -Dwls.home=/data/weblogic/mw/wlserver_10.3/server -Dweblogic.home=/data/weblogic/mw/wlserver_10.3/server -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=/data/weblogic/mw/patch_wls1032/profiles/default/sysext_manifest_classpath:/data/weblogic/mw/patch_oepe1032/profiles/default/sysext_manifest_classpath weblogic.Server
<Dec 1, 2009 7:41:58 PM PST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with BEA JRockit(R) Version R27.6.5-32_o-121899-1.6.0_14-20091001-2113-linux-ia32 from BEA Systems, Inc.>
<Dec 1, 2009 7:41:59 PM PST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.2.0 Tue Oct 20 12:16:15 PDT 2009 1267925 >
<Dec 1, 2009 7:42:04 PM PST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<Dec 1, 2009 7:42:04 PM PST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool>
<Dec 1, 2009 7:42:05 PM PST> <Notice> <Log Management> <BEA-170019> <The server log file /data/weblogic/mw/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/logs/examplesServer.log is opened. All server side log events will be written to this file.>
<Dec 1, 2009 7:42:13 PM PST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<Dec 1, 2009 7:42:27 PM PST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
<Dec 1, 2009 7:42:27 PM PST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<Dec 1, 2009 7:42:52 PM PST> <Notice> <Store> <BEA-280067> <JDBC store "exampleJDBCStore" did not find a database table at "examplesWLStore", so it created one using the commands in file "/weblogic/store/io/jdbc/ddl/pointbase.ddl".>
<Dec 1, 2009 7:43:25 PM PST> <Warning> <EJB> <BEA-010202> <Call-by-reference is not enabled for the EJB 'ReviewListenerBean'. The server will have better performance if it is enabled. To enable call-by-reference, set the enable-call-by-reference element to True in the weblogic-ejb-jar.xml deployment descriptor or corresponding annotation for this EJB.>
<Dec 1, 2009 7:43:25 PM PST> <Warning> <EJB> <BEA-010202> <Call-by-reference is not enabled for the EJB 'ReviewManagerBean'. The server will have better performance if it is enabled. To enable call-by-reference, set the enable-call-by-reference element to True in the weblogic-ejb-jar.xml deployment descriptor or corresponding annotation for this EJB.>
129 reviewService INFO [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.Runtime - Starting BEA Kodo 4.2.0
131 reviewService INFO [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.PointbaseDictionary".
WARN: Creating new records from /META-INF/data.properties
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
After the server has booted, your browser should
automatically launch and point to the
Oracle WebLogic Server Samples Introduction Page
running on this server. If your browser fails to launch,
point your browser to the following URL:
"http://192.168.1.104:7001/examplesWebApp/index.jsp"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[LoginFilter]: LoginFilter constructed ...
<Dec 1, 2009 7:46:38 PM PST> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.>
<Dec 1, 2009 7:46:41 PM PST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN>
<Dec 1, 2009 7:46:41 PM PST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING>
<Dec 1, 2009 7:46:44 PM PST> <Notice> <Security> <BEA-090171> <Loading the identity certificate and private key stored under the alias DemoIdentity from the jks keystore file /data/weblogic/mw/wlserver_10.3/server/lib/DemoIdentity.jks.>
<Dec 1, 2009 7:46:45 PM PST> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /data/weblogic/mw/wlserver_10.3/server/lib/DemoTrust.jks.>
<Dec 1, 2009 7:46:45 PM PST> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /data/weblogic/mw/jrockit_160_14_R27.6.5-32/jre/lib/security/cacerts.>
<Dec 1, 2009 7:46:46 PM PST> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=KEYNECTIS ROOT CA,OU=ROOT,O=KEYNECTIS,C=FR". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
<Dec 1, 2009 7:46:46 PM PST> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=T-TeleSec GlobalRoot Class 3,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
<Dec 1, 2009 7:46:46 PM PST> <Notice> <Security> <BEA-090898> <Ignoring the trusted CA certificate "CN=T-TeleSec GlobalRoot Class 2,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE". The loading of the trusted certificate list raised a certificate parsing exception PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11.>
<Dec 1, 2009 7:46:48 PM PST> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure[3]" is now listening on 127.0.0.1:7002 for protocols iiops, t3s, ldaps, https.>
<Dec 1, 2009 7:46:48 PM PST> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure[2]" is now listening on 0:0:0:0:0:0:0:1:7002 for protocols iiops, t3s, ldaps, https.>
<Dec 1, 2009 7:46:48 PM PST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on fe80:0:0:0:20c:29ff:fe07:b3ab:7001 for protocols iiop, t3, ldap, snmp, http.>
<Dec 1, 2009 7:46:48 PM PST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.1.104:7001 for protocols iiop, t3, ldap, snmp, http.>
<Dec 1, 2009 7:46:48 PM PST> <Notice> <Server> <BEA-002613> <Channel "Default[3]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.>
<Dec 1, 2009 7:46:48 PM PST> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 0:0:0:0:0:0:0:1:7001 for protocols iiop, t3, ldap, snmp, http.>
<Dec 1, 2009 7:46:48 PM PST> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure" is now listening on 192.168.1.104:7002 for protocols iiops, t3s, ldaps, https.>
<Dec 1, 2009 7:46:48 PM PST> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure[1]" is now listening on fe80:0:0:0:20c:29ff:fe07:b3ab:7002 for protocols iiops, t3s, ldaps, https.>
<Dec 1, 2009 7:46:48 PM PST> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "examplesServer" for domain "wl_server" running in Development Mode>
Exception in thread "Thread-14" java.lang.InternalError: Can't connect to X11 window server using '192.168.1.71:0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$100(X11GraphicsEnvironment.java:52)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:155)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:131)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:89)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at java.awt.Toolkit$2.run(Toolkit.java:834)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:826)
at java.awt.Desktop.isDesktopSupported(Desktop.java:151)
at java.awt.Desktop.getDesktop(Desktop.java:125)
at examples.webapp.lifecycle.OpenBrowserServletContextListener.openBrowser(Unknown Source)
at examples.webapp.lifecycle.OpenBrowserServletContextListener.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
<Dec 1, 2009 7:46:55 PM PST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
<Dec 1, 2009 7:46:55 PM PST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
Terms:
Web Application Container normally in a WAR file - contains an application's resources such as:
a. servlets (java class)
b. JavaServer Pages (JSPs)
c. JSP tag libraries
d. any static resources such as html pages, image files etc.
Servlets - java class, HTTP Servlet - html inside Java
JSP - JavaServer Pages - java inside html
Weblogic provides J2EE (Java Enterprise Environment) environment and services/APIs to web application containers, this services include EJBs,
database connections (JDBC), Java Messaging Sevice (JMS), XML and more.
Servlets
A servlet is a Java class that runs in a Java-enabled server. An HTTP servlet is a special type of servlet that handles an HTTP request and provides an HTTP response, usually in the form of an HTML page. The most common use of WebLogic HTTP Servlets is to create interactive applications using standard Web browsers for the client-side presentation while WebLogic Server handles the business logic as a server-side process. WebLogic HTTP servlets can access databases, Enterprise JavaBeans, messaging APIs, HTTP sessions, and other facilities of WebLogic Server.
WAR files
Web Archive Files - A WAR file contains
a. one servlet/one JSP along with helper classes,
b. a weblogic.xml deployment descriptor, an XML document containing Weblogic Server specific elements for web applcations
c. optional web.xml deployment descriptor, XML file describes the contents of the war file
d. any static html pages/image files
The WAR file can be deployed alone or packaged in an Enterprise application archive (EAR file) with other application components. If deployed alone,
the archive must end with a .war extension. If deployed in an EAR file, the archive must end with an .ear extension.
Oracle recommends that you package and deploy your stand-alone Web applications as part of an Enterprise application. This is an Oracle best practice,
which allows for easier application migration, additions, and changes. Also, packaging your applications as part of an Enterprise application allows
you to take advantage of the split development directory structure, which provides a number of benefits over the traditional single directory structure.
EAR file (Enterprise Application Archive) .ear file, the .WAR file can be deployed alone or packaged in an EAR file.
JSPs and HTTP servlets can access all services and APIs available in WebLogic Server. These services include EJBs, database connections by way of
Java Database Connectivity (JDBC), Java Messaging Service (JMS), XML, and more.