报了这么一个错,找了很久才找到问题出在哪里,具体为什么会什么出现现在还不怎么懂,只是现在能让它继续跑起来
这个错是因为我的spring-mybatis.xml文件读取不了jdbc.properties文件,把spring-mybatis.xml文件里边的${url}这些引用过来的参数直接写成对应配置文件里边的
我参考了http://blog.csdn.net/chao_1990/article/details/52604104
不过按照他的解决方法:
将MapperScannerConfigurer配置中的
<property name="sqlSessionFactory" ref="sqlSessionFactory"/>
替换为
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
==========================
而我的配置本来就是他需要改的这样
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.zk1.mapper" />
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>
现在引用jdbc.properties起来还是报错,只能先改spring-mybatis.xml文件里边的数据库连接参数
如若解决了,麻烦告知一声,我会衷心感谢你的~~~~~
2016-12-19 08:29:01 DruidAbstractDataSource:968 ERROR - maxIdle is deprecated
2016-12-19 08:29:01 DruidDataSource:712 ERROR - {dataSource-1} init error
java.sql.SQLException: unkow jdbc driver : http://maven.apache.org
at com.alibaba.druid.util.JdbcUtils.getDriverClassName(JdbcUtils.java:432)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:642)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1706)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1645)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)