'hibernate.dialect' must be set when no Connection available

问题描述

为什么会报这样的错误呢,以前都没事,今天好奇怪配的SSH2015-2-2412:56:28org.apache.catalina.core.AprLifecycleListenerinit信息:TheApacheTomcatNativelibrarywhichallowsoptimalperformanceinproductionenvironmentswasnotfoundonthejava.library.path:E:Commonbinarycom.sun.java.jdk.win32.x86_1.6.0.013bin;E:Commonpluginscom.genuitec.eclipse.easie.tomcat.myeclipse_8.5.0.me201003121946tomcatbin2015-2-2412:56:28org.apache.coyote.http11.Http11Protocolinit信息:InitializingCoyoteHTTP/1.1onhttp-80802015-2-2412:56:28org.apache.catalina.startup.Catalinaload信息:Initializationprocessedin346ms2015-2-2412:56:28org.apache.catalina.core.StandardServicestart信息:StartingserviceCatalina2015-2-2412:56:28org.apache.catalina.core.StandardEnginestart信息:StartingServletEngine:ApacheTomcat/6.0.132015-2-2412:56:29org.apache.catalina.core.ApplicationContextlog信息:InitializingSpringrootWebApplicationContextlog4j:WARNNoappenderscouldbefoundforlogger(org.springframework.web.context.ContextLoader).log4j:WARNPleaseinitializethelog4jsystemproperly.log4j:WARNNoappenderscouldbefoundforlogger(org.springframework.core.CollectionFactory).log4j:WARNPleaseinitializethelog4jsystemproperly.2015-2-2412:56:32org.apache.catalina.core.ApplicationContextlog信息:InitializingSpringrootWebApplicationContext2015-2-2412:57:03org.apache.catalina.core.StandardContextlistenerStart严重:Exceptionsendingcontextinitializedeventtolistenerinstanceofclassorg.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'sessionFactory'definedinclasspathresource[beans.xml]:Invocationofinitmethodfailed;nestedexceptionisorg.hibernate.HibernateException:'hibernate.dialect'mustbesetwhennoConnectionavailableatorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)atjava.security.AccessController.doPrivileged(NativeMethod)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)atorg.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)atorg.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)atorg.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)atorg.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)atorg.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)atorg.apache.catalina.core.StandardContext.start(StandardContext.java:4334)atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)atorg.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)atorg.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)atorg.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)atorg.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)atorg.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)atorg.apache.catalina.core.StandardHost.start(StandardHost.java:719)atorg.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)atorg.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)atorg.apache.catalina.core.StandardService.start(StandardService.java:516)atorg.apache.catalina.core.StandardServer.start(StandardServer.java:710)atorg.apache.catalina.startup.Catalina.start(Catalina.java:566)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atorg.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)atorg.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)Causedby:org.hibernate.HibernateException:'hibernate.dialect'mustbesetwhennoConnectionavailableatorg.hibernate.dialect.resolver.DialectFactory.buildDialect(DialectFactory.java:107)atorg.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:138)atorg.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2163)atorg.hibernate.cfg.Configuration.buildSettings(Configuration.java:2159)atorg.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1383)atorg.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)atorg.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)atorg.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)...39more2015-2-2412:57:03org.apache.catalina.core.StandardContextstart严重:ErrorlistenerStart2015-2-2412:57:03org.apache.catalina.core.StandardContextstart严重:Context[/Test20150223]startupfailedduetopreviouserrors2015-2-2412:57:03org.apache.catalina.core.ApplicationContextlog信息:ClosingSpringrootWebApplicationContextlog4j:ERRORLogMananger.repositorySelectorwasnulllikelyduetoerrorinclassreloading,usingNOPLoggerRepository.2015-2-2412:57:03org.apache.coyote.http11.Http11Protocolstart信息:StartingCoyoteHTTP/1.1onhttp-80802015-2-2412:57:03org.apache.jk.common.ChannelSocketinit信息:JK:ajp13listeningon/0.0.0.0:80092015-2-2412:57:03org.apache.jk.server.JkMainstart信息:JkrunningID=0time=0/16config=null2015-2-2412:57:03org.apache.catalina.startup.Catalinastart信息:Serverstartupin34874ms

解决方案

解决方案二:
我晕我换了一个mysql的jar包,5.1.7的版本,然后给driver也更换成5.1.7的driver就好了..................................................................................

时间: 2024-10-26 09:23:52

'hibernate.dialect' must be set when no Connection available的相关文章

'hibernate.dialect' must be set when no Connection available

今天碰到的这个问题,很无厘头,网上搜索了很多,都不靠谱,还是靠自己 解决方法是在hibernate.cfg.xml中添加 <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>

