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
| Component | Used in this guide |
|---|---|
| Application server | WebLogic Server 14.1.1, domain base_domain on Oracle Linux |
| Admin Server | AdminServer · http://adminhost:7001/console |
| Managed Server | app_server1 · port 8001 |
| Java | JDK 11 |
| Database | Oracle 19c · dbhost:1521/ORCLPDB1 · schema app_user |
| Application | sample-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
{AES256}.03Start the Admin Server and the Managed Server
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
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.
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.
- Click Lock & Edit (unless the domain is in automatic-activation mode).
- Services → Data Sources → New → Generic Data Source.
- Name: AppDS. JNDI Name: jdbc/AppDS. Database Type: Oracle. Click Next.
- Driver: Oracle's Driver (Thin) for Service connections; Versions: Any. Click Next.
- Keep the transaction options (non-XA, "Supports Global Transactions" with One-Phase Commit). Click Next.
- Database Name: ORCLPDB1 (the service name). Host: dbhost. Port: 1521. User and password: the schema account. Click Next.
- Click Test Configuration. You need Connection test succeeded. Click Next.
- Target it to app_server1, then click Finish and Activate Changes.
# 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:
| Setting | Value | Why |
|---|---|---|
| Initial / Minimum Capacity | 2 | Connections kept open and ready |
| Maximum Capacity | 20 | Ceiling 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 Name | SQL ISVALID | Uses the driver's fast isValid() check instead of a real query |
| Inactive Connection Timeout | 300 | Reclaims connections the application forgot to close (leak safety net) |
| Statement Cache Size | 10 (default) or higher | Fewer 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.
- Lock & Edit, then Deployments → Install.
- Browse to /u01/app/oracle/apps/sample-app.war and select it. Click Next.
- Choose Install this deployment as an application. Click Next.
- Target app_server1. Click Next.
- Keep the defaults. Click Finish, then Activate Changes.
- Deployments → Control: tick the application, then Start → Servicing all requests.
- State becomes Active.
# 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)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
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
| Symptom | Likely cause | Fix |
|---|---|---|
| Connection test failed: IO Error: The Network Adapter could not establish the connection | Wrong host or port, firewall, listener down | nc -zv dbhost 1521; check the listener on the DB server |
| ORA-12514 listener does not know of service | SID entered as Database Name, or wrong service | Use the service name and the "Service connections" driver |
| ORA-01017 invalid username/password | Wrong schema password, or the account is locked | Fix it in AppDS → Connection Pool → Password; check dba_users on the DB |
| javax.naming.NameNotFoundException: jdbc/AppDS | JNDI mismatch, or data source not targeted to that server | Compare the JNDI name with the app; check AppDS → Targets |
| Deployment state Failed / Prepared | Error during deploy, or not started | Read the server log; Control → Start → Servicing all requests |
| Managed Server stuck in STARTING / asks for a password | No boot.properties, or the Admin URL is wrong | Create boot.properties; the second argument must be t3://adminhost:7001 |
| weblogic.common.resourcepool.ResourceLimitException: No resources currently available | Pool exhausted: slow SQL or leaking connections | Check the DB for long-running SQL; enable Inactive Connection Timeout; raise Max Capacity only after that |
$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

