views:

892

answers:

4

Hi. I am having this error in my j2ee web application.

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.

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

+1  A: 

Try following:

  1. Check that NLS_LANG setting is correct. On windows it is in registry under \HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE.
  2. Check that Oracle client software is correctly installed.
  3. Check if there are multiple Oracle homes on that computer. In that case, find active one and check if it works.
  4. Test with SQL*Plus if there is one installed. Sql Developer works because it has its own client installation.

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.

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:

The NLS_LANG settings are derived from the java.util.Locale . Therefore, you will need to make a call similar to this before connecting:

  Locale.setDefault(Locale.<your locale here>);
zendar
Do I have to install an oracle client for my web app to connect? I thought I just need the odbc driver jar included in my project.
cedric
A: 

check you use the same jdk

wayelheyel
A: 

I figured out that that you could pass that two params to your Java app to resolve the issue:

-Duser.country=en -Duser.language=en

You could configure the values at environment variable level as well (depends from your OS).

FoxyBOA
A: 

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.

kuli_koding