天天看点

“sessionFactory”创建bean时出错

十二月 07, 2018 6:34:45 下午 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\develop\Java\jdk1.8.0_181\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:/develop/Java/jdk1.8.0_181/bin/../jre/bin/client;D:/develop/Java/jdk1.8.0_181/bin/../jre/bin;D:/develop/Java/jdk1.8.0_181/bin/../jre/lib/i386;D:\develop\Java\jdk1.8.0_181\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\FEKO\7.0\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;D:\matlab\runtime\win64;D:\matlab\bin;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files\VisualSVN Server\bin;C:\Program Files\TortoiseSVN\bin;E:\学习\其他\eclipse;;.
十二月 07, 2018 6:34:45 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:crm' did not find a matching property.
十二月 07, 2018 6:34:46 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8080"]
十二月 07, 2018 6:34:46 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8009"]
十二月 07, 2018 6:34:46 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 545 ms
十二月 07, 2018 6:34:46 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
十二月 07, 2018 6:34:46 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.52
十二月 07, 2018 6:34:48 下午 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
十二月 07, 2018 6:34:48 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
18:34:48,952  INFO ContextLoader:307 - Root WebApplicationContext: initialization started
18:34:49,056  INFO XmlWebApplicationContext:578 - Refreshing Root WebApplicationContext: startup date [Fri Dec 07 18:34:49 CST 2018]; root of context hierarchy
18:34:49,105  INFO XmlBeanDefinitionReader:317 - Loading XML bean definitions from class path resource [applicationContext.xml]
18:34:49,333  INFO PropertySourcesPlaceholderConfigurer:172 - Loading properties file from class path resource [jdbc.properties]
18:34:49,388  INFO MLog:92 - MLog clients using log4j logging.
18:34:49,683  INFO C3P0Registry:216 - Initializing c3p0-0.9.2.1 [built 20-March-2013 10:47:27 +0000; debug? true; trace: 10]
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
18:34:51,657  WARN XmlWebApplicationContext:546 - Exception encountered during context initialization - cancelling refresh attempt: 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.boot.InvalidMappingException: Could not parse mapping document: null (INPUT_STREAM)
18:34:51,659 ERROR ContextLoader:353 - Context initialization 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.boot.InvalidMappingException: Could not parse mapping document: null (INPUT_STREAM)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:753)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.hibernate.boot.InvalidMappingException: Could not parse mapping document: null (INPUT_STREAM)
	at org.hibernate.boot.jaxb.internal.InputStreamXmlSource.doBind(InputStreamXmlSource.java:46)
	at org.hibernate.boot.jaxb.internal.InputStreamXmlSource.doBind(InputStreamXmlSource.java:38)
	at org.hibernate.boot.spi.XmlMappingBinderAccess.bind(XmlMappingBinderAccess.java:94)
	at org.hibernate.boot.MetadataSources.addInputStream(MetadataSources.java:381)
	at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:476)
	at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:322)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
	... 21 more
