Oracle JDBC connection exception in Solaris but not Windows?
Posted
by lupefiasco
on Stack Overflow
See other posts from Stack Overflow
or by lupefiasco
Published on 2010-03-23T16:17:30Z
Indexed on
2010/03/23
19:23 UTC
Read the original article
Hit count: 504
I have some Java code that connects to an Oracle database using DriverManager.getConnection(). It works just fine on my Windows XP machine. However, when running the same code on a Solaris machine, I get the following exception. Both machines can reach the database machine on the network. I have included the Oracle trace logs.
Mar 23, 2010 12:12:33 PM org.apache.commons.configuration.ConfigurationUtils locate
FINE: ConfigurationUtils.locate(): base is /users/theUser/ADCompare, name is props.txt
Mar 23, 2010 12:12:33 PM org.apache.commons.configuration.ConfigurationUtils locate
FINE: Loading configuration from the path /users/theUser/ADCompare/props.txt
Mar 23, 2010 12:12:33 PM oracle.jdbc.driver.OracleDriver connect
FINE: OracleDriver.connect(url=jdbc:oracle:thin:@//theServer:1521/theService, info)
Mar 23, 2010 12:12:33 PM oracle.jdbc.driver.OracleDriver connect
FINER: OracleDriver.connect() walletLocation:(null)
Mar 23, 2010 12:12:33 PM oracle.jdbc.driver.OracleDriver parseUrl
FINER: OracleDriver.parseUrl(url=jdbc:oracle:thin:@//theServer:1521/theService)
Mar 23, 2010 12:12:33 PM oracle.jdbc.driver.OracleDriver parseUrl
FINER: sub_sub_index=12, end=46, next_colon_index=16, user=17, slash=18, at_sign=17
Mar 23, 2010 12:12:33 PM oracle.jdbc.driver.OracleDriver parseUrl
FINER: OracleDriver.parseUrl(url):return
Mar 23, 2010 12:12:33 PM oracle.jdbc.driver.OracleDriver connect
FINER: user=theUser, password=******, database=//theServer:1521/theService, protocol=thin, prefetch=null, batch=null, accumulate batch result =true, remarks=null, synonyms=null
Mar 23, 2010 12:12:33 PM oracle.jdbc.driver.PhysicalConnection <init>
FINE: PhysicalConnection.PhysicalConnection(ur="jdbc:oracle:thin:@//theServer:1521/theService", us="theUser", p="******", db="//theServer:1521/theService", info)
Mar 23, 2010 12:12:33 PM oracle.jdbc.driver.PhysicalConnection <init>
FINEST: PhysicalConnection.PhysicalConnection() : connectionProperties={user=theUser, password=******, protocol=thin}
Mar 23, 2010 12:12:33 PM oracle.jdbc.driver.PhysicalConnection initialize
FINE: PhysicalConnection.initialize(ur="jdbc:oracle:thin:@//theServer:1521/theService", us="theUser", access)
Mar 23, 2010 12:12:33 PM oracle.jdbc.driver.PhysicalConnection initialize
FINE: PhysicalConnection.initialize(ur, us):return
Mar 23, 2010 12:12:33 PM oracle.jdbc.driver.PhysicalConnection needLine
FINE: PhysicalConnection.needLine()--no return
java.lang.ArrayIndexOutOfBoundsException: 31
at oracle.net.nl.NVTokens.parseTokens(Unknown Source)
at oracle.net.nl.NVFactory.createNVPair(Unknown Source)
at oracle.net.nl.NLParamParser.addNLPListElement(Unknown Source)
at oracle.net.nl.NLParamParser.initializeNlpa(Unknown Source)
at oracle.net.nl.NLParamParser.<init>(Unknown Source)
at oracle.net.resolver.TNSNamesNamingAdapter.loadFile(Unknown Source)
at oracle.net.resolver.TNSNamesNamingAdapter.checkAndReload(Unknown Source)
at oracle.net.resolver.TNSNamesNamingAdapter.resolve(Unknown Source)
at oracle.net.resolver.NameResolver.resolveName(Unknown Source)
at oracle.net.resolver.AddrResolution.resolveAndExecute(Unknown Source)
at oracle.net.ns.NSProtocol.establishConnection(Unknown Source)
at oracle.net.ns.NSProtocol.connect(Unknown Source)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1037)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:282)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:468)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:839)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
The above exception is also thrown if I use OracleDataSource instead of the generic DriverManager.getConnection().
Any ideas on why the behavior is different in the different environments?
© Stack Overflow or respective owner