java-非典型SSH项目,启动服务器,出现如下错误,求大神支招

问题描述

非典型SSH项目,启动服务器,出现如下错误,求大神支招

10:19:56.250 WARN org.hibernate.ejb.Ejb3Configuration[1132] - HHH000144: hibernate.connection.autocommit = false breaks the EJB3 specification

10:19:56.745 WARN o.h.e.jdbc.internal.JdbcServicesImpl[169] - HHH000342: Could not obtain connection to query metadata : Driver:net.sf.log4jdbc.DriverSpy@ef57f8 returned null for URL:jdbc:log4jdbc:mysql://localhost:3306/crmdb?useUnicode=true&characterEncoding=utf-8

10:19:56.760 ERROR o.s.web.context.ContextLoader[307] - Context initialization failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [D:devtoolsspringsourcevfabric-tc-server-developer-2.8.2.RELEASEbase-instancewtpwebappsoperation-crmWEB-INFclassescontextspring-context.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build EntityManagerFactory
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:734) ~[spring-context-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:457) ~[spring-context-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383) ~[spring-web-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) ~[spring-web-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [spring-web-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797) [catalina.jar:7.0.35.B]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291) [catalina.jar:7.0.35.B]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.35.B]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.35.B]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.35.B]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) [catalina.jar:7.0.35.B]
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657) [catalina.jar:7.0.35.B]
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637) [catalina.jar:7.0.35.B]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [na:1.6.0_32]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [na:1.6.0_32]
at java.util.concurrent.FutureTask.run(FutureTask.java:138) [na:1.6.0_32]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_32]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_32]
at java.lang.Thread.run(Thread.java:662) [na:1.6.0_32]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [D:devtoolsspringsourcevfabric-tc-server-developer-2.8.2.RELEASEbase-instancewtpwebappsoperation-crmWEB-INFclassescontextspring-context.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build EntityManagerFactory
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:420) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:277) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.(PersistenceExceptionTranslationInterceptor.java:79) ~[spring-tx-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.(PersistenceExceptionTranslationAdvisor.java:70) ~[spring-tx-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:103) ~[spring-tx-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1475) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1443) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
... 24 common frames omitted
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915) ~[hibernate-entitymanager-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890) ~[hibernate-entitymanager-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74) ~[hibernate-entitymanager-4.1.8.Final.jar:4.1.8.Final]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:287) ~[spring-orm-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310) ~[spring-orm-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
... 39 common frames omitted
Caused by: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set
at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:97) ~[hibernate-core-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:67) ~[hibernate-core-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:170) ~[hibernate-core-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75) ~[hibernate-core-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159) ~[hibernate-core-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131) ~[hibernate-core-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:77) ~[hibernate-core-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2283) ~[hibernate-core-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2279) ~[hibernate-core-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1748) ~[hibernate-core-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.ejb.EntityManagerFactoryImpl.(EntityManagerFactoryImpl.java:94) ~[hibernate-entitymanager-4.1.8.Final.jar:4.1.8.Final]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905) ~[hibernate-entitymanager-4.1.8.Final.jar:4.1.8.Final]
... 45 common frames omitted
10:19:56.761 DEBUG l.s.c.w.l.ApplicationContextPostListener[35] - Invoke ApplicationContextPostListener contextInitialized

解决方案

你使用的是mysql数据库,检查下connection.url的是否正确,我看你的异常里面显示的是URL:jdbc:log4jdbc:mysql://localhost:3306/crmdb?useUnicode=true&characterEncoding=utf-8,不应该是这样

解决方案二:

问题原因找到了,Caused by: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set
方言没有加到spring-context里面,所以当spring初始化bin类的时候没有找到方言,就会报错

时间: 2025-01-08 04:14:02

java-非典型SSH项目,启动服务器,出现如下错误,求大神支招的相关文章

启动项目报的错误,求大神支招

问题描述 启动项目报的错误,求大神支招 解决方案 sleep没有捕获异常

myeclipes2015启动tomcat服务器后出现警告,求大神支招

问题描述 myeclipes2015启动tomcat服务器后出现警告,求大神支招 九月 29, 2015 11:56:17 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:User' did no

textbox-WPF项目 错误信息“无法关闭单元,因为不存在已打开的单元”,求大神支招

问题描述 WPF项目 错误信息"无法关闭单元,因为不存在已打开的单元",求大神支招 DataGrid其中一列里的TextBox,这个TextBox有值转换,对输入也做了限制,允许输入数字和"="."-".用回车切换焦点,到这一列输入除字母和数字之外的字符就会报出这个错误.代码调试不出错误,所有代码都走完之后会报出这个错误.而且是有些电脑运行不出错,有些就出错. 解决方案 请附代码,看下具体在哪里报错

ssh整合jar包 求大神支招

问题描述 ssh整合jar包 求大神支招 想知道 asm-attrs.jar 和 asm.jar 这两个jar包的区别,同时使用时会出现异常

jni-C语言通过JNI传出对象到Java层,如何实现使用统一对象接口传出?求大神支招

问题描述 C语言通过JNI传出对象到Java层,如何实现使用统一对象接口传出?求大神支招 小弟最近研究跨平台相关知识,android层调用JNI时,如何获取到底层C语言库传出的事件消息, 难点主要在于,事件消息为char数组,在C中可强转为指定结构体接收数据,但是要在android层接收这些数据并处理,应该怎样做才好, 求求各位大神给点思路... 解决方案 JNI中调用JAVA接口就可以

没学过java 我想自学求大神支招我该看什么书?

问题描述 最近想学点东西充实自己顺便找个工作想学JAVA大神给支支招我该看什么书,从哪学起,我学过一点C语言?????? 解决方案 解决方案二: 解决方案三:看jdk的jdoc解决方案四:java入门还是跟着视频走吧.java界比较权威的java编程思想和java核心技术都不适合初学者看百度下尚学堂马士兵或者圣思源张龙他们的视频都不错,建议楼主跟着他们入门.看完后可以看java编程思想或java核心技术,进行进阶提升.解决方案五:哦,视频很好,网上有很多java的视频的个人推荐斯坦福的那个jav

关于SSH的问题! Could not execute action: /mainaction 求大神支招!困扰5天了,什么方法都用了!!帮帮忙呀!!

问题描述 问题:如下014-9-2714:17:04org.apache.catalina.core.AprLifecycleListenerinit信息:TheApacheTomcatNativelibrarywhichallowsoptimalperformanceinproductionenvironmentswasnotfoundonthejava.library.path:E:anzhuangbaoMyEclipsebin;E:anzhuangbaoMyEclipsemyeclipse

C语言通过JNI传出对象到Java层,如何实现使用统一对象接口传出?求大神支招

问题描述 小弟最近研究跨平台相关知识,android层调用JNI时,如何获取到底层C语言库传出的事件消息,难点主要在于,事件消息为char数组,在C中可强转为指定结构体接收数据,但是要在android层接收这些数据并处理,应该怎样做才好,求求各位大神给点思路...

ssh-项目启动时c3p0报错 求大神

问题描述 项目启动时c3p0报错 求大神 com.mchange.v2.async.ThreadPoolAsynchronousRunner]com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@179d578 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! [com.mchange.v2.async.T