Caused by: org.hibernate.boot.MappingException: Unable to perform unmarshalling at line number 9 and column 39. Message: cvc-complex-type.2.4.a: 发现了以元素 'generator' 开头的无效内容。应以 '{"http://www.hibernate.org/xsd/orm/hbm":discriminator, "http://www.hibernate.org/xsd/orm/hbm":natural-id, "http://www.hibernate.org/xsd/orm/hbm":version, "http://www.hibernate.org/xsd/orm/hbm":timestamp, "http://www.hibernate.org/xsd/orm/hbm":multi-tenancy, "http://www.hibernate.org/xsd/orm/hbm":idbag, "http://www.hibernate.org/xsd/orm/hbm":property, "http://www.hibernate.org/xsd/orm/hbm":many-to-one, "http://www.hibernate.org/xsd/orm/hbm":one-to-one, "http://www.hibernate.org/xsd/orm/hbm":component, "http://www.hibernate.org/xsd/orm/hbm":dynamic-component, "http://www.hibernate.org/xsd/orm/hbm":properties, "http://www.hibernate.org/xsd/orm/hbm":any, "http://www.hibernate.org/xsd/orm/hbm":map, "http://www.hibernate.org/xsd/orm/hbm":set, "http://www.hibernate.org/xsd/orm/hbm":list, "http://www.hibernate.org/xsd/orm/hbm":bag, "http://www.hibernate.org/xsd/orm/hbm":array, "http://www.hibernate.org/xsd/orm/hbm":primitive-array, "http://www.hibernate.org/xsd/orm/hbm":join, "http://www.hibernate.org/xsd/orm/hbm":subclass, "http://www.hibernate.org/xsd/orm/hbm":joined-subclass, "http://www.hibernate.org/xsd/orm/hbm":union-subclass, "http://www.hibernate.org/xsd/orm/hbm":loader, "http://www.hibernate.org/xsd/orm/hbm":sql-insert, "http://www.hibernate.org/xsd/orm/hbm":sql-update, "http://www.hibernate.org/xsd/orm/hbm":sql-delete, "http://www.hibernate.org/xsd/orm/hbm":filter, "http://www.hibernate.org/xsd/orm/hbm":fetch-profile, "http://www.hibernate.org/xsd/orm/hbm":resultset, "http://www.hibernate.org/xsd/orm/hbm":query, "http://www.hibernate.org/xsd/orm/hbm":sql-query}' 之一开头。 : origin(null)
	at org.hibernate.boot.jaxb.internal.AbstractBinder.jaxb(AbstractBinder.java:177)
	at org.hibernate.boot.jaxb.internal.MappingBinder.doBind(MappingBinder.java:61)
	at org.hibernate.boot.jaxb.internal.AbstractBinder.doBind(AbstractBinder.java:102)
	at org.hibernate.boot.jaxb.internal.AbstractBinder.bind(AbstractBinder.java:57)
	at org.hibernate.boot.jaxb.internal.InputStreamXmlSource.doBind(InputStreamXmlSource.java:43)
	... 28 more
