It seems that because I used a modular project, my ApplicationContext-dao.xml
is packaged into the myapplication-core-1.0-SNAPSHOT.jar. Then in the web
module there are 2 ApplicationContext-dao.xml inside 2 jars, the appfuse
default one and my core module one. And maybe because the appfuse jar comes
first alphabetically it is being used.
When I copy the ApplicationContext-dao.xml to my web module resources it is
being picked up!
So I would need to find a way of telling spring to prefer my jar, or use
maven to place the resources from the core jar into the web resources...
Markus
Markus Doring wrote:
>
> Thanks Richard,
> placing the ApplicationContext-dao.xml in my resources somehow didnt work,
> but once I switched to the full-source mode it was working nicely!
>
> Markus
>
>
> Richard Mixon wrote:
>>
>> Not sure if this will help - as I'm using Struts2/Hibernate, appfuse
>> 2.0.1
>> with full-source, but in my
>> /src/main/resources/ApplicationContext-dao.xml,
>> I have the following to handle an AuditInfo interceptor:
>>
>> <!-- Bean to catch successful login event and make user and
>> originating
>> location info available. -->
>> <bean id="auditInfoSource"
>> class="com.acme.model.hibernate.AuditInfoListener">
>> </bean>
>>
>> <!-- Entity Interceptor bean - sets audit fields for each persistent
>> object -->
>> <bean id="entityInterceptor"
>> class="com.acme.model.hibernate.AuditInterceptor"
>> depends-on="auditInfoSource">
>> <property name="auditInfoSource" ref="auditInfoSource"/>
>> </bean>
>>
>> <!-- Hibernate SessionFactory -->
>> <bean id="sessionFactory"
>> class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactor
>> yBean" depends-on="entityInterceptor">
>> <property name="entityInterceptor"><ref
>> local="entityInterceptor"/></property>
>> <property name="dataSource" ref="dataSource"/>
>> <property name="configLocation"
>> value="classpath:hibernate.cfg.xml"/>
>> <property name="hibernateProperties">
>> <value>
>> hibernate.dialect=${hibernate.dialect}
>> hibernate.query.substitutions=true 'Y', false 'N'
>> hibernate.cache.use_second_level_cache=true
>>
>> hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
>> </value>
>> <!-- Turn batching off for better error messages under
>> PostgreSQL -->
>> <!-- hibernate.jdbc.batch_size=0 -->
>> </property>
>> </bean>
>>
>> This implements pretty closely the AuditInfo pattern from the Hibernate
>> wiki, adjusted for Hibernate 3.2
>>
>> HTH - Richard
>>
>>
>>> From: Markus Döring <[EMAIL PROTECTED]>
>>> Reply-To: <[email protected]>
>>> Date: Fri, 16 May 2008 22:09:37 +0200
>>> To: <[email protected]>
>>> Subject: [appfuse-user] hibernate (entity) interceptors in appfuse
>>>
>>> Hi,
>>> I would like to register a Hibernate audit interceptor which is
>>> tracking updates/inserts of persistent entities with the hibernate
>>> session in AppFuse. The sessionFactory bean definition is probably
>>> hidden in the appfuse jars, so I wonder if someone can give me any
>>> advice on how to do that. It seems one can also use hibernate event
>>> listeners and register them in hibernat.hbm.xml, but I have an
>>> interceptor already based on org.hibernate.EmptyInterceptor I would
>>> like to use.
>>>
>>> Matt mentioned one might use the HibernateExtensionPostProcessor for
>>> that, but I cant see how?
>>> http://www.nabble.com/Hibernate-Interceptor-td15482342s2369.html
>>>
>>> Any help greatly appreciated.
>>> thanks,
>>>
>>> Markus
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/hibernate-%28entity%29-interceptors-in-appfuse-tp17283572s2369p17346632.html
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]