oracle java.sql.SQLException: ORA-28040: 没有匹配的身份验证协议

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46105649/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 03:27:39  来源:igfitidea点击:

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

oraclejpajdbceclipselink

提问by Mahantesh H

My Application uses JSF Primefaces 5.0, JDK 7, Oracle Database 12, Tomcat 8. It works fine when I deploy my webapp war from within Eclipse on it's integrated Tomcat 8 server (all this happens on Maven build). But when I deploy manually the same war on Tomcat 8 server(using tomcat manager deploy UI) outside Eclipse IDE, I get the below error. Appreciate for any hints for this issue.

我的应用程序使用 JSF Primefaces 5.0、JDK 7、Oracle 数据库 12、Tomcat 8。当我从 Eclipse 中在它的集成 Tomcat 8 服务器上部署我的 webapp war 时它工作正常(所有这些都发生在 Maven 构建上)。但是,当我在 Eclipse IDE 之外的 Tomcat 8 服务器(使用 tomcat 管理器部署 UI)上手动部署相同的War时,我收到以下错误。感谢您对此问题的任何提示。

Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: ORA-28040: No matching authentication protocol Error Code: 28040

异常 [EclipseLink-4002](Eclipse 持久性服务 - 2.5.0.v20130507-3faac2b):org.eclipse.persistence.exceptions.DatabaseException 内部异常:java.sql.SQLException:ORA-28040:没有匹配的身份验证协议错误代码:28040

My persistance.xml file is as below

我的persistance.xml文件如下

<persistence-unit name="myPU" transaction-type="RESOURCE_LOCAL">       <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>com.myco.jpa.Agents</class>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
        <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
        <property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@DBNC-01.MYCO.COM:1521/SCD.MYCO.COM"/>
        <property name="javax.persistence.jdbc.user" value="myname"/>
        <property name="javax.persistence.jdbc.password" value="mypw"/>
    </properties>
</persistence-unit>

回答by Mahantesh H

It worked fine with latest ojdbc driver jar downloaded from http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.htmlNo other changes needed. Thank you for the hints!

它适用于从http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html无需其他更改下载的最新 ojdbc 驱动程序 jar 。谢谢你的提示!

回答by suranga Caldera

this can happen with oracle 12.1,

这可能发生在 oracle 12.1,

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

解决方法:在 oracle/network/admin/sqlnet.ora 文件中设置 SQLNET.ALLOWED_LOGON_VERSION=8。