ORA-28040: No matching authentication protocol : Oracle 12c Upgrade
Asked Answered
G

8

5

We have migrated our Oracle database to 12c from 11g. We have a legacy application running in Java 1.5 and using ojdbc14.jar.

Our application is not able to create connection to database error saying :

java.sql.SQLException: ORA-28040: No matching authentication protocol

I reffered to answer ORA-28040: No matching authentication protocol exception, and tried to upgrade my ojdbc14.jar to ojdbc6.jar.

I now have a different error message saying :

  error: OracleCallableStatement is not public in oracle.jdbc.driver; cannot be accessed from outside package
import oracle.jdbc.driver.OracleCallableStatement;
                          ^
error: OracleTypes is not public in oracle.jdbc.driver; cannot be accessed from outside package
            cstmt.registerOutParameter(3,oracle.jdbc.driver.OracleTypes.CURSOR);
                                           ^

Ant build file :

<javac srcdir="${src}" destdir="${classes}" source="1.5" target="1.5">
            <classpath refid="cpath" />
</javac>

Not sure what exactly we should do to get the application working.

Galliett answered 30/6, 2015 at 14:41 Comment(0)
J
5

I had the same error with 2 different applications recently:

  1. a Java 7 app on Tomcat 7 using odbc6.jar with Oracle 12 c database.
  2. a legacy ASP application with Oracle 12 c database.

The second solution mentioned in the same post you referred to - worked well for us.

Workaround: Set SQLNET.ALLOWED_LOGON_VERSION=8 in the oracle/network/admin/sqlnet.ora file.

We worked with our DBAs to set the above option on the sqlnet.ora on the database server. This resolved our issue. I hope it helps someone.

Jordison answered 23/7, 2015 at 12:58 Comment(0)
M
4

I faced the same error.

Got it resolved by without removing ojdbc14.jar.

step 1 : set SQLNET.ALLOWED_LOGON_VERSION=8

Step 2 : change

Connection conn = (Connection) DriverManager.getConnection("jdbc:oracle:thin:@server:port:sid", "username", "passwrd");

to

java.sql.Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@@server:port:sid", "username", "passwrd");

It will works!

Marceau answered 11/6, 2017 at 18:36 Comment(0)
A
2

After migrating from Oracle 11 to Oracle 12. In my case lib directory had both OJDBC14.jar & OJDBC8.jar. After removing older OJDBC14.jar it worked for me.

Accomplished answered 8/2, 2018 at 11:18 Comment(0)
H
0

I had a problem connecting to DB after migration to ORACLE 12c. The error was:java.sql.SQLException: ORA-28040: No matching authentication protocol. After setting this parametar SQLNET.ALLOWED_LOGON_VERSION=8 it was solved.

Thank you very much

Havoc answered 25/12, 2015 at 10:46 Comment(0)
B
0

If you are migrating your application to ojdbc6, one probable reason would be your old classes (compatible to old ojdbc version) might not be getting the class OracleTypes. Easiest way would be changing import statement from import oracle.jdbc.driver.OracleTypes; to import oracle.jdbc.OracleTypes; from the classes where you are getting the error.

Beware answered 8/3, 2016 at 14:17 Comment(0)
C
0

I was getting ORA-28040 in Sqldeveloper (ver. 1.5.5) for all connections. I set SQLNET.ALLOWED_LOGON_VERSION=8 but the error didn't go away. Then I enabled "Use OCI/Thick driver" under Tools->Preferences->Database->Advanced Parameters. That did the trick.

Considerable answered 10/7, 2019 at 22:24 Comment(0)
A
0

The main problem is that the JDBC thin client of the 10g uses the SHA-1 authentication protocol, this protocol is not allowed in the 12c, so it gives the error.

In my Oracle I could not find the sqlnet.ora file so I had to create it with the command:

vi $ORACLE_HOME/network/admin/sqlnet.ora

And I added the following:

SQLNET.ALLOWED_LOGON_VERSION=10
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=10
SQLNET.ALLOWED_LOGON_VERSION_SERVER=10
SQLNET.ALLOWED_LOGON_VERSION=8
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8
SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
SQLNET.AUTHENTICATION_SERVICES = (NONE)

So I had to stop and start the listener:

lsnrctl stop
lsnrctl start

Finally, I restart the database.

This should only be a workaround

Adoration answered 14/11, 2019 at 9:49 Comment(0)
K
0

We had this error when we moved from 11g to 12c, I am able to get correct response through tnsping "servername" (this is the first step that we need to check through cmd). After this we realize that database server is enable to handle only 64bit request (In my case I was using WinSQL and it always check for 32bit). So to correct this, ask your admin to eanble server for 32 bit request as well or you can move to SQL developer which work for me.

Kerrill answered 18/2, 2020 at 6:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.