Caused by: javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 39; cvc-complex-type.2.4.a: 发现了以元素 'generator' 开头的无效内容。应以 '{"http://www.hibernate.org/xsd/orm/hbm":discriminator, "http://www.hibernate.org/xsd/orm/hbm":natural-id, "http://www.hibernate.org/xsd/orm/hbm":version, "http://www.hibernate.org/xsd/orm/hbm":timestamp, "http://www.hibernate.org/xsd/orm/hbm":multi-tenancy, "http://www.hibernate.org/xsd/orm/hbm":idbag, "http://www.hibernate.org/xsd/orm/hbm":property, "http://www.hibernate.org/xsd/orm/hbm":many-to-one, "http://www.hibernate.org/xsd/orm/hbm":one-to-one, "http://www.hibernate.org/xsd/orm/hbm":component, "http://www.hibernate.org/xsd/orm/hbm":dynamic-component, "http://www.hibernate.org/xsd/orm/hbm":properties, "http://www.hibernate.org/xsd/orm/hbm":any, "http://www.hibernate.org/xsd/orm/hbm":map, "http://www.hibernate.org/xsd/orm/hbm":set, "http://www.hibernate.org/xsd/orm/hbm":list, "http://www.hibernate.org/xsd/orm/hbm":bag, "http://www.hibernate.org/xsd/orm/hbm":array, "http://www.hibernate.org/xsd/orm/hbm":primitive-array, "http://www.hibernate.org/xsd/orm/hbm":join, "http://www.hibernate.org/xsd/orm/hbm":subclass, "http://www.hibernate.org/xsd/orm/hbm":joined-subclass, "http://www.hibernate.org/xsd/orm/hbm":union-subclass, "http://www.hibernate.org/xsd/orm/hbm":loader, "http://www.hibernate.org/xsd/orm/hbm":sql-insert, "http://www.hibernate.org/xsd/orm/hbm":sql-update, "http://www.hibernate.org/xsd/orm/hbm":sql-delete, "http://www.hibernate.org/xsd/orm/hbm":filter, "http://www.hibernate.org/xsd/orm/hbm":fetch-profile, "http://www.hibernate.org/xsd/orm/hbm":resultset, "http://www.hibernate.org/xsd/orm/hbm":query, "http://www.hibernate.org/xsd/orm/hbm":sql-query}' 之一开头。]
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:468)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:448)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:420)
	at org.hibernate.boot.jaxb.internal.AbstractBinder.jaxb(AbstractBinder.java:171)
	... 32 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 39; cvc-complex-type.2.4.a: 发现了以元素 'generator' 开头的无效内容。应以 '{"http://www.hibernate.org/xsd/orm/hbm":discriminator, "http://www.hibernate.org/xsd/orm/hbm":natural-id, "http://www.hibernate.org/xsd/orm/hbm":version, "http://www.hibernate.org/xsd/orm/hbm":timestamp, "http://www.hibernate.org/xsd/orm/hbm":multi-tenancy, "http://www.hibernate.org/xsd/orm/hbm":idbag, "http://www.hibernate.org/xsd/orm/hbm":property, "http://www.hibernate.org/xsd/orm/hbm":many-to-one, "http://www.hibernate.org/xsd/orm/hbm":one-to-one, "http://www.hibernate.org/xsd/orm/hbm":component, "http://www.hibernate.org/xsd/orm/hbm":dynamic-component, "http://www.hibernate.org/xsd/orm/hbm":properties, "http://www.hibernate.org/xsd/orm/hbm":any, "http://www.hibernate.org/xsd/orm/hbm":map, "http://www.hibernate.org/xsd/orm/hbm":set, "http://www.hibernate.org/xsd/orm/hbm":list, "http://www.hibernate.org/xsd/orm/hbm":bag, "http://www.hibernate.org/xsd/orm/hbm":array, "http://www.hibernate.org/xsd/orm/hbm":primitive-array, "http://www.hibernate.org/xsd/orm/hbm":join, "http://www.hibernate.org/xsd/orm/hbm":subclass, "http://www.hibernate.org/xsd/orm/hbm":joined-subclass, "http://www.hibernate.org/xsd/orm/hbm":union-subclass, "http://www.hibernate.org/xsd/orm/hbm":loader, "http://www.hibernate.org/xsd/orm/hbm":sql-insert, "http://www.hibernate.org/xsd/orm/hbm":sql-update, "http://www.hibernate.org/xsd/orm/hbm":sql-delete, "http://www.hibernate.org/xsd/orm/hbm":filter, "http://www.hibernate.org/xsd/orm/hbm":fetch-profile, "http://www.hibernate.org/xsd/orm/hbm":resultset, "http://www.hibernate.org/xsd/orm/hbm":query, "http://www.hibernate.org/xsd/orm/hbm":sql-query}' 之一开头。
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:453)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3231)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1791)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741)
	at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.startElement(ValidatorHandlerImpl.java:568)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(ValidatingUnmarshaller.java:86)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.java:60)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXEventConnector.handleStartElement(StAXEventConnector.java:246)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXEventConnector.bridge(StAXEventConnector.java:115)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:445)
	... 34 more
十二月 07, 2018 6:34:51 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
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.boot.InvalidMappingException: Could not parse mapping document: null (INPUT_STREAM)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:753)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.hibernate.boot.InvalidMappingException: Could not parse mapping document: null (INPUT_STREAM)
	at org.hibernate.boot.jaxb.internal.InputStreamXmlSource.doBind(InputStreamXmlSource.java:46)
	at org.hibernate.boot.jaxb.internal.InputStreamXmlSource.doBind(InputStreamXmlSource.java:38)
	at org.hibernate.boot.spi.XmlMappingBinderAccess.bind(XmlMappingBinderAccess.java:94)
	at org.hibernate.boot.MetadataSources.addInputStream(MetadataSources.java:381)
	at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:476)
	at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:322)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
	... 21 more
