0 Replies Latest reply on Mar 23, 2010 9:06 AM by kmsk_1318

    JBPM with Tomcat

      Hai,

      I am creating a workflow sample application using JBPM4.3,Spring 2.5,Hibernate 3 and Tomcat 5.5. When i deployed my application, i am getting a startup error saying,

       

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/WorkflowExample-data.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from resource jbpm.identity.hbm.xml
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1260)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:438)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:383)
          at java.security.AccessController.doPrivileged(Native Method)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:264)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
          ... 22 more
      Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from resource jbpm.identity.hbm.xml
          at org.hibernate.cfg.Configuration.addResource(Configuration.java:602)
          at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1621)
          at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1589)
          at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1568)
          at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1542)
          at org.hibernate.cfg.Configuration.configure(Configuration.java:1477)
          at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:603)
          at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1288)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1257)
          ... 29 more
      Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
          at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:541)
          at org.hibernate.cfg.Configuration.addResource(Configuration.java:599)
          ... 38 more
      Caused by: org.dom4j.DocumentException: null Nested exception: null
          at org.dom4j.io.SAXReader.read(SAXReader.java:484)
          at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:532)
          ... 39 more
      

      When i tried all the test case given, it works fine in standalone. I really don't know why this exception rise.

      Some of the details for your reference.

       

      in WEB-INF/lib
              |
              |---jbpm.jar
              |---hibernate3.jar
              |---spring.jar
              |---..
      

       

      and my WorkflowSample-data.xml,

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
      <beans>
      
        <bean id="sessionFactory" singleton="false">
          <property name="configLocation" value="classpath:jbpm.hibernate.cfg.xml" />
          <property name="dataSource" ref="dataSource" />
        </bean>
        
        <bean id="transactionManager" singleton="false">
          <property name="sessionFactory" ref="sessionFactory" />
          <property name="dataSource" ref="dataSource" />
        </bean>
      
        <bean id="dataSource">
          <property name="driverClassName" value="com.mysql.jdbc.Driver" />
          <property name="url" value="jdbc:mysql://localhost:3306/jbpmdb" />
          <property name="username" value="root" />
          <property name="password" value="java" />
        </bean>
      
      </beans>

       

      WorkflowSample-service.xml,

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
      <beans>
        <bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper"/>
      
        <bean id="processEngine" factory-bean="springHelper" factory-method="createProcessEngine" />
      
      </beans>
      

      I have also attached configuration files for your reference

      Please guide me if anything is wrong here.

       

      Thanks in advance,

      Karthikeyan.