1) Make sure the listener is running
Go to Services and check for the OracleTNSListener and start it if needed
2) Make sure XE is running.
Go to Services and check for the OracleServiceXE and start it if needed
Then try the connection again. If that does not work, then
3) Fire up a command prompt and run:
lsnrctl status
It should come back with something like this:
C:\temp>lsnrctl status
LSNRCTL for 64-bit Windows: Version 19.0.0.0.0 - Production on 06-APR-2020 08:59:55
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=15h21)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 19.0.0.0.0 - Production
Start Date 20-MAR-2020 19:47:07
Uptime 16 days 13 hr. 12 min. 47 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\oracle\product\19\network\admin\listener.ora
Listener Log File C:\oracle\diag\tnslsnr\gtx\listener19\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1519ipc)))
Services Summary...
Service "db19" has 1 instance(s).
Instance "db19", status READY, has 1 handler(s) for this service...
Service "pdb1" has 1 instance(s).
Instance "db19", status READY, has 1 handler(s) for this service...
The command completed successfully
Look for your the "listening endpoints" and the "services summary"
So in my case, my SQL Dev entries would then be:
host = localhost
port = 1521
service = pdb1
For XE, the service is normally XEPDB1. I suspect your listener might either be stopped or perhaps listening on a different IP address to localhost.