@wenshao 你好,想跟你请教个问题:
我在使用多个项目访问同一个数据库时,启动第二个项目会报错。
2016-01-14 16:40:48 [] [] [ERROR]-[Thread: localhost-startStop-1]-[com.alibaba.druid.pool.DruidDataSource.init()]: init datasource error, url: jdbc:postgresql://192.168.6.97:5432/project2 org.postgresql.util.PSQLException: 尝试连线已失败。 at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:257) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65) at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:159) at org.postgresql.Driver.makeConnection(Driver.java:416) at org.postgresql.Driver.connect(Driver.java:283) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148) at com.alibaba.druid.filter.FilterAdapter.connection_connect(FilterAdapter.java:785) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142) at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1388) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1442) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:632) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:934) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:930) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:102) at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:80) at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:171) at com.jfinal.core.Config.startPlugins(Config.java:87) at com.jfinal.core.Config.configJFinal(Config.java:48) at com.jfinal.core.JFinal.init(JFinal.java:65) at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4574) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5193) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: Illegal UTF-8 sequence: byte 2 of 2 byte sequence is not 10xxxxxx: -62 at org.postgresql.core.UTF8Encoding.checkByte(UTF8Encoding.java:28) at org.postgresql.core.UTF8Encoding.decode(UTF8Encoding.java:103) at org.postgresql.core.PGStream.ReceiveString(PGStream.java:329) at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:424) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:203) ... 33 more
我使用的数据库是postgresql ,请问如何配置 druid 能使得多个项目访问同一个数据库不报错。
<imgsrc="http://www.oschina.net/js/ke/plugins/emoticons/images/10.gif"alt=""> 数据库的配置是什么解决了连接池配置问题连接数配的太大了
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。