Caused by: org.hibernate.boot.MappingException: Unable to perform unmarshalling at line number 9 and column 39. Message: cvc-complex-type.2.4.a: 发现了以元素 'generator' 开头的无效内容。应以 '{"http://www.hibernate.org/xsd/orm/hbm":discriminator, "http://www.hibernate.org/xsd/orm/hbm":natural-id, "http://www.hibernate.org/xsd/orm/hbm":version, "http://www.hibernate.org/xsd/orm/hbm":timestamp, "http://www.hibernate.org/xsd/orm/hbm":multi-tenancy, "http://www.hibernate.org/xsd/orm/hbm":idbag, "http://www.hibernate.org/xsd/orm/hbm":property, "http://www.hibernate.org/xsd/orm/hbm":many-to-one, "http://www.hibernate.org/xsd/orm/hbm":one-to-one, "http://www.hibernate.org/xsd/orm/hbm":component, "http://www.hibernate.org/xsd/orm/hbm":dynamic-component, "http://www.hibernate.org/xsd/orm/hbm":properties, "http://www.hibernate.org/xsd/orm/hbm":any, "http://www.hibernate.org/xsd/orm/hbm":map, "http://www.hibernate.org/xsd/orm/hbm":set, "http://www.hibernate.org/xsd/orm/hbm":list, "http://www.hibernate.org/xsd/orm/hbm":bag, "http://www.hibernate.org/xsd/orm/hbm":array, "http://www.hibernate.org/xsd/orm/hbm":primitive-array, "http://www.hibernate.org/xsd/orm/hbm":join, "http://www.hibernate.org/xsd/orm/hbm":subclass, "http://www.hibernate.org/xsd/orm/hbm":joined-subclass, "http://www.hibernate.org/xsd/orm/hbm":union-subclass, "http://www.hibernate.org/xsd/orm/hbm":loader, "http://www.hibernate.org/xsd/orm/hbm":sql-insert, "http://www.hibernate.org/xsd/orm/hbm":sql-update, "http://www.hibernate.org/xsd/orm/hbm":sql-delete, "http://www.hibernate.org/xsd/orm/hbm":filter, "http://www.hibernate.org/xsd/orm/hbm":fetch-profile, "http://www.hibernate.org/xsd/orm/hbm":resultset, "http://www.hibernate.org/xsd/orm/hbm":query, "http://www.hibernate.org/xsd/orm/hbm":sql-query}' 之一开头。 : origin(null)
	at org.hibernate.boot.jaxb.internal.AbstractBinder.jaxb(AbstractBinder.java:177)
	at org.hibernate.boot.jaxb.internal.MappingBinder.doBind(MappingBinder.java:61)
	at org.hibernate.boot.jaxb.internal.AbstractBinder.doBind(AbstractBinder.java:102)
	at org.hibernate.boot.jaxb.internal.AbstractBinder.bind(AbstractBinder.java:57)
	at org.hibernate.boot.jaxb.internal.InputStreamXmlSource.doBind(InputStreamXmlSource.java:43)
	... 28 more
