On 23/08/2017 18:18, Adrian Gonzalez wrote:
Hello,

I'm using Syncope 2.0.2.

Any special reason to not upgrade to 2.0.4?

https://cwiki.apache.org/confluence/display/SYNCOPE/Upgrade+from+2.0.2+to+2.0.3
https://cwiki.apache.org/confluence/display/SYNCOPE/Upgrade+from+2.0.3+to+2.0.4

Is there a way to customize MasterDomain.xml in syncope webapp ?

I've the impression that MasterDomain.xml is always loaded from syncope-core-persistence-jpa-*.jar#domains/MasterDomain.xml (in WEB-INF/lib), even if I add a MasterDomain.xml in WEB-INF/classes/domains

As indicated in

https://syncope.apache.org/docs/reference-guide.html#customization-core

(for 2.0.4, naturally), you'll need to tell Spring to load your local domains/MasterDomain.xml rather than the one included in the JAR file.

But domains/MasterDomain.xml is loaded by domains.xml, which in turn is imported by persistenceContext.xml; as a result, you'll need to add to your own project's sources:

* core/src/main/resources/persistenceContext.xml (copy from [1])
* core/src/main/resources/domains.xml (copy from [2])
* core/src/main/resources/domains/MasterDomain.xml (copy from [3])

Even so, Spring will ignore such local files if you don't replace, in core/src/main/webapp/WEB-INF/web.xml:

  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
      classpath*:/*Context.xml
    </param-value>
  </context-param>

with

  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
      classpath*:/coreContext.xml
      classpath*:/securityContext.xml
      classpath*:/logicContext.xml
      classpath*:/restCXFContext.xml
      classpath:/persistenceContext.xml
      classpath*:/provisioning*Context.xml
      classpath*:/workflow*Context.xml
    </param-value>
  </context-param>

(please note the missing '*' before persistenceContext.xml).

FYI, the starting value for contextConfigLocation is set as [4] since 2.0.4.

HTH
Regards.

[1] https://github.com/apache/syncope/blob/syncope-2.0.2/core/persistence-jpa/src/main/resources/persistenceContext.xml [2] https://github.com/apache/syncope/blob/syncope-2.0.2/core/persistence-jpa/src/main/resources/domains.xml [3] https://github.com/apache/syncope/blob/syncope-2.0.2/core/persistence-jpa/src/main/resources/domains/MasterDomain.xml [4] https://github.com/apache/syncope/blob/syncope-2.0.4/fit/core-reference/src/main/webapp/WEB-INF/web.xml#L31-L37

--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/

Reply via email to