oracle ORA-00604 ORA-12705
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1629327/
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
ORA-00604 ORA-12705
提问by cedric
I am having this error in my j2ee web application.
我的 j2ee Web 应用程序中出现此错误。
java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-12705: Cannot access NLS data files or invalid environment specified
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:283)
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:278)
oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:785)
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:376)
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:839)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1353)
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1353)
This project works in my colleagues' PCs... I mean this project works for them but when I asked for their project folder and imported it on my eclipse, when i run it i meet this error. The jar files are already packaged with the project folder.
这个项目在我同事的电脑上工作......我的意思是这个项目对他们有用,但是当我要求他们的项目文件夹并将其导入我的 eclipse 时,当我运行它时,我遇到了这个错误。jar 文件已经与项目文件夹一起打包。
I also created a simple j2ee project using hibernate but I had the same error. I tried to ping the DB server and browse it using PL/SQL developer and I don't have any problem with it
我还使用 hibernate 创建了一个简单的 j2ee 项目,但我遇到了同样的错误。我尝试 ping 数据库服务器并使用 PL/SQL 开发人员浏览它,但我没有任何问题
采纳答案by zendar
Try following:
尝试以下操作:
- Check that NLS_LANG setting is correct. On windows it is in registry under
\HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
. - Check that Oracle client software is correctly installed.
- Check if there are multiple Oracle homes on that computer. In that case, find active one and check if it works.
- Test with SQL*Plus if there is one installed. Sql Developer works because it has its own client installation.
- 检查 NLS_LANG 设置是否正确。在 Windows 上,它位于
\HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
. - 检查是否正确安装了 Oracle 客户端软件。
- 检查该计算机上是否有多个 Oracle 主目录。在这种情况下,找到活动的并检查它是否有效。
- 如果安装了 SQL*Plus,请使用 SQL*Plus 进行测试。Sql Developer 可以工作,因为它有自己的客户端安装。
Edit:
Regarding drivers, check this site: Oracle Instant Client. There you will find documentation on minimum drivers installation needed for JDBC access to Oracle. I don't know much about that because I use .Net.
编辑:
关于驱动程序,请查看此站点:Oracle Instant Client。在那里,您将找到有关 JDBC 访问 Oracle 所需的最低驱动程序安装的文档。我对此不太了解,因为我使用 .Net。
Edit 2:
See this question: NLS_LANG setting for JDBC thin driver. There is same error as you have and problem was that default locale for NLS LANG was not defined. Quote:
编辑 2:
请参阅此问题:JDBC 瘦驱动程序的 NLS_LANG 设置。有与您相同的错误,问题是未定义 NLS LANG 的默认语言环境。引用:
The NLS_LANG settings are derived from the java.util.Locale . Therefore, you will need to make a call similar to this before connecting:
NLS_LANG 设置源自 java.util.Locale 。因此,您需要在连接之前进行类似的调用:
Locale.setDefault(Locale.<your locale here>);
回答by FoxyBOA
I figured out that that you could pass that two params to your Java app to resolve the issue:
我发现你可以将这两个参数传递给你的 Java 应用程序来解决这个问题:
-Duser.country=en -Duser.language=en
You could configure the values at environment variable level as well (depends from your OS).
您也可以在环境变量级别配置值(取决于您的操作系统)。
回答by Khai Shen
For Windows env, you need to change the System Locale and System Format
to English/US
.
对于 Windows env,您需要将系统区域设置更改System Format
为English/US
.
回答by athoik
I had the same problem. The solution was to add the country and the language to sqldeveloper.conf
我有同样的问题。解决方案是将国家和语言添加到sqldeveloper.conf
Please open the file:
请打开文件:
\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf
And add the following:
并添加以下内容:
AddVMOption -Duser.language=en
AddVMOption -Duser.region=us
The above does the trick.
以上就是诀窍。
Reference: http://forum.oradba.net/showthread.php?t=423&langid=1
回答by adoniswalker
If you are compiling with intelljIDE I advise you add following options in VMoptions found in configurations model
如果您使用 intelljIDE 进行编译,我建议您在配置模型中的 VMoptions 中添加以下选项
AddVMOption -Duser.region=us.
回答by Each
Oracle JDBC driver implicitly executes following statement after opening new connection:
Oracle JDBC 驱动程序在打开新连接后隐式执行以下语句:
ALTER SESSION SET NLS_LANGUAGE='language' NLS_TERRITORY='territory'
In our case we had problems with Oracle XE 11g and default language/territory mappings embedded into JDBC driver: 'ru' locale was mapped to 'CIS' territory which is supported only by Oracle EE, but Oracle XE had 'RUSSIA' territory only. Here is the way we fixed this:
在我们的案例中,我们遇到了 Oracle XE 11g 和嵌入到 JDBC 驱动程序中的默认语言/区域映射的问题:“ru”区域设置被映射到仅由 Oracle EE 支持的“CIS”区域,但 Oracle XE 仅具有“RUSSIA”区域。这是我们修复此问题的方法:
-Doracle.jdbc.territoryMap="ru=RUSSIA;RU=RUSSIA"
There is option for NLS_LANGUAGE(we had no problems with defaults):
NLS_LANGUAGE 有选项(默认值没有问题):
-Doracle.jdbc.languageMap="ru=RUSSIAN;RU=RUSSIAN"
Fixed: constant ru=RUSSIANtaken from class oracle.sql.converter.CharacterSetMetaData of java jdbc driver.
修正:常量ru=RUSSIAN取自 java jdbc 驱动程序的类 oracle.sql.converter.CharacterSetMetaData。
回答by kuli_koding
I found solution, I just change the regional and language in my OS (windows 7), make sure it matches with the oracle regional and language.
我找到了解决方案,我只是在我的操作系统(Windows 7)中更改区域和语言,确保它与 oracle 区域和语言匹配。
回答by user9556622
First execute query:
首先执行查询:
select userenv('LANGUAGE') from dual;`
This will give oracle regional and language. Change the regional and language in OS, both should match.
这将赋予oracle 区域和语言。更改操作系统中的区域和语言,两者应匹配。
回答by Noemi Fiallos
check the JAVA_HOME system variable and verify that it is the same version you are using in your projects and programs
检查 JAVA_HOME 系统变量并验证它与您在项目和程序中使用的版本相同
回答by Sahibzada Abdul Hadi
Changing the region settings and language of my machine helped to get away with this. I changed region to United States and English (United States) as language.
更改我机器的区域设置和语言有助于解决这个问题。我将地区更改为美国和英语(美国)作为语言。