This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes Error Using JDrivers to Connect to Oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Error Using JDrivers to Connect to Oracle" Watch "Error Using JDrivers to Connect to Oracle" New topic

Error Using JDrivers to Connect to Oracle

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I'm getting the following error when using dbping connect to an ORACLE db using JDriver! Any ideas as I am hitting my head against a very hard brick wall with this one!
+++ WebLogic Native Layer for OCI 8.x (BETA-2)

---------- LOGIN ERROR CODE: 24327
Error encountered:
java.sql.SQLException: ORA-24327: need explicit attach before authenticating a u
ser - (user/password/********)
at weblogic.db.oci.OciConnection.getLDAException(
at weblogic.jdbcbase.oci.Driver.connect(
at java.sql.DriverManager.getConnection(
at java.sql.DriverManager.getConnection(
at utils.dbping.main(
Shin Hashitani
Ranch Hand

Joined: Dec 04, 2001
Posts: 54
Hi Richard and everyone,
I am having the exact same problem.
Windows 2000 / Oracle 9i Enterprise eval. / WebLogic 6.1 sp2 eval / WebLogic JDBC Kona/Oracle Type 2 JDBC Driver Version: 5.1.0sp11
*Everything is running local
I am able to connect to DB with SQL Plus by using the same user, password, and service. Also, I was recommended to use tnsping, and in that case I got TNS-03505 error. (Why SQL Plus let me connect and tnsping can't find DB is my another question...)
Here is my setEnv:
set ORACLE_HOME=C:\weblogic\oci
set ORACLE_LB=E:\oracle\bin;E:\oracle\jlib;e:\oracle\lib;e:\oracle\jdbc\lib;e:\oracle\oci\lib
set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\lib\weblogic_sp.jar;%WL_HOME%\lib\weblogic.jar;%CLASSPATH%
set PATH=%WL_HOME%\bin;%JAVA_HOME%\bin;%ORACLE_LB%;%ORACLE_HOME%\bin\oci817_8;%PATH%
I followed "Using JDriver for Oracle" document I got from I am not even sure whether this is WebLogic problem or Oracle problem.
If you have any idea,
please let me know.
Thank you.

/*<br /> * Quants Inc.<br /> * Engineer<br /> *<br /> * Shin Hashitani<br /> *<br /> * <a href="" target="_blank" rel="nofollow"></a><br />*/
Gordon Jenkinson

Joined: Feb 03, 2002
Posts: 14
If TNSPING does not work it could mean that there is no listener running on the server. The reason you can get in using SQL*Plus is probably due to the fact that Oracle is running locally and the conenction is via IPC (Inter-Process communication) not SQL*Net.
I assume you are using a host string something like the following.

jdbc racle:thin:@hostname:1521 BNAME
This will require an Oracle listener on port 1521 on the host machine.
To check if a listener is running you can type 'lsnrctl status' at the command line and it should show you a list of databases and the ports it's listening on.


Gordon Jenkinson
Shin Hashitani
Ranch Hand

Joined: Dec 04, 2001
Posts: 54
Hi Gordon,
As you suggested, I tried "lsnrctl status". The listener was not found...
From listener.ora:
(ADDRESS = (PROTOCOL = TCP)(HOST = main)(PORT = 1521))
(ORACLE_HOME = E:\oracle)
(SID_NAME = bge)
And from tnsnames.ora:
(ADDRESS = (PROTOCOL = TCP)(HOST = main)(PORT = 1521))
I thought above means the listener was running. In "Service" control, OracleOraHomeTNSListener is also running.
I guess I just encountered some basic Oracle configuration problem. I need to dig into some Oracle documentation and figure this one out.
Since now it's clear that this is an Oracle related problem, I stop asking questions on this board. However, when I find the solution, I will post it here just in case somebody else encounters this problem in future.
But it was a great advance for me to know that this was an Oracle problem. I really appreciate your posting.
Well, it's time to do some Oracle work.
Shin Hashitani
Shin Hashitani
Ranch Hand

Joined: Dec 04, 2001
Posts: 54
Finally I found the problem.

First Problem: tnsping error
I could not use namesctl or lsnrctl properly, either.
In my setEnv.cmd, I created new "ORACLE_HOME" variable, and that wiped out system ORACLE_HOME. fixing this let me use tnsping, namesctl, and lsnrctl.
Second Problem: dbping
java utils.dbping ORACLE pass user server
This still gives me an error. But:
java utils.dbping ORACLE pass user
I omitted the optional server parameter, and I got "success!!" message.
Well, those mistakes were kind of dumb. But I did go thorugh a lot of Oracle documentation, and I learned a lot from it.

Shin Hashitani
Raja Valavan

Joined: Jun 26, 2002
Posts: 1
Currently we are facing the problem. We set our initial no of connection as 300. It is able to make certain no of connections. After that it is throwing "LOGIN ERROR - 24327" error. I checked the no of process in Oracle. It is 400. Can any one help us to resolve this problem?
Don't get me started about those stupid light bulbs.
subject: Error Using JDrivers to Connect to Oracle
It's not a secret anymore!