wood burning stoves 2.0*
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
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Error Using JDrivers to Connect to Oracle" Watch "Error Using JDrivers to Connect to Oracle" New topic
Author

Error Using JDrivers to Connect to Oracle

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi,
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(OciConnection.java:143)
at weblogic.jdbcbase.oci.Driver.connect(Driver.java:157)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at utils.dbping.main(dbping.java:156)
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 ORACLE_LICENSE=%ORACLE_HOME%\license
...
set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\lib\weblogic_sp.jar;%WL_HOME%\lib\weblogic.jar;%CLASSPATH%
set CLASSPATH=%ORACLE_HOME%\classes;%ORACLE_LICENSE%;%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 edocs.bea.com. 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 /> * hashitani@quants.co.jp<br /> * <a href="http://www.quants.co.jp" target="_blank" rel="nofollow">www.quants.co.jp</a><br />*/
Gordon Jenkinson
Greenhorn

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.

HTH


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:
BGE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = main)(PORT = 1521))
)
SID_LIST_BGE =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = bge.book)
(ORACLE_HOME = E:\oracle)
(SID_NAME = bge)
)
)
And from tnsnames.ora:
BGE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = main)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = bge.book)
)
)
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.
Thanks!
Sincerely,
Shin Hashitani
Shin Hashitani
Ranch Hand

Joined: Dec 04, 2001
Posts: 54
Horray!
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.
Thanks!

Shin Hashitani
Raja Valavan
Greenhorn

Joined: Jun 26, 2002
Posts: 1
Hi
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error Using JDrivers to Connect to Oracle