Weblogic 14c sample WAR installation



WebLogic still runs a huge share of enterprise Java applications, especially in banking. As a DBA you are often the person asked to "just set up the data source", or to find out why the application cannot reach the database after a deployment.

This guide deploys a sample web application (WAR) on WebLogic 14c, connected to Oracle 19c. Every task is shown two ways, in the Admin Console and with WLST, so you can click through it once and script it from then on.



Environment

ComponentUsed in this guide
Application serverWebLogic Server 14.1.1, domain base_domain on Oracle Linux
Admin ServerAdminServer · http://adminhost:7001/console
Managed Serverapp_server1 · port 8001
JavaJDK 11
DatabaseOracle 19c · dbhost:1521/ORCLPDB1 · schema app_user
Applicationsample-app.war · data source JNDI jdbc/AppDS

Prerequisites: WebLogic is installed and the domain with its Managed Server already exists; the application schema exists in the database; port 1521 is open from the app server to the database; and you can copy files to the server and log in to it.

01Check Java and WebLogic

Log in to the server over SSH (PuTTY on Windows is fine) and confirm the versions. WebLogic 14.1.1 is certified on JDK 8 and JDK 11. The newer 14.1.2 moves to JDK 17 and 21.

java -version

export MW_HOME=/u01/app/oracle/middleware
export DOMAIN_HOME=/u01/app/oracle/config/domains/base_domain

. $DOMAIN_HOME/bin/setDomainEnv.sh
java weblogic.version              # prints the exact WebLogic version and patch level

ls $DOMAIN_HOME/servers            # AdminServer  app_server1

02Avoid typing passwords: boot.properties

Without this file every start script stops and asks for the admin user and password. Create it once for each server. WebLogic encrypts the values the first time the server starts.

for s in AdminServer app_server1; do
  mkdir -p $DOMAIN_HOME/servers/$s/security
  printf "username=weblogic\npassword=<admin-password>\n" > $DOMAIN_HOME/servers/$s/security/boot.properties
  chmod 600 $DOMAIN_HOME/servers/$s/security/boot.properties
done
Check: after the next start, open the file. Both values should now begin with {AES256}.

03Start the Admin Server and the Managed Server

Admin Server (port 7001)
cd $DOMAIN_HOME/bin
nohup ./startWebLogic.sh > $DOMAIN_HOME/servers/AdminServer/logs/AdminServer.nohup 2>&1 &

# wait for: <Server state changed to RUNNING>
tail -f $DOMAIN_HOME/servers/AdminServer/logs/AdminServer.log
Managed Server (port 8001)
nohup ./startManagedWebLogic.sh app_server1 t3://adminhost:7001 \
      > $DOMAIN_HOME/servers/app_server1/logs/app_server1.nohup 2>&1 &

tail -f $DOMAIN_HOME/servers/app_server1/logs/app_server1.log

The second argument is always the Admin Server URL (port 7001 here), not the Managed Server's own port. Then open http://adminhost:7001/console and check Environment → Servers: both servers should be RUNNING.

Node Manager: for production, start servers through Node Manager so WebLogic can restart a crashed Managed Server automatically. The scripts above are fine for a single server or a lab.

04Create the JDBC data source

Collect these first: the database host, port and service name (not the SID), the schema user and its password, and the JNDI name the application expects. Ask the development team for the exact name.

🖱 IN THE ADMIN CONSOLE
  1. Click Lock & Edit (unless the domain is in automatic-activation mode).
  2. Services → Data Sources → New → Generic Data Source.
  3. Name: AppDS. JNDI Name: jdbc/AppDS. Database Type: Oracle. Click Next.
  4. Driver: Oracle's Driver (Thin) for Service connections; Versions: Any. Click Next.
  5. Keep the transaction options (non-XA, "Supports Global Transactions" with One-Phase Commit). Click Next.
  6. Database Name: ORCLPDB1 (the service name). Host: dbhost. Port: 1521. User and password: the schema account. Click Next.
  7. Click Test Configuration. You need Connection test succeeded. Click Next.
  8. Target it to app_server1, then click Finish and Activate Changes.
⌨ WITH WLST (SCRIPTABLE)
# create_ds.py  ->  $MW_HOME/oracle_common/common/bin/wlst.sh create_ds.py
import jarray
from java.lang import String

connect('weblogic', '<admin-password>', 't3://adminhost:7001')
edit(); startEdit()

ds = cmo.createJDBCSystemResource('AppDS')
r  = ds.getJDBCResource(); r.setName('AppDS')
r.getJDBCDataSourceParams().setJNDINames(jarray.array([String('jdbc/AppDS')], String))

d = r.getJDBCDriverParams()
d.setUrl('jdbc:oracle:thin:@//dbhost:1521/ORCLPDB1')
d.setDriverName('oracle.jdbc.OracleDriver')
d.setPassword('<schema-password>')
d.getProperties().createProperty('user').setValue('app_user')

p = r.getJDBCConnectionPoolParams()
p.setInitialCapacity(2); p.setMinCapacity(2); p.setMaxCapacity(20)
p.setTestConnectionsOnReserve(True); p.setTestTableName('SQL ISVALID')

