今天下载公司以前的一个项目,要和现在的项目进行整合,下载一切顺利,但在开发机器上一跑,憋了。

  有两种日志,两种报错:一个是cannot resolve reference to bean 'sqlSessionFactory' while setting bean,另一个报To prevent a memory leak, the JDBC Driver has been forcibly unregistered。

  乍一看怀疑是数据库没连接上,结果数据库是能联通的,又百度一同乱查,说什么的都有,最后找出原因,maven的pom文件中没有设置资源拷贝。

  原项目是用eclipse开发的,我用idea进行开发,使用maven作为项目管理平台,原本编辑器应该将项目中资源管理的权限全交个maven,但是使用eclipse开发时eclipse会插手,主动将src/java下的xml等资源文件拷贝到target下,由于eclipse多管了这么一宗闲事,时得当时的开发人员根本没注意pom中没有配置资源拷贝。

解决方法:在pom中设置资源拷贝即可

 <build>
<resources>
<!--编译后对xml进行资源拷贝-->
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>

Cannot resolve reference to bean 'sqlSessionFactory' while setting bean的更多相关文章

  1. Error creating bean with name 'mapper' defined in class path resource [applicationcontext.xml]: Cannot resolve reference to bean 'factory' while setting bean property 'sqlSessionFactory'; nested excep

    Error creating bean with name 'mapper' defined in class path resource [applicationcontext.xml]: Cann ...

  2. Error creating bean with name 'us' defined in class path resource [com/liuyang/test/DI/beans2.xml]: Cannot resolve reference to bean 'daoa' while setting bean property 'daoa'; nested exception is org.

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'us' defined ...

  3. Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; 没有sessionFactory

    maven子项目spring配置文件创建bean 没有找到另一个子项目中的bean. 需要引入另一个子项目的配置文件,仅提供测试用 如下: <!-- 仅供测试用 --> <impor ...

  4. Cannot resolve reference to bean 'mongoTemplate' while setting bean property 'mongoOperations'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with na

    问题: Springboot 启动时出错,报没法创建bean的错误,看到nested最后是关于mongoTemplate的错误. 过程: 看网上大多说的是修改mongoTemplate的配置,但是sp ...

  5. 解决Cannot resolve reference to bean 'txPointcut' while setting bean property 'pointcut'

    忘记导入了 这三个jar包...

  6. Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument

    spring 5.+jpa 配置类出错: 十二月 20, 2018 5:53:01 下午 org.springframework.web.servlet.DispatcherServlet initS ...

  7. error: cannot lock ref 'refs/remotes/origin/master': unable to resolve reference 'refs/remotes/origin/master': reference broken...

    之前在自己的项目中添加了一个分支,然后做了一些操作,比如同步本地的分支情况到远程仓库中,然后在远程仓库中完成分支合并,以及 Pull request 等等操作,后来,在本地仓库中进行 git fetc ...

  8. Spring错误——Spring 注解——factory-bean reference points back to the same bean definition

    背景:学习Spring,在使用注解@Bean的name属性配置<bean>实例时,不能注册实例成功 报错 WARNING: Exception encountered during con ...

  9. swagger list Could not resolve reference because of: Could not resolve point

    swagger list Could not resolve reference because of: Could not resolve point controller的参数要加   @Requ ...

随机推荐

  1. 2018-2019-1 20189221 《Linux内核原理与分析》第六周作业

    2018-2019-1 20189221 <Linux内核原理与分析>第六周作业 实验五 实验过程 将Fork函数移植到Linux的MenuOS fork()函数通过系统调用创建一个与原来 ...

  2. 邮件收取客户端LumiSoft类库接收yahoo邮件的问题。

    //开始循环取邮件数据 m_pImap.Fetch( false, IMAP_t_SeqSet.Parse("1:*"), new IMAP_t_Fetch_i[]{ new IM ...

  3. 编译snort经验

    google搜索,找个感觉挺新的版本 https://zh.osdn.net/frs/g_redir.php?m=netix&f=%2Fslackbuildsdirectlinks%2Fsno ...

  4. python shutil.copytree 解决目标目录存在的情况

    直接修改copytree的实现即可,如下: #copytree中找到 os.makedirs(dst),加入判断,就这么简单 if not os.path.exists(dst): os.makedi ...

  5. 004-全局应用程序类Global.asax

    服务器对象:Request.Response.Server.Session.Application.Cookie //功能1:为服务器对象注册Start.End处理 protected void Ap ...

  6. LeetCode155.最小栈

    设计一个支持 push,pop,top 操作,并能在常数时间内检索到最小元素的栈. push(x) -- 将元素 x 推入栈中. pop() -- 删除栈顶的元素. top() -- 获取栈顶元素. ...

  7. mysql 查看版本和是否支持分区

    命令行界面: 查看版本: select version(); 结果: +------------+| version() |+------------+| 5.6.31-log |+--------- ...

  8. GCD(III)

    GCD 线程间的通信 在iOS开发过程中,我们一般在主线程里边进行UI刷新,例如:点击.滚动.拖拽等事件.我们通常把一些耗时的操作放在其他线程,比如说图片下载.文件上传等耗时操作.而当我们有时候在其他 ...

  9. 【安装虚拟机三】设置Linux IP地址

    环境 VMware 10 CentOS-6.5-x86_64 第一步:查看IP信息linux:ifconfig (windows:ipconfig) 第二步:编辑网卡信息 vi /etc/syscon ...

  10. memcache、redis、mongoDB 如何选择?

    不同的 Nosql,其实应用的场景各有不同,所以我们应该先了解不同Nosql 之间的差别,然后分析什么才是最适合我使用的 Nosql. Nosql 介绍 Nosql 的全称是 Not Only Sql ...