Error creating bean withyou用法 name 'sessionFactory' defined in ServletContext resource [/WEB-

我登录进系统中测试我做的模块时,出现“Error Creating SessionFactory ”异常,最终发现在hibernate.cfg.xml文件中多了一个pojo的配置信息,该pojo在工程中根本不存在。
该种异常的发生还有其他的情况,见: 。
大多都是配置文件(hibernate.cfg.xml、*.hbm.xml)中的信息有问题。
类似Hibernate异常:%%%% Error Creating SessionFactory %%%%org.hibernate.MappingException: Could not read ...
%%%% Error Creating SessionFactory %%%%org.hibernate.MappingException: duplicate property mapping: c...
十一月 24, :35 下午 org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappin...
Error creating beanwith name 'sessionFactory' defined in class path resource [bean.xml]
must specif...
18:13:03 org.hibernate.annotations.common.Version
INFO: HCANN000001: Hibernate Commons A...
已经的可能会出现的三种错误:
第一种:jar是否引入以及版本是否可用
需要引入mybatis和mybatis-spring两个jar包
&dependency&...
十月 19, :56 下午 org.apache.catalina.core.AprLifecycleListener init
INFO: The Apache Tomcat Na...
昨天突然发现Project发生Spring加载Hibernate发生NullPointerException 异常:
org.springframework.beans.factory.BeanCre...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFacto...
22:58:26 StandardContext[/bookstore]Exception sending context initialized event to listen...
没有更多推荐了,找不到答案?
项目中引入mybatis报错,java.lang.ClassNotFoundException
Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.mybatis.spring.SqlSessionFactoryBean] for bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/application-context.xml]; nested exception is java.lang.ClassNotFoundException: org.mybatis.spring.SqlSessionFactoryBean
我的jar包:
我的applicationcontext.xml:
全部的错误:
按投票排序
按时间排序
<dd id="vote_num_
原因可能如下几种情况:
查看jdk版本是否支持annotation
再检查是否引用的是正确包,或同样的类不同版本
clean一下项目,重新build一下
Eclipse中导入项目后js报错的原因与解决方法
在我们将项目导入Eclipse后,配置好各种编译条件、加载好jar包、配置好tomcat后发现项目还是报错,(前提是项目本身并没有错误,而是我们在初次导入到Eclipse中的时候报错),那是什么原因引起的呢。
报错如下情况:
原因是Eclipse的js校验功能引起的。
一、简单解决方法是:js文件右键Validate
手动执行js校验,js文件右键validate。这样可以消除单个js的报错提示。
二、永久解决方法是:关闭的Eclipse的js校验功能。
步骤:【Window】---【Preferences】---【JavaScript】---【Validator】---【Errors/Warnings】
去掉校验的勾选。
关闭校验后,如需要校验js文件,就进行手动校验 (js文件上右键validate即可)。
最后刷新项目:
刷新完已经没有错误了。
<dd id="vote_num_
这个问题基本可以确认是两个原因:
1 类没有,即jar没有。
2 如果有,你按下Ctrl,点击你的引用的org.mybatis.spring.SqlSessionFactoryBean应该能找到。
3 jar包的名字:mybatis-spring-1.0.1.jar(个人使用的版本),你的项目请找对应的。
<dd id="vote_num_
哥们 把错误全部贴出来吧 这点只能说明创建sessionFactory失败 后面肯定有详细说明的
初步分析是你的文件名有问题 MyBatis-Con.....有这个文件吗 由于看不见下面的异常
&bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"&
&property name="configLocation" value="classpath:mybatis-configuration.xml"/&
&property name="dataSource" ref="dataSource" /&
&bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"&
&property name="basePackage" value="com.xxxxxx.xxxxx.dao"/&
&property name="markerInterface" value="com.xxx.xxxx.base.BaseDAO"/&
&bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&
&property name="dataSource" ref="dataSource" /&
登录后可回答问题,请
为您提供简单高效、处理能力可弹性伸缩的计算服务,帮助您快速构建更稳定、安全的应用,提升运维效率,降低 IT 成本...
RDS是一种稳定可靠、可弹性伸缩的在线数据库服务。支持MySQL、SQL Server、PostgreSQL、高...项目中使用的hibernate.但是开始运行就报错:
%%%% Error Creating SessionFactory %%%%
org.hibernate.MappingException: Could not read mappings from resource
情况有三种
1:hibernate.cfg.xml中,属性&mapping resource="./Book.hbm.xml" /&里面"./BOOK.hbm.xml"所指定的路径不正确,即改动了生成实体的配置文件的位置。
2:Book.hbm.xml中,&class name="db.dao.Book" table="ES_BOOK" schema="POSTTEST"&其中属性class name="db.dao.Book"指定的Permission类名错误,即:改动了生成实体类的类名或者包名。
3.去下载一个新的包,把原来的commons-collections-xxx.jar给删了,然后用新的包替换。注意:一定要到应用的发布目录去做这个工作,而且替换后不能重新发布应用,然后立即重启Tomcat再测试。
如果上述三种情况改动后仍然报错,就需要clean一下项目。
Error Creating SessionFactory 异常
类似Hibernate异常:%%%% Error Creating SessionFactory %%%%org.hibernate.MappingException: Could not read ...
Hibernate 运行
Error Creating SessionFactory
18:13:03 org.hibernate.annotations.common.Version
INFO: HCANN000001: Hibernate Commons A...
SessionFactory在Hibernate中的作用
SessionFactory在Hibernate中实际上起到了一个缓冲区的作用 他缓冲了HIbernate自动生成SQL语句和其他的映射数据 还缓冲了一些将来有可能重复利用的数据
十月 19, :56 下午 org.apache.catalina.core.AprLifecycleListener init
INFO: The Apache Tomcat Na...
已经的可能会出现的三种错误:
第一种:jar是否引入以及版本是否可用
需要引入mybatis和mybatis-spring两个jar包
&dependency&...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFacto...
22:58:26 StandardContext[/bookstore]Exception sending context initialized event to listen...
整合SSH注解的方式,但是一直有异常。还是解决了,贴出来。
[org.springframework.web.context.ContextLoader]: Context initiali...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name sessionFactor...
没有更多推荐了,org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initializ nested exception is org.hibernate.MappingException:
Repeated column in mapping for entity: com.xindeco.myregister.pojo.MyRegisterInfo column: password (should be mapped with insert="false" update="false")
百分百配置文件 属性 错误
&property name="pensionNumber" type="string" column="50"&&/property&
本人 不小心 写成 column 了 应该是 length
出错原因:1、数据库的字段值和javaBean中的属性类型不统一。对于基本类型,要用wrapper类型而不是primitive类型。2、hibernate的配置文件xxx.hbm.xml中的属性配置不为空,而数据库中的字段却为空。3.两个字段对应同一列,如:password 和repassword同时对应数据库表中的password一列,同时update和insert都设为true。
xml文件如下:
&property name="password"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="password"
length = "32"
&property name="repassword"
type="java.lang.String"
update="false"
insert="false"
access="property"
column="password"
length = "32"
解决的方法:
将repassword的insert和update设为false。
4:.hbm.xml的映射文件出错,具体字段出错,比如长度,或者少写,或者多写
玩转JPA(一)---异常:Repeated column in mapping for entity/should be mapped with insert=&false& update=&fal
最近用JPA遇到这样一个问题:Repeated column in mapping for entity: com.ketayao.security.entity.main.User column: ...
Repeated column in mapping for entity: XXpojo column: xx (should be mapped with insert=&false& upda
问题:Repeated column in mapping for entity: XXXpojo column: XXX列 (should be mapped with insert=&false&...
Repeated column in mapping for entity:should be mapped with insert=&false& update=&false&
可以看到vote_uid出现了两次,把最上面的那个去掉即可,因为两个属性不能对应一行。...
今天在配置一对多关系的时候出现了以下异常:
org.hibernate.MappingException: Repeated column in mapping for entitycom.lrq....
对实体类做映射时
@ManyToOne
@JoinColumn(name=&customer_id&)
@ManyToOn...
nested exception is org.hibernate.MappingException: Repeated column in mapping for entity: com.xslzn...
Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.flex.domain.Pr...
java.lang.ExceptionInInitializerError
at org.whatisjava.test.user._02TestCatalogService.testSession...
Invocation o
nested exception is org.hibernate.MappingException:
Repeated...
1、org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFac...
没有更多推荐了,Error creating bean with name 求大神指点啊,急急急啊
[问题点数:21分,结帖人woniu4500]
本版专家分:46
结帖率 100%
CSDN今日推荐
本版专家分:16267
本版专家分:1137
本版专家分:46
本版专家分:1137
本版专家分:46
本版专家分:46
本版专家分:46
匿名用户不能发表回复!
其他相关推荐

我要回帖

更多关于 withyou用法 的文章

 

随机推荐