Actually , I have do it 5 times by different way.
But Tomcat 7 tells me Exception!


In Tomcat 7 , conf/server.xml -> GlobalNamingResources
<!-- BoneCP datasource -->
<Resource acquireIncrement="2" auth="Container"
driverClass="com.mysql.jdbc.Driver" *
factory="com.jolbox.bonecp.BoneCPDataSource"* idleMaxAgeInMinutes="600"
jdbcUrl="jdbc:mysql://
10.20.216.18:3306/SoftmgrV3?useUnicode=true&amp;characterEncoding=UTF-8"
lazyInit="false" maxConnectionsPerPartition="100"
minConnectionsPerPartition="3" name="jdbc/SoftmgrV3" partitionCount="2"
password="root" releaseHelperThreads="2"
type="com.jolbox.bonecp.BoneCPDataSource" username="root" />

In my Web App:
META-INF/context.xml :
<Context>
<ResourceLink name="jdbc/SoftmgrV3" global="jdbc/SoftmgrV3"
type="com.jolbox.bonecp.BoneCPDataSource" />
</Context>
web-inf/web.xml :
<resource-ref>
<description>jndi datasource</description>
<res-ref-name>jdbc/SoftmgrV3</res-ref-name>
<res-type>com.jolbox.bonecp.BoneCPDataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
spring jee:
<jee:jndi-lookup id="dataSource" jndi-name="jdbc/SoftmgrV3"
resource-ref="true" cache="true" lookup-on-startup="true" />

*But Excpeiotn:*
exception

org.springframework.web.util.NestedServletException: Request processing
failed; nested exception is
org.springframework.transaction.CannotCreateTransactionException: Could not
open JDBC Connection for transaction; nested exception is
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver
of class '' for connect URL 'null'
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:58)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
root cause

org.springframework.transaction.CannotCreateTransactionException: Could not
open JDBC Connection for transaction; nested exception is
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver
of class '' for connect URL 'null'
org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:240)
org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371)
org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:335)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:105)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
$Proxy14.getSoftwareTypes(Unknown Source)
com.kingsoft.softmgr.web.SoftwareController.general(SoftwareController.java:53)
com.kingsoft.softmgr.web.SoftwareController$$FastClassByCGLIB$$17a6cdbd.invoke(<generated>)
net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)



Why does it appear .tomcat.dbcp.dbcp,
 not com.jolbox.bonecp.BoneCPDataSource implements DataSource,
ObjectFactory ???

















On Wed, May 2, 2012 at 9:30 AM, 490548661 <490548...@qq.com> wrote:

> see tomcat domcument mybe that will help you
>
>
> ------------------ Original ------------------
> From: "zuxiong lin";
> Date: 2012年5月2日(星期三) 上午9:12
> To: "users";
> Subject: How to config the Tomcat 7.x JNDI datasource by using BoneCP ??
>
>
> Hi, All.
> Any help ?
>
>
>
>
> Thanks?
>

Reply via email to