tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zuxiong lin <linzuxiong1...@gmail.com>
Subject Re: How to config the Tomcat 7.x JNDI datasource by using BoneCP ??
Date Wed, 02 May 2012 08:07:26 GMT
Another example:
1.In Tomcat 7, conf/server.xml -> GlobalNamingResources
    <!-- BoneCP datasource -->
    <Resource acquireIncrement="2" auth="Container"
*driverClass*="com.mysql.jdbc.Driver"
*driverClassName*="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" />
2.my web app . META-INF/context.xml
<Context>
<ResourceLink name="jdbc/SoftmgrV3" global="jdbc/SoftmgrV3"
type="com.jolbox.bonecp.BoneCPDataSource" />
</Context>
3.my web app . web-inf/web.xml
<resource-env-ref>
<resource-env-ref-name>jdbc/SoftmgrV3</resource-env-ref-name>
<resource-env-ref-type>com.jolbox.bonecp.BoneCPDataSource</resource-env-ref-type>
</resource-env-ref>
4.my code , spring jee:
<jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/SoftmgrV3"
resource-ref="true"
lookup-on-startup="false"
expected-type="com.jolbox.bonecp.BoneCPDataSource"
proxy-interface="javax.sql.DataSource" />



Tomcat expcetion tells
me org.apache.naming.factory.ResourceEnvFactory.getObjectInstance ... Why
does it appear again?
HTTP Status 500 -
------------------------------

*type* Exception report

*message***

*description* *The server encountered an internal error () that prevented
it from fulfilling this request.*

*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.springframework.jndi.JndiLookupFailureException:
JndiObjectTargetSource failed to obtain new target object; nested
exception is javax.naming.NamingException: Cannot create resource
instance
	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.springframework.jndi.JndiLookupFailureException:
JndiObjectTargetSource failed to obtain new target object; nested
exception is javax.naming.NamingException: Cannot create resource
instance
	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)
	$Proxy15.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)
	org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
	org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
	org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
	com.kingsoft.softmgr.aop.cache.MemcachedIntercepter.aroundMethod(MemcachedIntercepter.java:87)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
	org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
	org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
	org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
	com.kingsoft.softmgr.web.SoftwareController$$EnhancerByCGLIB$$a0a74ba2.general(<generated>)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
	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.jndi.JndiLookupFailureException:
JndiObjectTargetSource failed to obtain new target object; nested
exception is javax.naming.NamingException: Cannot create resource
instance
	org.springframework.jndi.JndiObjectTargetSource.getTarget(JndiObjectTargetSource.java:139)
	org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:182)
	$Proxy14.getConnection(Unknown Source)
	org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:202)
	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)
	$Proxy15.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)
	org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
	org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
	org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
	com.kingsoft.softmgr.aop.cache.MemcachedIntercepter.aroundMethod(MemcachedIntercepter.java:87)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
	org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
	org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
	org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
	com.kingsoft.softmgr.web.SoftwareController$$EnhancerByCGLIB$$a0a74ba2.general(<generated>)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
	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*

javax.naming.NamingException: Cannot create resource instance
	org.apache.naming.factory.ResourceEnvFactory.getObjectInstance(ResourceEnvFactory.java:117)
	javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
	org.apache.naming.NamingContext.lookup(NamingContext.java:843)
	org.apache.naming.NamingContext.lookup(NamingContext.java:154)
	org.apache.naming.NamingContext.lookup(NamingContext.java:831)
	org.apache.naming.NamingContext.lookup(NamingContext.java:154)
	org.apache.naming.NamingContext.lookup(NamingContext.java:831)
	org.apache.naming.NamingContext.lookup(NamingContext.java:154)
	org.apache.naming.NamingContext.lookup(NamingContext.java:831)
	org.apache.naming.NamingContext.lookup(NamingContext.java:168)
	org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)
	javax.naming.InitialContext.lookup(InitialContext.java:392)
	org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
	org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
	org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
	org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
	org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
	org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
	org.springframework.jndi.JndiObjectTargetSource.getTarget(JndiObjectTargetSource.java:132)
	org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:182)
	$Proxy14.getConnection(Unknown Source)
	org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:202)
	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)
	$Proxy15.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)
	org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
	org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
	org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
	com.kingsoft.softmgr.aop.cache.MemcachedIntercepter.aroundMethod(MemcachedIntercepter.java:87)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
	org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
	org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
	org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
	com.kingsoft.softmgr.web.SoftwareController$$EnhancerByCGLIB$$a0a74ba2.general(<generated>)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
	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)

*note* *The full stack trace of the root cause is available in the Apache
Tomcat/7.0.26 logs.*
------------------------------
Apache Tomcat/7.0.26














On Wed, May 2, 2012 at 3:09 PM, zuxiong lin <linzuxiong1988@gmail.com>wrote:

> 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<http://10.20.216.18:3306/SoftmgrV3?useUnicode=true&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 <490548661@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?
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message