首页新闻找找看学习计划

大神们帮忙看看这个错误、谢谢org.hibernate.boot.InvalidMappingException: Could not parse mapping document: null (INPUT_STREAM)

0
悬赏园豆:20 [已解决问题] 解决于 2018-07-31 10:16

"C:\Program Files\Java\jre1.8.0_40\bin\java" -Dcatalina.base=C:\Users\29161\.IntelliJIdea2017.2\system\tomcat\Unnamed_homeWork -Dcatalina.home=D:\编程软件\tomcat -Djava.io.tmpdir=D:\编程软件\tomcat\temp -Dcom.sun.management.jmxremote= -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=127.0.0.1 -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:54258,suspend=y,server=n -jar D:\编程软件\tomcat\bin\bootstrap.jar start [2018-07-31 08:08:33,967] Artifact homeWork:war exploded: Waiting for server connection to start artifact deployment... Connected to the target VM, address: '127.0.0.1:54258', transport: 'socket' 七月 31, 2018 8:08:35 上午 org.apache.catalina.startup.ClassLoaderFactory validateFile 警告: Problem with directory [D:\±à???í??\tomcat\lib], exists: [false], isDirectory: [false], canRead: [false] 七月 31, 2018 8:08:35 上午 org.apache.catalina.startup.ClassLoaderFactory validateFile 警告: Problem with directory [D:\±à???í??\tomcat\lib], exists: [false], isDirectory: [false], canRead: [false] 七月 31, 2018 8:08:36 上午 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: C:\Program Files\Java\jre1.8.0_40\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;E:\BEIKE-ORACLECLICENT\instantclient_12_2\bin;C:\ProgramData\Oracle\Java\javapath;D:\Python27\;D:\Python27\Scripts;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;D:\Program Files\MySQL\MySQL Server 5.5\bin;D:\Program Files\nodejs\;D:\Program Files\Git\cmd;D:\Program Files\TortoiseSVN\bin;E:\BEIKE-ORACLECLICENT\instantclient_12_2\;;C:\WINDOWS\System32\OpenSSH\;C:\Users\29161\AppData\Local\Microsoft\WindowsApps;C:\Users\29161\AppData\Roaming\npm;C:\Users\29161\AppData\Local\GitHubDesktop\bin;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;;. 七月 31, 2018 8:08:37 上午 org.apache.coyote.http11.Http11Protocol init 信息: Initializing Coyote HTTP/1.1 on http-80 七月 31, 2018 8:08:37 上午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 1395 ms 七月 31, 2018 8:08:37 上午 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 七月 31, 2018 8:08:37 上午 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/6.0.44 七月 31, 2018 8:08:37 上午 org.apache.coyote.http11.Http11Protocol start 信息: Starting Coyote HTTP/1.1 on http-80 七月 31, 2018 8:08:37 上午 org.apache.jk.common.ChannelSocket init 信息: JK: ajp13 listening on /0.0.0.0:8009 七月 31, 2018 8:08:37 上午 org.apache.jk.server.JkMain start 信息: Jk running ID=0 time=0/31 config=null 七月 31, 2018 8:08:37 上午 org.apache.catalina.startup.Catalina start 信息: Server startup in 169 ms Connected to server [2018-07-31 08:08:37,593] Artifact homeWork:war exploded: Artifact is being deployed, please wait... 七月 31, 2018 8:08:39 上午 org.apache.catalina.loader.WebappClassLoader validateJarFile 信息: validateJarFile(E:\IDEAWorkPlaceForWork\first\homeWork\out\artifacts\homeWork_war_exploded\WEB-INF\lib\javax.servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 七月 31, 2018 8:08:42 上午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 七月 31, 2018 8:08:50 上午 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 'xtCsDao': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:/E:/IDEAWorkPlaceForWork/first/homeWork/out/artifacts/homeWork_war_exploded/WEB-INF/classes/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.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:321) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) 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:761) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:802) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1432) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:631) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:568) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:295) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl.access$300(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl.invoke(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source) at sun.rmi.transport.Transport$1.run(Unknown Source) at sun.rmi.transport.Transport$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Unknown Source) at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$254(Unknown Source) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$2/156804141.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:/E:/IDEAWorkPlaceForWork/first/homeWork/out/artifacts/homeWork_war_exploded/WEB-INF/classes/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:1628) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) 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:202) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:522) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:496) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:627) at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:169) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:318) ... 58 more 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:475) at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:412) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624) ... 70 more Caused by: org.hibernate.boot.MappingException: Unable to perform unmarshalling at line number 8 and column 9. Message: cvc-complex-type.2.4.a: 发现了以元素 'property' 开头的无效内容。应以 '{"http://www.hibernate.org/xsd/orm/hbm":meta, "http://www.hibernate.org/xsd/orm/hbm":tuplizer, "http://www.hibernate.org/xsd/orm/hbm":subselect, "http://www.hibernate.org/xsd/orm/hbm":cache, "http://www.hibernate.org/xsd/orm/hbm":natural-id-cache, "http://www.hibernate.org/xsd/orm/hbm":synchronize, "http://www.hibernate.org/xsd/orm/hbm":comment, "http://www.hibernate.org/xsd/orm/hbm":id, "http://www.hibernate.org/xsd/orm/hbm":composite-id}' 之一开头。 : 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) ... 77 more Caused by: javax.xml.bind.UnmarshalException - with linked exception: [org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 9; cvc-complex-type.2.4.a: 发现了以元素 'property' 开头的无效内容。应以 '{"http://www.hibernate.org/xsd/orm/hbm":meta, "http://www.hibernate.org/xsd/orm/hbm":tuplizer, "http://www.hibernate.org/xsd/orm/hbm":subselect, "http://www.hibernate.org/xsd/orm/hbm":cache, "http://www.hibernate.org/xsd/orm/hbm":natural-id-cache, "http://www.hibernate.org/xsd/orm/hbm":synchronize, "http://www.hibernate.org/xsd/orm/hbm":comment, "http://www.hibernate.org/xsd/orm/hbm":id, "http://www.hibernate.org/xsd/orm/hbm":composite-id}' 之一开头。] at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unknown Source) at org.hibernate.boot.jaxb.internal.AbstractBinder.jaxb(AbstractBinder.java:171) ... 81 more Caused by: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 9; cvc-complex-type.2.4.a: 发现了以元素 'property' 开头的无效内容。应以 '{"http://www.hibernate.org/xsd/orm/hbm":meta, "http://www.hibernate.org/xsd/orm/hbm":tuplizer, "http://www.hibernate.org/xsd/orm/hbm":subselect, "http://www.hibernate.org/xsd/orm/hbm":cache, "http://www.hibernate.org/xsd/orm/hbm":natural-id-cache, "http://www.hibernate.org/xsd/orm/hbm":synchronize, "http://www.hibernate.org/xsd/orm/hbm":comment, "http://www.hibernate.org/xsd/orm/hbm":id, "http://www.hibernate.org/xsd/orm/hbm":composite-id}' 之一开头。 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.startElement(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXEventConnector.handleStartElement(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXEventConnector.bridge(Unknown Source) ... 84 more 七月 31, 2018 8:08:50 上午 org.apache.catalina.core.ApplicationContext log 信息: Set web app root system property: 'webapp.root' = [E:\IDEAWorkPlaceForWork\first\homeWork\out\artifacts\homeWork_war_exploded\] 七月 31, 2018 8:08:50 上午 org.apache.catalina.core.ApplicationContext log 信息: Initializing log4j from [classpath:log4j.properties] 七月 31, 2018 8:08:50 上午 org.apache.catalina.core.StandardContext start 严重: Error listenerStart 七月 31, 2018 8:08:50 上午 org.apache.catalina.core.StandardContext start 严重: Context [/HelloWorld] startup failed due to previous errors 七月 31, 2018 8:08:50 上午 org.apache.catalina.core.ApplicationContext log 信息: Shutting down log4j 七月 31, 2018 8:08:50 上午 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext [2018-07-31 08:08:52,374] Artifact homeWork:war exploded: Error during artifact deployment. See server log for details.

岷州李斌的主页 岷州李斌 | 初学一级 | 园豆:127
提问于:2018-07-31 08:14
< >
分享
最佳答案
0

org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 9; cvc-complex-type.2.4.a: 发现了以元素 'property' 开头的无效内容。应以 '{"http://www.hibernate.org/xsd/orm/hbm":meta, "http://www.hibernate.org/xsd/orm/hbm":tuplizer, "http://www.hibernate.org/xsd/orm/hbm":subselect, "http://www.hibernate.org/xsd/orm/hbm":cache, "http://www.hibernate.org/xsd/orm/hbm":natural-id-cache, "http://www.hibernate.org/xsd/orm/hbm":synchronize, "http://www.hibernate.org/xsd/orm/hbm":comment, "http://www.hibernate.org/xsd/orm/hbm":id, "http://www.hibernate.org/xsd/orm/hbm":composite-id}' 之一开头


从这里看出来是映射文件有问题、我把xx.hbm.xml映射文件检查了一遍之后发现确实有一个映射文件不对、重新生成了一遍之后就好了

岷州李斌 | 初学一级 |园豆:127 | 2018-07-31 10:16
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册