3 Replies Latest reply on May 2, 2008 5:55 AM by Ales Justin

    Could not parse mapping document from input stream

    Chaya Ramu Newbie

      Hi,

      We are getting the below exception while deploying a war to JBoss 4.2.2 GA installed on Linux machine:

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
      Caused by:
      org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
       at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:508)
       at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:656)
       at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1202)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:428)
       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
       at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
       at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
       at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
       at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
       at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
       at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
       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:585)
       at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
       at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
       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:585)
       at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
       at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
       .
       .
       .
       .
       .
       .
       2008-05-01 19:43:35,205 INFO [STDOUT] MBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy9.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      Caused by: org.dom4j.DocumentException: org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory
       at org.dom4j.io.SAXReader.read(SAXReader.java:484)
       at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:499)
       ... 104 more
      


      Before deployment we have tested this war file on a different JBoss 4.2.2GA server installed on Windows OS. Basically we are moving the war file from Test to Prod
      envirnoment.

      Below is the list of jar files under jboss-4.2.2.GA/server/default/lib folder:

      activation.jar jboss-common-jdbc-wrapper.jar jbossts-common.jar
      antlr.jar jboss-ejb3x.jar jbossws-common.jar
      autonumber-plugin.jar jboss-hibernate.jar jbossws-framework.jar
      bcel.jar jboss-j2ee.jar jbossws-jboss42.jar
      bindingservice-plugin.jar jboss-jaxrpc.jar jbossws-spi.jar
      bsf.jar jboss-jaxws.jar jcommon-0.9.5.jar
      bsh-deployer.jar jboss-jca.jar jfreechart-0.9.20.jar
      bsh.jar jboss-jsr77.jar jmx-adaptor-plugin.jar
      cglib.jar jboss-jsr88.jar jnpserver.jar
      commons-beanutils-1.6.1.jar jboss-management.jar joesnmp.jar
      commons-codec-1.2.jar jboss-monitoring.jar jpl-pattern.jar
      commons-codec.jar jboss-remoting-int.jar jpl-util.jar
      commons-collections-3.0.jar jboss-remoting.jar jsp-api.jar
      commons-collections.jar jboss-saaj.jar jstl.jar
      commons-digester-1.5.jar jboss-seam-debug.jar log4j-snmp-appender.jar
      commons-el.jar jboss-seam-gen.jar log4j.jar
      commons-fileupload-1.0.jar jboss-seam-ioc.jar mail-plugin.jar
      commons-httpclient.jar jboss-seam-mail.jar mail.jar
      commons-lang-2.1.jar jboss-seam-pdf.jar myfaces-api.jar
      commons-logging.jar jboss-seam-remoting.jar myfaces-impl.jar
      dom4j.jar jboss-seam-ui.jar poi-3.0.1-FINAL-20070705.jar
      dwr.jar jboss-seam-wicket.jar poi-contrib-3.0.1-FINAL-20070705.jar
      ejb3-persistence.jar jboss-seam.jar poi-scratchpad-3.0.1-FINAL-20070705.jar
      el-api.jar jboss-serialization.jar postgresql-8.1-410.jdbc2ee.jar
      hibernate-annotations.jar jboss-srp.jar properties-plugin.jar
      hibernate-entitymanager.jar jboss-system.jar quartz.jar
      hibernate3.jar jboss-transaction.jar sandbox.jar
      hsqldb-plugin.jar jboss-vfs.jar scheduler-plugin-example.jar
      hsqldb.jar jboss.jar scheduler-plugin.jar
      iText-2.0.7.jar jbossjta-integration.jar servlet-api.jar
      javassist.jar jbossjta.jar spring.jar
      jaxen.jar jbossmq.jar tomahawk.jar
      jboss-cache-jdk50.jar jbosssx.jar xmlentitymgr.jar
      
      


      Below is the list of jar files under our WAR WEB-INF/lib folder:

      activation.jar
      antlr-2.7.6.jar
      cglib.jar
      commons-beanutils-1.7.0.jar
      commons-digester-1.8.jar
      commons-fileupload-1.1.1.jar
      commons-httpclient-3.0.1.jar
      commons-io-1.1.jar
      commons-lang-2.2.jar
      commons-logging-1.0.4.jar
      commons-validator-1.1.4.jar
      dom4j-1.4.jar
      ehcache-1.3.0.jar
      gwt-servlet.jar
      gwt-user.jar
      gwt-widgets-server-0.1.2.jar
      gwtext.jar
      gwtextux-0[1].1.1.jar
      jta.jar
      log4j-1.2.8.jar
      mail.jar
      struts.jar
      velocity-1.5-dev.jar
      velocity-tools-1.2.jar
      


      We also tried to move spring.jar file from default/lib to WEB-INF/lib but still got the same error. Could any one of you please point us or help us to resolve this issue?

      Thank you,
      Chaya