gpt4 book ai didi

java - Tomcat 6 启动时出错

转载 作者:行者123 更新时间:2023-12-02 00:09:36 32 4
gpt4 key购买 nike

我在 Windows 7 计算机上本地安装了 apache-tomcat-6.0.35。我还尝试在 Tomcat 上运行 Hiberanate Java 应用程序。后端使用的 RDBMS 是 Oracle 11g,因此我的计算机上安装了 Oracle 客户端(11.2.0)。 Java应用程序使用c3p0-0.9.1.2在后端与Oracle创建连接池。所有连接信息都存储在tnsnames.ora文件中。

整个项目代码都在版本控制系统中,因此完全相同的代码在我同事的机器上运行没有问题,但 Tomcat 无法在我的机器上启动,并显示以下日志。我从今年年初(2012 年 2 月)就遇到了这个问题,但从未得到解决。我正在尝试一次,看看是否有人能注意到我遗漏的东西。感谢您花时间研究这个问题! 非常感谢!

这是我运行 Tomcat 服务器后日志文件的内容:

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)

最佳答案

如果其他人遇到这个问题,这里是问题和解决方案的详细信息(我与 ThapaKaji 离线合作):

问题最终是 JVM 的类路径上有两个 Oracle 驱动程序,一个是旧的 10g 版本,另一个是较新的 11g 版本(我们发现它是因为“oracle.net.TNSAddress.ServiceAlias”不存在于11g 驱动程序)。它有两个版本而他不知道的原因是旧版本来自隐藏在他的 JDK 的 jre/lib/ext 文件夹中的“classes12.jar”。

问题的解决方案是删除该 JAR,或切换到没有该文件的其他 JRE。

关于java - Tomcat 6 启动时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13116452/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com