SSH项目练习的时候报错:[applicationContext.xml]: Invocation of init method failed;
这里是控制台的报错信息:
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 org.hibernate.MappingException: could not instantiate id generator [entity-name=com.tes.entity.Cost]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.hibernate.MappingException: could not instantiate id generator [entity-name=com.tes.entity.Cost]
at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:109)
at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:152)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:197)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1313)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 24 more
Caused by: org.hibernate.MappingException: Dialect does not support sequences
at org.hibernate.dialect.Dialect.getSequenceNextValString(Dialect.java:619)
at org.hibernate.id.SequenceGenerator.configure(SequenceGenerator.java:65)
at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:104)
... 32 more
下面是applicationContext.xml文件信息:
<!-- 配置SessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<!-- 依赖数据源 -->
<property name="dataSource" ref="db"/>
<!-- Hibernate框架相关配置 -->
<property name="hibernateProperties">
<props>
<!-- 配置数据库方言 -->
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<!-- 显示SQL -->
<prop key="hibernate.show_sql">true</prop>
<!-- 格式化SQL -->
<prop key="hibernate.formate_sql">true</prop> <!-- 查询缓存
<prop key="hibernate.cache.use_query_cache">true</prop>
//二级缓存
<prop key="hibernate.cache.use_second_level_cache">false</prop>
-->
</props>
</property>
<property name="mappingResources">
<list>
<value>com/tes/entity/Cost.hbm.xml</value>
</list>
</property>
</bean>
SSH项目练习的时候报错:[applicationContext.xml]: Invocation of init method failed;的更多相关文章
- MyBatis笔记----报错:Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/ij34/mybatis/applicationContext.xml]: Invocation of init method failed; nested exception is org.sp
四月 05, 2017 4:51:02 下午 org.springframework.context.support.ClassPathXmlApplicationContext prepareRef ...
- Error creating bean with name 'sqlSessionFactory' defined in class path resource [config/spring/applicationContext.xml]: Invocation of init method failed;
我报的错: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSes ...
- Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; neste
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto ...
- Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable t
spring与hibernate整合然后出现如下错误: org.springframework.beans.factory.BeanCreationException: Error creating ...
- aused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method fai
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'roleDaoImpl' ...
- SSH项目中使用struts-tags报错According to TLD or attribute directive in tag file, attribute test does not accept any expressions
在运行struts2标签页面时报错,代码如下:<%@ page language="java" pageEncoding="gbk"%><%@ ...
- tomcat maven插件启动报错tomcat-users.xml cannot be read
tomcat maven插件启动报错tomcat-users.xml cannot be read [ERROR] Failed to execute goal org.codehaus.mojo:t ...
- Java Web项目(Extjs)报错五
1. Java Web项目(Extjs)报错五 具体报错如下: usage: java org.apache.catalina.startup.Catalina [ -config {pathname ...
- Java Web项目(Extjs)报错四
1.Java Web项目(Extjs)报错四 具体报错如下: usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ...
随机推荐
- 增加Activity Monitor中的作业保存数量
在Master Server的注册表中加入如下两个键值即可: (1500的单位是小时)
- GDUT——1169: Krito的讨伐(优先队列BFS)
1169: Krito的讨伐 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 619 Solved: 102 Description Krito终于干 ...
- virtualenv -- python虚拟沙盒
有人说:virtualenv.fabric 和 pip 是 pythoneer 的三大神器. 不管认不认同,至少要先认识一下,pip现在倒是经常用到,virtualenv第一次听说,不过,总得尝试一下 ...
- [分享]运维分享一一阿里云linux系统mysql密码修改脚本
[分享]运维分享一一阿里云linux系统mysql密码修改脚本 大象吃豆子 级别: 小白 发帖 12 云币 27 加关注 写私信 只看楼主 更多操作楼主 发表于: 2014-09-3 ...
- Win2008R2 zip格式mysql 安装与配置
一.百度mysql5.6 ZIP 64位免安装版 下载好后 解压到D盘下 二.可以考虑修改my.ini里面的配置 character-set-server=utf8 这句是编码格式设定 ...
- MemcacheQ安装及使用
一.MemcacheQ安装记录1.安装libevent查看是否已经安装了libeventrpm -qa|grep libevent如果没有安装使用yum安装yum install libevent l ...
- font awesome
http://stackoverflow.com/questions/21406538/how-to-use-font-awesome-icons-from-node-modules
- corresponding SQLSTATE values general error
http://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html B.3 Server Error Codes and Message ...
- Machine Learning in Action – PCA和SVD
降维技术, 首先举的例子觉得很好,因为不知不觉中天天都在做着降维的工作 对于显示器显示一个图片是通过像素点0,1,比如对于分辨率1024×768的显示器,就需要1024×768个像素点的0,1来表示, ...
- Delphi 中的结构体与结构体指针
好多程序都给结构体变量设定了一个结构体指针 例如: PAbc = ^TAbc; TAbc = record a: string[10]; b: string[5]; c: string[1]; end ...