Ant1.8.2 is deployed on machine 241 and oracle11g is deployed on machine 242. the following error is reported when ant1.8.2 is used to insert data to the oracle11g environment through the oracle driver.
Ant 1.8.2 is deployed on machine 241 and oracle 11g is deployed on machine 242. the following error is reported when ant 1.8.2 is used to insert data to the oracle 11G environment through the oracle driver.
Ant 1.8.2 is deployed on machine 241 and Oracle 11g is deployed on machine 242. the following error is reported when ant 1.8.2 is used to insert data to the oracle 11G environment through the oracle DRIVER:
Builddb:
BUILD FAILED
/Home/build. xml: 10: java. SQL. SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-12705: Cannot access NLS data files or invalid environment specified
At oracle. jdbc. driver. DatabaseError. throwSqlException (DatabaseError. java: 112)
At oracle. jdbc. driver. T4CTTIoer. processError (T4CTTIoer. java: 331)
At oracle. jdbc. driver. T4CTTIoer. processError (T4CTTIoer. java: 28
At oracle. jdbc. driver. T4CTTIoer. processError (T4CTTIoer. java: 278)
At oracle. jdbc. driver. T4CTTIoauthenticate. receiveOauth (T4CTTIoauthenticate. java: 785)
At oracle. jdbc. driver. T4CConnection. logon (T4CConnection. java: 362)
At oracle. jdbc. driver. PhysicalConnection. (PhysicalConnection. java: 414)
At oracle. jdbc. driver. T4CConnection. (T4CConnection. java: 165)
At oracle. jdbc. driver. T4CDriverExtension. getConnection (T4CDriverExtension. java: 35)
At oracle. jdbc. driver. OracleDriver. connect (OracleDriver. java: 801)
At org. apache. tools. ant. taskdefs. JDBCTask. getConnection (JDBCTask. java: 370)
At org. apache. tools. ant. taskdefs. SQLExec. getConnection (SQLExec. java: 942)
At org.apache.tools.ant.taskdefs.SQLExec.exe cute (SQLExec. java: 614)
At org.apache.tools.ant.UnknownElement.exe cute (UnknownElement. java: 291)
At java. lang. reflect. Method. invoke (libgcj. so.7rh)
At org.apache.tools.ant.dispatch.DispatchUtils.exe cute (DispatchUtils. java: 106)
At org. apache. tools. ant. Task. perform (job. java: 348)
At org.apache.tools.ant.Target.exe cute (Target. java: 390)
At org. apache. tools. ant. Target. extends mtasks (Target. java: 411)
At org.apache.tools.ant.Project.exe cuteSortedTargets (Project. java: 1399)
At org.apache.tools.ant.Project.exe cuteTarget (Project. java: 1368)
At org.apache.tools.ant.helper.DefaultExecutor.exe cuteTargets (DefaultExecutor. java: 41)
At org.apache.tools.ant.Project.exe cuteTargets (Project. java: 1251)
At org. apache. tools. ant. Main. runBuild (Main. java: 809)
At org. apache. tools. ant. Main. startAnt (Main. java: 217)
At org. apache. tools. ant. launch. Launcher. run (Launcher. java: 280)
At org. apache. tools. ant. launch. Launcher. main (Launcher. java: 109)
Total time: 2 seconds
According to the "ORA-12705" error number, found that many people give the following solution:
. Check whether the following variables are set correctly (invalid environment specified)
NLS_LANG, ORA_NLSxx, or ORACLE_HOME
2. Check whether the nlb files (nls data files) in the $ ORACLE_HOME/NLS/data directory are damaged. You can back up the files and copy them from other identical environments.
Solution 1 was ruled out because it was previously well-tested and never changed environment variables.
The amazing discovery of the $ ORACLE_HOME directory surprised me both the surprise and the excitement. the surprise was that the NLS directory was lost, and I was excited that I had another machine installed with Oracle11g. it seems that the operating system has been close to each other in the past few years. Needless to say, copy one copy.
According to the preceding solution, check the "NLS_LANG, ORA_NLSxx, or ORACLE_HOME" parameter of the oracle server (242). If the first two parameters are not set, set these two parameters, the problem persists (the problem persists after the machine is restarted ).
So I found the third machine (marked as the 243 machine) and executed the same ant script on the 243 machine. I found that the script can be correctly executed. It is initially suspected that the environment variables of machines 241 and 243 are different. By using the env command, we compared the environment variables of the two machines, and found that machine 243 has set java_home, java_home is not set on the 241 machine, so the value of java_home is quickly set (java_home setting reference :). Then, disconnect the previous connection, create a new connection, execute the ant command, and the data is inserted successfully.
Summary: here took a detour, mainly ORA-12705 error to people too much error information, during the attempt to read the jdbc driver, did not find any special problem. When key information cannot solve the problem, the stupid method (comparative method) is often very effective.