【hibernate】Hibernate SQL 方言(hibernate.dialect)

参考如下: RDBMS Dialect DB2 org.hibernate.dialect.DB2Dialect DB2 AS/400 org.hibernate.dialect.DB2400Dialect DB2 OS390 org.hibernate.dialect.DB2390Dialect PostgreSQL org.hibernate.dialect.PostgreSQLDialect MySQL5 org.hibernate.dialect.MySQL5Dialect MySQL5

ssh报错 Error setting expression &amp;amp;#x27;teacher.password&amp;amp;#x27; with value &amp;amp;#x27;[Ljava.lang.String

问题描述 Errorsettingexpression'teacher.password'withvalue'[Ljava.lang.String;@1b6c184'ognl.OgnlException:targetisnullforsetProperty(null,"password",[Ljava.lang.String;@1b6c184)jsp:<%@pagecontentType="text/html;charset=utf-8"%><%@

&amp;amp;#x27;$.data(...).options&amp;amp;#x27; 为空或不是对象

问题描述 $(function(){varcWidth=$(document.body).width()-10;varcHeight=$(document.body).height()-27;$("#state").combobox({valueField:'lable',textField:'value',data:getMyCombboxData($($('#itabs').tabs('getSelected')).attr('id'))});$('#itabs').tabs({o

无法打开登录所请求的数据库 &amp;amp;quot;LAZYEATING&amp;amp;quot;。登录失败。 用户 &amp;amp;#x27;zfp-PC\zfp&amp;amp;#x27; 登录失败

问题描述 解决方案 解决方案二:这种问题你百度下就知道了,帐号或者密码不对解决方案三:这种问题你百度下就知道了,帐号或者密码不对解决方案四:Web.Config下查看你的连接字符串.百度搜索SqlServer的Windows认证和SqlServer认证解决方案五:你应该是在connectstring中用了integratedsecurity了,也就是用你本机登录的用户访问数据库,但是你本机登录的用户没有权限访问数据库.可以使用sqlauthentication.可以看看这篇文章Beginners

过程或函数 &amp;amp;#x27;p_AddLostExceptPhoto&amp;amp;#x27; 需要参数 &amp;amp;#x27;@cid&amp;amp;#x27;,但未提供该参数

问题描述 做的是三层架构,存储过程:alterprocp_AddLostExceptPhoto@lnamevarchar(20),@genderchar(2),@birthdaydatetime,@heightThenvarchar(10),@losttimedatetime,@jiguanvarchar(200),@cidint,@lostplacevarchar(100),@backgroundandcluevarchar(500),@otherexplainvarchar(200),@re

违反了 PRIMARY KEY 约束 &amp;amp;#x27;PK_Info&amp;amp;#x27;。不能在对象 &amp;amp;#x27;dbo.Info&amp;amp;#x27; 中插入重复键。 语句已终止。

问题描述 主键是用guid方法生成的id,为什么还会错,而且每次都是产生的id都是00000000-0000-0000-0000-000000000000 解决方案 解决方案二:noway解决方案三:主键不能重复,所以不能每次都是"00000000-0000-0000-0000-000000000000",要插入不同的id.解决方案四:用newid语句产生一个随机的guid解决方案五:你自己创建的Guid?可以使用Guid.NewGuid()来创建.解决方案六:4楼正解,请参考解决方案

各表中的列名必须唯一.在表 &amp;amp;#x27;dbo.Wage&amp;amp;#x27; 中多次指定了列名 &amp;amp;#x27;EndowmentBase&amp;amp;#x27;

问题描述 我在本地测试网站通过,上传至服务器后,登录时出现错误"各表中的列名必须唯一.在表'dbo.Wage'中多次指定了列名'EndowmentBase'.i=0",经测试是在登录流程try开始时调用UserService时报错,而我的UserService根本未调用Wage表,请各位大神支招究竟是怎么回事.本机是win7,难道是本机和服务器系统不一致的原因??不可能这么离谱把UserController的Login方法:[HttpPost][AllowAnonymous][Vali

[C#]无效的 SQL语句;期待 &amp;amp;#x27;DELETE&amp;amp;#x27;、&amp;amp;#x27;INSERT&amp;amp;#x27;、&amp;amp;#x27;PROCEDURE&amp;amp;#x27;、&amp;amp;#x27;SELECT&amp;amp;#x27;、或 &amp;amp;#x27;UPDATE&amp;amp;#x27;

问题描述 stringluru="insertintolyb(dyhm,dlyzt,dlynr,dlysj)values('"+Session["yhm"]+"','"+clyzt+"','"+clynr+"','"+Session["riqi"]+"')";OleDbCommandtianjia=newOleDbCommand(luru,conn);tianjia.