Just found it out. WEB.XML had to be changed. I changed web-settings.xml to
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext-*.xml
classpath*:META-INF/applicationContext-hibernate.xml
classpath*:META-INF/applicationContext-service.xml
classpath*:META-INF/applicationContext-local.xml
</param-value>
</context-param>
I added
<copy
tofile="${build.dir}/service/classes/META-INF/applicationContext-local.xml">
<fileset dir="src/service" includes="**/*-local.xml"
/>
</copy>
to ant target package-service.
-local.xml now overrides beans defined in -service.xml
René
-----Ursprüngliche Nachricht-----
Von: René Günther [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 4. Juni 2007 08:50
An: [email protected]
Betreff: [appfuse-user] Override applicationContext-service.xml
Hello,
in my appuse 1.8 based application I want some to override bean defintions
in applicationContext-service.xml with a local context file, to achive the
following:
Note: In case of multiple config locations, later bean definitions will
override ones defined in earlier loaded files. This can be leveraged to
deliberately override certain bean definitions via an extra XML file.
But to do this I must be able to change the definition of
ClassPathXmlApplicationContext, I guess.
Where should I put this? I tried this:
<!-- JNDI DataSource for J2EE environments -->
<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/flowexpense</value>
</property>
</bean>
<bean id="aBeanId"
class="org.springframework.context.support.ClassPathXmlApplicationContext">
<constructor-arg>
<list>
<value>classpath*:META-INF/applicationContext-hibernate.xml</value>
<value>classpath*:META-INF/applicationContext-service.xml</value>
<value>classpath*:META-INF/applicationContext-local.xml</value>
</list>
</constructor-arg>
</bean>
But dataSource isnt found then.
Thanks
René
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]