Caused by: javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 39; cvc-complex-type.2.4.a: 发现了以元素 'generator' 开头的无效内容。应以 '{"http://www.hibernate.org/xsd/orm/hbm":discriminator, "http://www.hibernate.org/xsd/orm/hbm":natural-id, "http://www.hibernate.org/xsd/orm/hbm":version, "http://www.hibernate.org/xsd/orm/hbm":timestamp, "http://www.hibernate.org/xsd/orm/hbm":multi-tenancy, "http://www.hibernate.org/xsd/orm/hbm":idbag, "http://www.hibernate.org/xsd/orm/hbm":property, "http://www.hibernate.org/xsd/orm/hbm":many-to-one, "http://www.hibernate.org/xsd/orm/hbm":one-to-one, "http://www.hibernate.org/xsd/orm/hbm":component, "http://www.hibernate.org/xsd/orm/hbm":dynamic-component, "http://www.hibernate.org/xsd/orm/hbm":properties, "http://www.hibernate.org/xsd/orm/hbm":any, "http://www.hibernate.org/xsd/orm/hbm":map, "http://www.hibernate.org/xsd/orm/hbm":set, "http://www.hibernate.org/xsd/orm/hbm":list, "http://www.hibernate.org/xsd/orm/hbm":bag, "http://www.hibernate.org/xsd/orm/hbm":array, "http://www.hibernate.org/xsd/orm/hbm":primitive-array, "http://www.hibernate.org/xsd/orm/hbm":join, "http://www.hibernate.org/xsd/orm/hbm":subclass, "http://www.hibernate.org/xsd/orm/hbm":joined-subclass, "http://www.hibernate.org/xsd/orm/hbm":union-subclass, "http://www.hibernate.org/xsd/orm/hbm":loader, "http://www.hibernate.org/xsd/orm/hbm":sql-insert, "http://www.hibernate.org/xsd/orm/hbm":sql-update, "http://www.hibernate.org/xsd/orm/hbm":sql-delete, "http://www.hibernate.org/xsd/orm/hbm":filter, "http://www.hibernate.org/xsd/orm/hbm":fetch-profile, "http://www.hibernate.org/xsd/orm/hbm":resultset, "http://www.hibernate.org/xsd/orm/hbm":query, "http://www.hibernate.org/xsd/orm/hbm":sql-query}' 之一开头。]
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:468)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:448)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:420)
	at org.hibernate.boot.jaxb.internal.AbstractBinder.jaxb(AbstractBinder.java:171)
	... 32 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 39; cvc-complex-type.2.4.a: 发现了以元素 'generator' 开头的无效内容。应以 '{"http://www.hibernate.org/xsd/orm/hbm":discriminator, "http://www.hibernate.org/xsd/orm/hbm":natural-id, "http://www.hibernate.org/xsd/orm/hbm":version, "http://www.hibernate.org/xsd/orm/hbm":timestamp, "http://www.hibernate.org/xsd/orm/hbm":multi-tenancy, "http://www.hibernate.org/xsd/orm/hbm":idbag, "http://www.hibernate.org/xsd/orm/hbm":property, "http://www.hibernate.org/xsd/orm/hbm":many-to-one, "http://www.hibernate.org/xsd/orm/hbm":one-to-one, "http://www.hibernate.org/xsd/orm/hbm":component, "http://www.hibernate.org/xsd/orm/hbm":dynamic-component, "http://www.hibernate.org/xsd/orm/hbm":properties, "http://www.hibernate.org/xsd/orm/hbm":any, "http://www.hibernate.org/xsd/orm/hbm":map, "http://www.hibernate.org/xsd/orm/hbm":set, "http://www.hibernate.org/xsd/orm/hbm":list, "http://www.hibernate.org/xsd/orm/hbm":bag, "http://www.hibernate.org/xsd/orm/hbm":array, "http://www.hibernate.org/xsd/orm/hbm":primitive-array, "http://www.hibernate.org/xsd/orm/hbm":join, "http://www.hibernate.org/xsd/orm/hbm":subclass, "http://www.hibernate.org/xsd/orm/hbm":joined-subclass, "http://www.hibernate.org/xsd/orm/hbm":union-subclass, "http://www.hibernate.org/xsd/orm/hbm":loader, "http://www.hibernate.org/xsd/orm/hbm":sql-insert, "http://www.hibernate.org/xsd/orm/hbm":sql-update, "http://www.hibernate.org/xsd/orm/hbm":sql-delete, "http://www.hibernate.org/xsd/orm/hbm":filter, "http://www.hibernate.org/xsd/orm/hbm":fetch-profile, "http://www.hibernate.org/xsd/orm/hbm":resultset, "http://www.hibernate.org/xsd/orm/hbm":query, "http://www.hibernate.org/xsd/orm/hbm":sql-query}' 之一开头。
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:453)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3231)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1791)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741)
	at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.startElement(ValidatorHandlerImpl.java:568)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(ValidatingUnmarshaller.java:86)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.java:60)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXEventConnector.handleStartElement(StAXEventConnector.java:246)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXEventConnector.bridge(StAXEventConnector.java:115)
	at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:445)
	... 34 more

