java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255)
java.lang.ExceptionInInitializerError
it.shopping.service.GoodsService.savegoods(GoodsService.java:15)
it.shopping.action.GoodsAction.saveGoods(GoodsAction.java:63)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255)
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:426)
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2090)
org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2086)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1311)
it.shopping.util.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:19)
it.shopping.service.GoodsService.savegoods(GoodsService.java:15)
it.shopping.action.GoodsAction.saveGoods(GoodsAction.java:63)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
我这里是这样写的啊
org.hibernate.dialect.MySQLDialect
我是这样写的
com.mysql.jdbc.Driver
jdbc:mysql:///test
root
org.hibernate.dialect.MySQLDialect
create
true
这是我测试用的配置文件,我只使用了hibernate,如果要跟spring结合的话,这样配置
org.hibernate.dialect.MySQLDialect
true
true
update
项目报错org.hibernate.HibernateException: Hibernate Dialect m...
数据库的hibernate方言错误 不同数据库方言不同 这是mysql的方言 <property name="dialect"> org.hibernate.dialect.MySQLDialect <\/property>
...org.hibernate.HibernateException: Dialect class notfound_百 ...
这是告诉你mysql方言找不到,说明你相关的jar包没有导入,这个方言是在hibernate核心jar包内的rg.hibernate.dialect包中,你自己看一下自己的里边有没有。如果你确定你的包导入正确的话,那就是你单词大小写写错了,我看了下你的这个错误,应该是你的类写错了:MYSQLDialect这个类中的Y应该是小写的y。
...的配置文件中方言dialect设置为org.hibernate.dialect.SQLServer20...
可能是通用的方言是org.hibernate.dialect.SQLServerdialect 吧
org.springframework.beans.factory.BeanCreationException
这个问题是你在配置ApplicationContext.xml(beans.xml)中 配置有错误,检查一下