I have apache-tomcat-6.0.35 installed locally on my Windows 7 Machine. I also do have Hiberanate Java application that I am trying to run on Tomcat. The RDBMS used on back end is Oracle 11g and hence I do have Oracle client(11.2.0) installed on my machine. The Java app is using c3p0-0.9.1.2 to create connection pool with Oracle in the back end. All the connection information are stored in tnsnames.ora file.
The entire project code is in Version Control System and hence the exact same code runs with no problem on my co-worker’s machine but Tomcat fails to launch on mine with the following log. I have had this problem since early this year (Feb 2012) but never got it resolved. I am trying one more time to see if anyone can notice something that I am missing. I appreciate your time looking into this issue! Thank you much!
Here is the content from log file after I run the Tomcat Server:
Using CATALINA_BASE: "C:\Users\MyName\.IntelliJIdea11\system\tomcat\Unnamed_cerdoafebd8b4"
Using CATALINA_HOME: "C:\Program Files (x86)\Apache\Tomcat6\apache-tomcat-6.0.35"
Using CATALINA_TMPDIR: "C:\Program Files (x86)\Apache\Tomcat6\apache-tomcat-6.0.35\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.6.0_31"
Using CLASSPATH: "C:\Program Files (x86)\Apache\Tomcat6\apache-tomcat-6.0.35\bin\bootstrap.jar"
...
2012-10-29T03:37:54.054Z INFO [main] EnvironmentProperties - Filtering properties using environment dev
2012-10-29T03:38:51.693Z INFO [main] MLog - MLog clients using log4j logging.
2012-10-29T03:39:40.497Z INFO [main] C3P0Registry - Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
2012-10-29T03:39:45.066Z INFO [main] AbstractPoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@f1bda9a6 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@1091d257 [ acquireIncrement -> 1, acquireRetryAttempts -> 3, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 2zggjq8q1bc3mwlm6u21f|3bf60430, idleConnectionTestPeriod -> 0, initialPoolSize -> 2, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 604800, maxIdleTime -> 7200, maxIdleTimeExcessConnections -> 120, maxPoolSize -> 10, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 2, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@7c977f23 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 2zggjq8q1bc3mwlm6u21f|2bbef4c6, jdbcUrl -> jdbc:oracle:thin:@TRACKER_DEV, properties -> {user=******, .username=cerdo_app, password=******, .password=PEOPLE_WHOUSE_ADHOC, url.dev=jdbc:oracle:thin:@TRACKER_DEV, .url=jdbc:oracle:thin:@DW_DEV, .url.dev=jdbc:oracle:thin:@DW_DEV} ], preferredTestQuery -> select 1 from dual, propertyCycle -> 0, testConnectionOnCheckin -> true, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, factoryClassLocation -> null, identityToken -> 2zggjq8q1bc3mwlm6u21f|293a985, numHelperThreads -> 3 ]
oracle.net.TNSAddress.SOException
at oracle.net.TNSAddress.ServiceAlias.initFromNVPair(Unknown Source)
at oracle.net.TNSAddress.ServiceAlias.initFromString(Unknown Source)
at oracle.net.resolver.AddrResolution.resolveAddrTree(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.ttc7.TTC7Protocol.connect(TTC7Protocol.java:1213)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:209)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:252)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
Look at the properties revealed the line beginning
You’ll find that the JDBC URL you are trying to connect to is jdbc:oracle:thin:@TRACKER_DEV I suspect that your colleague, after checking the app out from source control, runs some kind of a build script to substitute variables like @TRACKER_DEV and @DW_DEV in various config files. (You might find these variables are set in Tomcat config files, or they could be set in c3p0 config files, e.g. c3p0.properties or c3p0-config.xml.) It’s unsurprising you are having connection errors with the JDBC url shown above.
Good luck!