ds.addTarget(getMBean('/Servers/app_server1'))
save(); activate(block='true')
disconnect()

Tune the connection pool

Open AppDS → Configuration → Connection Pool (and click Advanced). These are sensible starting values:

SettingValueWhy
Initial / Minimum Capacity2Connections kept open and ready
Maximum Capacity20Ceiling per server. Check the database PROCESSES limit against the total of every pool
Test Connections On Reserve✔Never hand a dead connection to the application, e.g. after a DB restart
Test Table NameSQL ISVALIDUses the driver's fast isValid() check instead of a real query
Inactive Connection Timeout300Reclaims connections the application forgot to close (leak safety net)
Statement Cache Size10 (default) or higherFewer parses on the database for repeated SQL

05Deploy the WAR

Copy the WAR to the server, with WinSCP or with scp sample-app.war oracle@apphost:/u01/app/oracle/apps/. Keep deployments in their own directory, outside the Oracle Home.

🖱 IN THE ADMIN CONSOLE
  1. Lock & Edit, then Deployments → Install.
  2. Browse to /u01/app/oracle/apps/sample-app.war and select it. Click Next.
  3. Choose Install this deployment as an application. Click Next.
  4. Target app_server1. Click Next.
  5. Keep the defaults. Click Finish, then Activate Changes.
  6. Deployments → Control: tick the application, then Start → Servicing all requests.
  7. State becomes Active.
⌨ WITH WLST (SCRIPTABLE)
# WLST
connect('weblogic', '<admin-password>', 't3://adminhost:7001')
deploy('sample-app', '/u01/app/oracle/apps/sample-app.war',
       targets='app_server1', upload='false')
disconnect()

# or weblogic.Deployer (after setDomainEnv.sh)
java weblogic.Deployer -adminurl t3://adminhost:7001 -username weblogic \
     -deploy -name sample-app -source /u01/app/oracle/apps/sample-app.war \
     -targets app_server1
# (it prompts for the password)
Redeploying a new version? Use Update in the console, or redeploy('sample-app') in WLST, instead of deleting and installing again. It keeps the deployment settings.

06Test the application

curl -I http://apphost:8001/sample-app/

An HTTP 200 or 302 means it is serving. Then open http://apphost:8001/sample-app/ in a browser. Note it is the Managed Server port, not the console port.

To confirm the application really uses the pool, open AppDS → Monitoring → Statistics and watch Active Connections Current Count while you use the application.

07Stop the servers

cd $DOMAIN_HOME/bin
./stopManagedWebLogic.sh app_server1 t3://adminhost:7001
./stopWebLogic.sh

Stop Managed Servers first, then the Admin Server.

08Housekeeping

Over time a Managed Server's tmp and cache directories can hold stale copies of old deployments. Clearing them fixes many "my new version is not showing up" problems, but only while that server is stopped:

./stopManagedWebLogic.sh app_server1 t3://adminhost:7001
rm -rf $DOMAIN_HOME/servers/app_server1/tmp $DOMAIN_HOME/servers/app_server1/cache
./startManagedWebLogic.sh app_server1 t3://adminhost:7001
Do not delete the data/ or security/ directories under servers/. They hold persistent stores and security data (on the Admin Server, the embedded LDAP). Deleting them can break the domain.

For logs, configure rotation instead of deleting files by hand: Servers → app_server1 → Logging → rotate by size (for example 50 MB) and limit the number of retained files.

Troubleshooting

SymptomLikely causeFix
Connection test failed: IO Error: The Network Adapter could not establish the connectionWrong host or port, firewall, listener downnc -zv dbhost 1521; check the listener on the DB server
ORA-12514 listener does not know of serviceSID entered as Database Name, or wrong serviceUse the service name and the "Service connections" driver
ORA-01017 invalid username/passwordWrong schema password, or the account is lockedFix it in AppDS → Connection Pool → Password; check dba_users on the DB
javax.naming.NameNotFoundException: jdbc/AppDSJNDI mismatch, or data source not targeted to that serverCompare the JNDI name with the app; check AppDS → Targets
Deployment state Failed / PreparedError during deploy, or not startedRead the server log; Control → Start → Servicing all requests
Managed Server stuck in STARTING / asks for a passwordNo boot.properties, or the Admin URL is wrongCreate boot.properties; the second argument must be t3://adminhost:7001
weblogic.common.resourcepool.ResourceLimitException: No resources currently availablePool exhausted: slow SQL or leaking connectionsCheck the DB for long-running SQL; enable Inactive Connection Timeout; raise Max Capacity only after that
Logs to read first: $DOMAIN_HOME/servers/<server>/logs/<server>.log for server and deployment errors, and the .out or nohup file for anything printed during startup.

Summary

Check the versions → create boot.properties → start the Admin then the Managed Server → create and test the data source → tune the pool → deploy → verify on the Managed Server port. Once it works in the console, save the WLST scripts. The next environment is then a two-minute job, and it comes out identical every time.

Do you still run WebLogic in production? Share your tips in the comments.

Tamilselvan Perumal · Lead Product Engineer & Senior DBA