Bom dia, pessoal,
estou tentando mapear um auto relacionamento e recebo o seguinte erro: Error creating bean with name 'transactionManager' defined in file [G:\dev\ws\smartbiz\WEB-INF\src\springConfig.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [G:\dev\ws\smartbiz\WEB-INF\src\springConfig.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z
Alguém tem alguma idéia do que pode ser?
Classe UIComponent:@OneToMany
@Fetch(FetchMode.SUBSELECT)
@Cascade( { org.hibernate.annotations.CascadeType.MERGE,
org.hibernate.annotations.CascadeType.SAVE_UPDATE })
public Set<UIComponent> children = new HashSet<UIComponent>();
@ManyToOne
public UIComponent parent;
springConfig.xml
...
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
destroy-method="destroy">
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect
</prop>
<prop key="hibernate.connection.url">jdbc:postgresql://localhost:5432/smartbiz
</prop>
<prop key="hibernate.connection.driver_class">org.postgresql.Driver
</prop>
<prop key="hibernate.connection.username">--
</prop>
<prop key="hibernate.connection.password">--
</prop>
<prop key="hibernate.connection.autocommit">false
</prop>
<!--Ehcache Configs-->
<prop key="hibernate.cache.use_query_cache">false</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider
</prop>
<prop key="hibernate.generate_statistics">true</prop>
<prop key="hibernate.cache.use_structured_entries">true</prop>
<prop key="hibernate.cache.region_prefix" />
<prop key="net.sf.ehcache.configurationResourceName">ehcache.xml</prop>
<prop key="hibernate.cache.provider_configuration_file_resource_path">ehcache.xml</prop>
<!--configuration pool via c3p0-->
<prop key="c3p0.acquire_increment">5</prop>
<prop key="c3p0.idle_test_period">10000</prop>
<!--seconds-->
<prop key="c3p0.max_size">30</prop>
<prop key="c3p0.max_statements">5000</prop>
<prop key="c3p0.min_size">5</prop>
<prop key="c3p0.timeout">10000000</prop>
<!--
thread is the short name for
org.hibernate.context.ThreadLocalSessionContext and let Hibernate
bind the session automatically to the thread
-->
<prop key="current_session_context_class">thread</prop>
<!--this will show us all sql statements-->
<prop key="hibernate.show_sql">false</prop>
<!--this will create the database tables for us-->
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.max_fetch_depth">4</prop>
<prop key="hibernate.default_batch_fetch_size">50</prop>
</props>
</property>
<property name="annotatedClasses">
<list>
<!-- Mappings for all entities -->
</property>
</bean>
...