编写好applicationContext.xml后启动Tomcat7.0, 出现以下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’ defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [com/lhl/expbos/model] cannot be resolved to URL because it does not exist
接着查看out包发现里面没有com/lhl/expbos/model路径,同时发现包里有文件的路径才有被打包,所以在model下写了个User类,再重启Tomcat发现问题解决了。
Lvduanhighboss 发布了4 篇原创文章 · 获赞 0 · 访问量 223 私信 关注