Current image: P6Spy preparationSQL monitoring software. Prepare according to the website examples and descriptions. An error is reported when the server is started. Data source not found
Cause: 1. datasource prepared by spring adopts the JNDI method. And p6spy introduction. If you change the JDBC driver of the JDBC data source to com. p6spy. Engine. Spy. p6spydriver, you cannot replace the realjdbc driver with p6spy. Startup Error
Solution: Modify the spring. xml configuration file. Data Source Preparation Method
<Bean id = "datasourcetarget" class = "org. springframework. JNDI. jndiobjectfactorybean" lazy-init = "false">
<Property name = "jndiname">
<Value >$ {JDBC. jndiname} </value>
</Property>
<Property name = "resourceref">
<Value> true </value>
</Property>
</Bean>
<Bean id = "datasource" class = "com. p6spy. Engine. Spy. p6datasource" Destroy-method = "close">
<Constructor-Arg>
<Ref bean = "datasourcetarget"/>
</Constructor-Arg>
</Bean>