BoneCP sometimes cannot get config from spring property holder -
i have been facing issue while now. config following
<!-- load properties files --> <context:property-placeholder location="classpath:*-${environment}.properties" ignore-unresolvable="true"/> <bean id="datasource" class="com.jolbox.bonecp.bonecpdatasource" destroy-method="close"> <property name="driverclass" value="${jdbc.driverclassname}" /> <property name="jdbcurl" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> <property name="idleconnectiontestperiodinminutes" value="${bonecp.idleconnectiontestperiodinminutes}"/> <property name="idlemaxageinminutes" value="${bonecp.idlemaxageinminutes}"/> <property name="maxconnectionsperpartition" value="${bonecp.maxconnectionsperpartition}"/> <property name="minconnectionsperpartition" value="${bonecp.minconnectionsperpartition}"/> <property name="partitioncount" value="${bonecp.partitioncount}"/> <property name="acquireincrement" value="${bonecp.acquireincrement}"/> <property name="statementscachesize" value="${bonecp.statementscachesize}"/> <property name="lazyinit" value="true"/> <property name="maxconnectionageinseconds" value="${bonecp.maxconnectionageinseconds}"/> </bean>
the project running on tomcat 7
on local machine, project deploy no error dev server. unfortunately, project cannot deployed on dev server more (server configuration remain same) while local machine still fine. every time deploy project on dev server, tomcat hang @ info: deploying web application archive /etc/tomcat/webapps/project.war. if config bonecp real values, fine.
could 1 tell me what's wrong it?
it turned out lazyinit problem. if comment out, server can start normally. i'm facing new issue though. mybatis cannot access db @ while local machine 100% fine. , yet dont throw exception. when stop server, found next exceptions
info: illegal access: web application instance has been stopped already. not load com.jolbox.bonecp.poolutil. eventual next stack trace caused error thrown debugging purposes effort terminate thread caused illegal access, , has no functional impact. java.lang.illegalstateexception @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1600) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1559) @ com.jolbox.bonecp.defaultconnectionstrategy.getconnectioninternal(defaultconnectionstrategy.java:94) @ com.jolbox.bonecp.abstractconnectionstrategy.getconnection(abstractconnectionstrategy.java:90) @ com.jolbox.bonecp.bonecp.getconnection(bonecp.java:540) @ com.jolbox.bonecp.bonecpdatasource.getconnection(bonecpdatasource.java:131) @ org.springframework.jdbc.datasource.datasourceutils.dogetconnection(datasourceutils.java:111) @ org.springframework.jdbc.datasource.datasourceutils.getconnection(datasourceutils.java:77) @ org.mybatis.spring.transaction.springmanagedtransaction.openconnection(springmanagedtransaction.java:80) @ org.mybatis.spring.transaction.springmanagedtransaction.getconnection(springmanagedtransaction.java:66)
and
info: illegal access: web application instance has been stopped already. not load org.apache.ibatis.reflection.exceptionutil. eventual next stack trace caused error thrown debugging purposes effort terminate thread caused illegal access, , has no functional impact. java.lang.illegalstateexception @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1600) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1559) @ org.mybatis.spring.sqlsessiontemplate$sqlsessioninterceptor.invoke(sqlsessiontemplate.java:363) @ sun.proxy.$proxy15.selectlist(unknown source) @ org.mybatis.spring.sqlsessiontemplate.selectlist(sqlsessiontemplate.java:195) @ org.apache.ibatis.binding.mappermethod.executeformany(mappermethod.java:124) @ org.apache.ibatis.binding.mappermethod.execute(mappermethod.java:90) @ org.apache.ibatis.binding.mapperproxy.invoke(mapperproxy.java:40) @ sun.proxy.$proxy45.selectbyexample(unknown source)
well many things likely
properties not beingness replaced values think the database number of connections has been exceeded or wrong host a combination of 1 + 2for #1 create separate bean needs com.jolbox.bonecp.bonecpdatasource dependency , have print out getters of bonecpdatasource.
for #2 turn on much logging possible (see log4j or logback or whatever logging framework is).
spring bonecp
No comments:
Post a Comment