• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to resolve : org.hibernate.MappingException: Could not parse mapping document in input stream?

 
Anil Chowdary
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on an application and using Hibernate with Spring. I have coded the application in my laptopn, but when trying to copy the code and run the same on my office PD it is giving the following error:

org.hibernate.MappingException: Could not parse mapping document in input stream

Full stack:
Jul 1, 2009 3:37:17 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_06\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.6.0_06\jre\bin;C:/Program Files/Java/jre1.6.0_06/bin/client;C:/Program Files/Java/jre1.6.0_06/bin;C:\oracle\product\10.2.0\client_2\bin;C:\oracle\product\10.2.0\client_1\bin;C:\Program Files\Oracle\10.2;stemRoot%\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jre1.6.0_06\bin
Jul 1, 2009 3:37:17 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jul 1, 2009 3:37:17 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 719 ms
Jul 1, 2009 3:37:17 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jul 1, 2009 3:37:17 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.27
Jul 1, 2009 3:37:17 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jul 1, 2009 3:37:18 PM org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
Jul 1, 2009 3:37:18 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Jul 1, 2009 3:37:18 PM org.apache.catalina.core.ApplicationContext log
INFO: Loading Spring root WebApplicationContext
Jul 1, 2009 3:37:19 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
Jul 1, 2009 3:37:19 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/dataAccessContext.xml]
Jul 1, 2009 3:37:19 PM org.springframework.context.support.AbstractRefreshableApplicationContext refreshBeanFactory
INFO: Bean factory for application context [Root WebApplicationContext]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfigurer,baseMessageSource,messageSource,experianLogger,baseHrefTagConfig,urlTagConfig,multipartResolver,dataSource,hibernateProperties,mySessionFactory,experianUploadBO,experianUploadDao,pdfUtility,excelUtility]; root of BeanFactory hierarchy
Jul 1, 2009 3:37:19 PM org.springframework.context.support.AbstractApplicationContext refresh
INFO: 14 beans defined in application context [Root WebApplicationContext]
Jul 1, 2009 3:37:19 PM org.springframework.core.io.support.PropertiesLoaderSupport loadProperties
INFO: Loading properties file from ServletContext resource [/WEB-INF/fexp_dev.properties]
Jul 1, 2009 3:37:19 PM org.springframework.core.io.support.PropertiesLoaderSupport loadProperties
INFO: Loading properties file from ServletContext resource [/WEB-INF/jdbc_dev.properties]
Jul 1, 2009 3:37:19 PM org.springframework.core.CollectionFactory <clinit>
INFO: Commons Collections 3.x available
Jul 1, 2009 3:37:19 PM org.springframework.context.support.AbstractApplicationContext initMessageSource
INFO: Using MessageSource [org.springframework.context.support.ResourceBundleMessageSource: basenames=[com.nna.nissan.resources.experianupload,com.nna.nissan.resources.reports,com.nna.nissan.resources.statusupdate]]
Jul 1, 2009 3:37:19 PM org.springframework.context.support.AbstractApplicationContext initApplicationEventMulticaster
INFO: Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@f37a62]
Jul 1, 2009 3:37:19 PM org.springframework.ui.context.support.UiApplicationContextUtils initThemeSource
INFO: Unable to locate ThemeSource with name 'themeSource': using default [org.springframework.ui.context.support.ResourceBundleThemeSource@1d86a73]
Jul 1, 2009 3:37:19 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfigurer,baseMessageSource,messageSource,experianLogger,baseHrefTagConfig,urlTagConfig,multipartResolver,dataSource,hibernateProperties,mySessionFactory,experianUploadBO,experianUploadDao,pdfUtility,excelUtility]; root of BeanFactory hierarchy]
Jul 1, 2009 3:37:19 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.1.3
Jul 1, 2009 3:37:19 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Jul 1, 2009 3:37:19 PM org.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
Jul 1, 2009 3:37:19 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
Jul 1, 2009 3:37:19 PM org.springframework.beans.factory.support.AbstractBeanFactory destroySingletons
INFO: Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfigurer,baseMessageSource,messageSource,experianLogger,baseHrefTagConfig,urlTagConfig,multipartResolver,dataSource,hibernateProperties,mySessionFactory,experianUploadBO,experianUploadDao,pdfUtility,excelUtility]; root of BeanFactory hierarchy}
Jul 1, 2009 3:37:19 PM org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in ServletContext resource [/WEB-INF/dataAccessContext.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingException: Could not parse mapping document in input stream
org.hibernate.MappingException: Could not parse mapping document in input stream

at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:431)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:631)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1058)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:318)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: org.dom4j.DocumentException: Can't find bundle for base name com.sun.org.apache.xerces.internal.impl.msg.SAXMessages, locale en_US Nested exception: Can't find bundle for base name com.sun.org.apache.xerces.internal.impl.msg.SAXMessages, locale en_US
at org.dom4j.io.SAXReader.read(SAXReader.java:484)

at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:422)
... 38 more
Caused by: java.util.MissingResourceException: Can't find bundle for base name com.sun.org.apache.xerces.internal.impl.msg.SAXMessages, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1521
)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:787)
at com.sun.org.apache.xerces.internal.util.SAXMessageFormatter.formatMessage(SAXMessageFormatter.java:53)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.getProperty(AbstractSAXParser.java:2060)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.setProperty(SAXParserImpl.java:467)
at org.dom4j.io.SAXHelper.setParserProperty(SAXHelper.java:34)
at org.dom4j.io.SAXReader.configureReader(SAXReader.java:911)
at org.dom4j.io.SAXReader.read(SAXReader.java:463)
... 39 more

Any help, greatly appreciated.
 
Lalit Bhatt
Ranch Hand
Posts: 69
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a doubt to understand better:

Two Questsions:
- Are the two machines in different Operating system ?
- Did you put the path with directory structure which got changed? If you paste your spring config XML, that might help better to get some clue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic