Hi All,

I am able to connect to the database from backend that is toad.But from the java application i can't . The error is from the line

Connection conn =

      DriverManager.getConnection

      ("jdbc:oracle:thin:@vrs1.india.mitey.com:1591:dapps");

I am getting the following error:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 7
	at oracle.security.o3logon.C1.r(C1)
	at oracle.security.o3logon.C1.l(C1)
	at oracle.security.o3logon.C0.e(C0)
	at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientHelper)
	at oracle.jdbc.ttc7.O3log.<init>(O3log.java:287)
	at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:227)
	at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:198)
	at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
	at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
	at java.sql.DriverManager.getConnection(DriverManager.java:525)
	at java.sql.DriverManager.getConnection(DriverManager.java:171)
	at parts.JdbcTest.main(JdbcTest.java:43)

Pl. kindly help if any ideas pl.kindly suggest.

Dani AI

Generated

Same symptom — an ArrayIndexOutOfBoundsException coming from oracle.security.o3logon during DriverManager.getConnection — almost always points to a client-side driver/classpath problem (not the database or network). The JDBC stack in the trace (the TTC7/O3Logon classes) is a strong clue that an older/incompatible Oracle JDBC implementation is being loaded at runtime; replacing or removing the old driver so the correct ojdbc jar is used fixes this in most cases. (stackoverflow.com)

Checklist to diagnose and isolate the problem quickly:

  • Run a tiny standalone Java program (outside the app server) with only one JDBC jar on the classpath. If it works, the server classpath is the issue.
  • Search the machine for leftover Oracle driver jars (classes12.zip, ojdbc14.jar, ojdbc6.jar, etc.). Duplicate jars or an old classes12.zip in the server/common/lib will cause the old code to load even when a new jar is present. (stackoverflow.com)

Useful quick commands / snippets to try:

Print the runtime classpath:

System.out.println(System.getProperty("java.class.path"));

Find driver jars (Unix):

find / -name "ojdbc*.jar" -o -name "classes12*.zip" 2>/dev/null

On Windows (example):

dir C:\ /s /b *ojdbc*.jar

Most practical fixes

  • Remove any old Oracle driver jars from the app server’s shared/lib or the JRE ext folder. Keep exactly one appropriate driver jar.
  • Use the JDBC jar that matches the JDK and the Oracle release used by the server (for older setups: ojdbc14 for very old JDKs; for Java 6 / Oracle 11g use ojdbc6; for newer Java use the corresponding driver). If the app server bundles an old driver, either update it there or put the correct jar first on the server startup classpath. (stackoverflow.com)

Notes tied to earlier replies: ’s idea of re-creating the driver config is on the right track — but make sure the old jar isn’t still on the server classpath. ’s link to connection-string formats is useful for URL shape, but the stack trace here points to a driver/version conflict rather than a URL or credential problem.

Recommended Answers

All 3 Replies

Hi Pallavi,
Please try deleting driver info & re-create again.
Some data might have been deleted.

Find the complete list of providers here.

Hi,

Thank you for your response.. i tried deleting the entire project.. i changed context.xml and web.xml...

I copied the entire project newly from SVN... Still throwing same error
for others its in other machine database is working but not in my system.

all data is corecct in context.aml and tns.ora also .. all required jar files are present..

I am not able to figure out what s causing problem in connection to this DATABASE..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.