十二月 07, 2018 6:34:51 下午 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
十二月 07, 2018 6:34:51 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/crm] startup failed due to previous errors
十二月 07, 2018 6:34:51 下午 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
十二月 07, 2018 6:34:51 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\webserver\apache-tomcat-7.0.52\webapps\docs
十二月 07, 2018 6:34:51 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\webserver\apache-tomcat-7.0.52\webapps\examples
十二月 07, 2018 6:34:52 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
十二月 07, 2018 6:34:52 下午 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
十二月 07, 2018 6:34:52 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', '[email protected]')
十二月 07, 2018 6:34:52 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\webserver\apache-tomcat-7.0.52\webapps\host-manager
十二月 07, 2018 6:34:52 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\webserver\apache-tomcat-7.0.52\webapps\manager
十二月 07, 2018 6:34:52 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\webserver\apache-tomcat-7.0.52\webapps\ROOT
十二月 07, 2018 6:34:52 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
十二月 07, 2018 6:34:52 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
十二月 07, 2018 6:34:52 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 6061 ms
十二月 07, 2018 6:35:08 下午 org.apache.catalina.core.StandardServer await
信息: A valid shutdown command was received via the shutdown port. Stopping the Server instance.
十二月 07, 2018 6:35:08 下午 org.apache.coyote.AbstractProtocol pause
信息: Pausing ProtocolHandler ["http-bio-8080"]
十二月 07, 2018 6:35:08 下午 org.apache.coyote.AbstractProtocol pause
信息: Pausing ProtocolHandler ["ajp-bio-8009"]
十二月 07, 2018 6:35:08 下午 org.apache.catalina.core.StandardService stopInternal
信息: Stopping service Catalina
十二月 07, 2018 6:35:08 下午 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextDestroyed()
十二月 07, 2018 6:35:08 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextDestroyed()
十二月 07, 2018 6:35:08 下午 org.apache.coyote.AbstractProtocol stop
信息: Stopping ProtocolHandler ["http-bio-8080"]
十二月 07, 2018 6:35:08 下午 org.apache.coyote.AbstractProtocol stop
信息: Stopping ProtocolHandler ["ajp-bio-8009"]
十二月 07, 2018 6:35:08 下午 org.apache.coyote.AbstractProtocol destroy
信息: Destroying ProtocolHandler ["http-bio-8080"]
十二月 07, 2018 6:35:08 下午 org.apache.coyote.AbstractProtocol destroy
信息: Destroying ProtocolHandler ["ajp-bio-8009"]

           

进过还一阵子的排查,终于找到错误。

“sessionFactory”创建bean时出错

问题关键就在这里,所以一定要多看console里面的提示。

“sessionFactory”创建bean时出错

标签应该一起把方式框住。正是这个原因导致不能够正确映射,创建bean 失败 。

还有一种,倘若对应前后写错了,如下图:

“sessionFactory”创建bean时出错

和配置文件的 映射关系 对不上 就报出 创建bean 失败 ,也会出现上面的错误信息!!!

有错误 一定要看错误,从错误信息里边追根溯源,可解决大多数的问题,

作为一个程序员 一定要绝对的细心 ,否则一个细微的失误就有可能造成致命的错误 . 谨记!!!共勉!!!