[jboss-user] [jBPM Users] - Re: Problem moving from 4.1 to 4.2 using Spring configuratio

hrworx do-not-reply at jboss.com
Fri Nov 13 08:11:21 EST 2009


Santanu,

Thanks much for your continued support on this.  I will not have time to thoroughly investigate your latest suggestions since I am traveling today, but I will do so over the weekend.  I quick try of everything did not yet yield positive results.

Putting this
 <hibernate-configuration>
  |       <cfg resource="jbpm.hibernate.cfg.xml" />     
  |     </hibernate-configuration>

 in jbpm.cfg.xml, but outside the jbpm-configuration block gives
Could not instantiate bean class [org.jbpm.pvm.internal.cfg.SpringConfiguration]: Constructor threw exception; nested exception is org.jbpm.api.JbpmException: 
  |   xml validation error: The markup in the document following the root element must be well-formed.

Putting it inside the jbpm-configuration block has no effect.

The second suggestion is a little confusing to me in several ways.  First there is other important configuration in jbpm.hibernate.cfg.xml besides the imports of the other configuration files, and second, when I try to add mappingLocations to my session factory, it does not know about a mappingLocations property. Third, this was working fine in 4.0 and 4.1 without telling the session factory about jbpm.hibernate.cfg.xml.  Somehow it was getting picked up.



First, here is my test jbpm.hibernate.cfg.xml for reference:

<hibernate-configuration>
  |   <session-factory>
  |     <!--
  |       TODO refactor this, along with persistence.xml so that the
  |       following lines only appear in one place
  |     -->
  |     <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
  |     <property name="hibernate.show_sql">true</property>
  |     <property name="hibernate.format_sql">false</property>
  |     <property name="hibernate.archive.autodetection">class</property>
  |     <property name="hibernate.connection.url">jdbc:hsqldb:target/test-hibernate</property>
  |     <property name="hibernate.connection.username">sa</property>
  |     <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
  | 
  | 
  |     <property name="hibernate.connection.password"></property>
  |     <property name="hibernate.hbm2ddl.auto">create-drop</property>
  | 
  | 
  |     <mapping resource="jbpm.repository.hbm.xml" />
  |     <mapping resource="jbpm.execution.hbm.xml" />
  |     <mapping resource="jbpm.history.hbm.xml" />
  |     <mapping resource="jbpm.task.hbm.xml" />
  |     <mapping resource="jbpm.identity.hbm.xml" />
  | 
  |   </session-factory>
  | </hibernate-configuration>

Then the error when I try to add the mappingsLocations:

 <bean id="entityManagerFactory"
  |     class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  |     <property name="jpaVendorAdapter" ref="jpaVendorAdapter" />
  |     <property name="persistenceUnitManager" ref="persistenceUnitManager" />
  |   </bean>
  | 
  |   <!-- Publishing session factory for use in jBPM -->
  |   <bean id="sessionFactory" factory-bean="entityManagerFactory"
  |     factory-method="getSessionFactory">
  |     <property name="mappingLocations">
  |       <list>
  |         <value>classpath:jbpm.execution.hbm.xml</value>
  |         <value>classpath:jbpm.repository.hbm.xml</value>
  |         <value>classpath:jbpm.task.hbm.xml</value>
  |         <value>classpath:jbpm.history.hbm.xml</value>
  |       </list>
  |     </property>
  |   </bean>

Error creating bean with name 'sessionFactory' defined in class path resource [context/core/spring-dbContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'mappingLocations' of bean class [org.hibernate.impl.SessionFactoryImpl]: Bean property 'mappingLocations' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

Any further suggestions you may have, I will try to look at over the weekend.

Thanks again.



View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265498#4265498

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265498



More information about the jboss-user mailing list