c3p0数据源链接异常 高人入内

dc2002007 2009-08-16 05:36:42
信息: Illegal access: this web application instance has been stopped already. Could not load com/microsoft/util/transliteration.properties. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
2009-8-16 17:32:46 org.apache.catalina.loader.WebappClassLoader loadClass
信息: Illegal access: this web application instance has been stopped already. Could not load java.text.MessageFormat. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
2009-08-16 17:32:46 [com.mchange.v2.resourcepool.BasicResourcePool]-[DEBUG] Refurbishing idle resources - Sun Aug 16 17:32:46 CST 2009 [com.mchange.v2.resourcepool.BasicResourcePool@10b7338]
2009-08-16 17:32:46 [com.mchange.v2.resourcepool.BasicResourcePool]-[DEBUG] trace com.mchange.v2.resourcepool.BasicResourcePool@10b7338 [managed: 5, unused: 5, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@19f99ae)
2009-08-16 17:32:46 [com.mchange.v2.resourcepool.BasicResourcePool]-[DEBUG] An exception occurred while acquiring a resource.
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error opening/loading com.microsoft.util.transliteration.properties.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSConnection.setNonUnicodeTransliterator(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSConnection.setSQLCollation(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processEnvChange(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSLoginRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:88)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:109)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.acquireResource(C3P0PooledConnectionPool.java:89)
at com.mchange.v2.resourcepool.BasicResourcePool.acquireUntil(BasicResourcePool.java:665)
at com.mchange.v2.resourcepool.BasicResourcePool.access$500(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1206)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:368)

spring的xml配置

<!-- msSQLserver带连接池的数据源 -->
<bean id="mssql"
class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close" dependency-check="none">
<!-- msSQLserver -->
<property name="driverClass">
<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
</property>
<property name="jdbcUrl">
<value>jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=ddd</value>
</property>

<property name="user">
<value>sa</value>
</property>
<property name="password">
<value></value>
</property>
<property name="acquireIncrement">
<value>5</value>
</property>
<property name="initialPoolSize">
<value>10</value>
</property>
<property name="minPoolSize">
<value>5</value>
</property>
<property name="maxPoolSize">
<value>15</value>
</property>
<property name="maxIdleTime">
<value>300</value>
</property>
<property name="idleConnectionTestPeriod">
<value>300</value>
</property>
<property name="maxStatements">
<value>30</value>
</property>
<property name="numHelperThreads">
<value>10</value>
</property>
<property name="acquireRetryAttempts">
<value>30</value>
</property>
<property name="breakAfterAcquireFailure">
<value>true</value>
</property>
<property name="testConnectionOnCheckout">
<value>false</value>
</property>
</bean>


...全文
780 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
jianchencool 2009-08-17
  • 打赏
  • 举报
回复
为了使配置更加灵活,建议将连接信息放在一个文件里。 注意JAR包的导入<!-- 加载配置文件(连接池连接信息) -->
<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:init.properties </value>
</property>
</bean>
<!-- 连接池的配置 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" dependency-check="none">
<property name="driverClass">
<value>${datasource.driverClassName} </value>
</property>
<property name="jdbcUrl">
<value>${datasource.url} </value>
</property>
<property name="user">
<value>${datasource.username} </value>
</property>
<property name="password">
<value>${datasource.password} </value>
</property>
<property name="acquireIncrement">
<value>${c3p0.acquireIncrement} </value>
</property>
<property name="initialPoolSize">
<value>${c3p0.initialPoolSize} </value>
</property>
<property name="minPoolSize">
<value>${c3p0.minPoolSize} </value>
</property>
<property name="maxPoolSize">
<value>${c3p0.maxPoolSize} </value>
</property>
<property name="maxIdleTime">
<value>${c3p0.maxIdleTime} </value>
</property>
<property name="idleConnectionTestPeriod">
<value>${c3p0.idleConnectionTestPeriod} </value>
</property>
<property name="maxStatements">
<value>${c3p0.maxStatements} </value>
</property>
<property name="numHelperThreads">
<value>${c3p0.numHelperThreads} </value>
</property>
</bean>

init.properties配置文件信息
datasource.driverClassName=org.gjt.mm.mysql.Driver
datasource.url=jdbc:mysql://localhost:3306/database?useUnicode=true&characterEncoding=UTF-8
datasource.username=root
datasource.password=

c3p0.acquireIncrement=3
c3p0.initialPoolSize=3
c3p0.idleConnectionTestPeriod=900
c3p0.minPoolSize=2
c3p0.maxPoolSize=50
c3p0.maxStatements=100
c3p0.numHelperThreads=10
c3p0.maxIdleTime=600
Jajiel 2009-08-17
  • 打赏
  • 举报
回复
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error opening/loading com.microsoft.util.transliteration.properties
properties文件的配置有问题:
——————---------
<property name="user">
<value>sa </value>
</property>
<property name="password">
<value> </value>
配置文件用户名(sa )之后最好不要有空格
你的密码你都没有写
你自己检查下配置文件,配置文件就没法打开或装载
yuwenbao 2009-08-16
  • 打赏
  • 举报
回复
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error opening/loading com.microsoft.util.transliteration.properties 读取这个文件有问题吧,不是c3p0的问题,看看你这个文件有没有,或者是不是格式错误了

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