Skip to content
Marc Dutoo edited this page Jan 28, 2014 · 29 revisions

Building EasySOA

Prerequisites

TODO see https://github.com/easysoa/EasySOA/wiki/Releasing-EasySOA and https://github.com/easysoa/EasySOA/wiki/Development-Environment

Building dependencies

FraSCAti

You don't have to build FraSCAti, we rely on the nightly snapshot build of its latest development version. More information about FraSCAti follows.

As of 2012/02/14, FraSCAti is continuously built on the following two integration servers:

If you need to know the status of the current development of FraSCAti (the SVN directory /trunk), check these two dashboards.

Maven artefacts for FraSCAti are automatically deployed at https://frascati-repo.inria.fr/nexus/

Moreover, as of 2012/02/23, Sonar metrics for FraSCAti are available at http://sonar.ow2.org . Other metrics computed by Ohloh are available at http://www.ohloh.net/p/frascati .

Nuxeo

You don't have to build Nuxeo, we rely on its latest release. We're working on upgrading it to depending on the latest development version.

Compiling

First build it whithout tests, so it's speedier and focuses on getting all dependencies : mvn -Dmaven.test.skip=true clean install

When you're sure you're up-to-date on all the dependencies, you can speed it up by going offline using the -o option : mvn -o -Dmaven.test.skip=true clean install

Deploying

To have a running EasySOA, you can either build a full release, or use various tricks to only have some parts of it up and running :

  • to have an EasySOA Registry server (Nuxeo), copy the built contents of easysoa-registry/nuxeo-packaging/target in your Nuxeo Platform's home directory
  • to run bits of FraSCAti-configured architecture (HTTP monitoring & mining features), run the right JUnit test with "pause"-like code (ex. "in.read()") in it among those under easysoa-proxy, see monitoring's ProxyStarter example.
  • to run node.js parts (home page, service discovery by browsing...), go in easysoa-web and execute start-web.sh or start-web.bat and then open in your browser the url http://localhost:8083/

Testing

Building with all tests

CAUTION currently broken because of [#37 Problem closing Jetty HTTP binding component, forbids tests in CI] (https://github.com/easysoa/EasySOA/issues/37)

At the root do : mvn clean install

Running and debugging an individual test :

The easiest is to start the test from within Eclipse.

However it may not work in Windows because of the classpath being too long. In this case, use maven to start it, including in debug mode, as below.

Go in the test's project directory, ex. cd easysoa-proxy/easysoa-proxy-core/easysoa-proxy-core-httpdiscoveryproxy

And use the -Dtest option, ex. mvn -Dtest=*FullMockedDiscovery* clean install

Or to start it in debug mode : See "debug forked tests" in the FAQ below.

Build FAQ

Fast build

To build without downloading artifacts nor executing tests, do : mvn clean install -o -Dmaven.test.skip=true

Get all sources

In Eclipse, in Windows > Preferences > Maven, check "Download Artifact sources".

Or using Maven command line : mvn dependency:sources

Launch a single test

mvn -Dtest=*MyClassName install

Debug tests

Add -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8002,server=y,suspend=y in the MAVEN_OPTS environment variable (export MAVEN_OPTS="..." in command line shell or in your $HOME/.bashrc )

Debug forked tests

In the surefire plugin conf, set forkMode to "always". To debug forked tests, add -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8002 -Xnoagent" to the mvn command line.

Maven OutOfMemory errors

Increase maven's memory limits (Heap and / or PermGen space)

  • by adding -Xmx512m -XX:MaxPermSize=128m either in your mvn.sh/.bat or in the MAVEN_OPTS environment variable (export MAVEN_OPTS="..." in command line shell or in your $HOME/.bashrc )
  • or if in Eclipse (especially with an external installation of maven) in Run configuration > JRE parameters

Maven find errors in Nuxeo POMs

That's because Nuxeo uses plugins and others that seem not compatible with the latest versions of m2e (0.3.X, 1.X). To solve it, you juste have to import our hacked plugins/nuxeo-ecm project in your Eclipse workspace, and if necessary click on "Maven > Update project configuration". Alternatively you can revert to an older version of m2e by adding this repository to the Eclipse sites: http://m2eclipse.sonatype.org/sites/m2e (The 0.2.1 version should fit).

These hacks won't be necessary anymore when EasySOA there will be a compatible version of Nuxeo.

Maven won't install a project before building the next one

The assembly:assembly goal can induce a lot of troubles in the build process, since it leads to start a new global build. This goal is actully deprecated by Maven ; if you get the latest updates from the repository, this has now recently been replaced for an assembly:single goal in EasySOA.

Can't download FraSCAti dependencies in Cygwin

FraSCAti repository runs on HTTPS so its certificate has to be trusted. It should be so by default (chain of trust with Certificate Authorities). However sometimes it is not, notably when running Maven on Cygwin in Windows :

[INFO] snapshot org.ow2.frascati:frascati-modules:1.5-SNAPSHOT: checking for updates from frascati-repo
[WARNING] repository metadata for: 'snapshot org.ow2.frascati:frascati-modules:1.5-SNAPSHOT' could not be retrieved from repository: frascati-repo due to an error: Error transferring file: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors

Solutions : either download them in another way (like using Eclipse m2e plugin), or solve the problem for Cygwin. You can also, but as a temporarily solution only, because of heavy security issues, write a Maven plugin that skips certificate verification. See code, CA import and code, debug, conf, HTTPS-level hack library. There is also a purported JVM option hack, which alas doesn't work:

[WARNING] repository metadata for: 'snapshot org.ow2.frascati:frascati-assembly-factory:1.5-SNAPSHOT' could not be retrieved from repository: frascati-repo due to an error: Error transferring file: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

Can't download FraSCAti dependencies in a submodule

Sometimes submodules don't have a parent where the FraSCAti repository is defined, and don't define themselves, especially easysoa-frascati-* project, though this case shouldn't happen with a good overall build architecture:

2 required artifacts are missing.

for artifact:
  org.easysoa.registry:easysoa-frascati-processor:jar:0.4-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

In this case, FraSCAti dependencies are not downloaded because they are not looked for in the right repository. To solve it, add the FraSCAti repository AND plugin repository definitions in the submodule and tell us about it. See effort towards better integration in build of Inria-contributed submodules in https://github.com/easysoa/EasySOA/issues/90 .

"Errors when compiling generated Java membrane source" when starting FraSCAti in tests

Detailed error :

...
INFO: org.easysoa.proxy.LogIntentFCSCAContentControllerImpl
INFO: org.easysoa.proxy.LogIntentFCscaPrimitiveFC330532bd
INFO: Compiling...
ATTENTION: Errors when compiling generated Java membrane source

Solution : if you're using openjdk, try rather Oracle / Sun's jdk.

FraSCAti startup error in app server - "component XXX is already defined"

In log file (apache-tomcat7/logs/catalina.out etc.), a lot of errors such as :

sept. 04, 2013 5:20:38 PM org.ow2.frascati.parser.core.ParsingContextImpl error
SEVERE: jar:file:/home/mdutoo/dev/easysoa/apache-tomcat7/webapps/ROOT/WEB-INF/lib/frascati-assembly-factory-1.6-20130820.132037-101.jar!/org/ow2/frascati/assembly/factory/AssemblyFactory.composite: <sca:composite name="org.ow2.frascati.assembly.factory.AssemblyFactory"> - <component name='sca-component-property'> is already defined

going after :

sept. 04, 2013 5:23:47 PM org.ow2.frascati.util.AbstractLoggeable warning
WARNING: 172 errors detected during the checking phase of composite 'org/ow2/frascati/FraSCAti'
sept. 04, 2013 5:23:47 PM org.ow2.frascati.util.AbstractLoggeable severe
SEVERE: Cannot load the OW2 FraSCAti composite
org.ow2.frascati.util.FrascatiException: Cannot load the OW2 FraSCAti composite
	at org.ow2.frascati.FraSCAti.initFrascatiComposite(FraSCAti.java:191)
	at org.ow2.frascati.FraSCAti.newFraSCAti(FraSCAti.java:246)
	at org.ow2.frascati.FraSCAti.newFraSCAti(FraSCAti.java:222)
	at org.ow2.frascati.servlet.FraSCAtiServlet.init(FraSCAtiServlet.java:150)

Solution :

there are two different versions of FraSCAti in the same webapp. This probably happened because you tried to update the webapp to a newer version. In this case, before updating it remove the older one :

rm -rf [TOMCAT_HOME]/webapps/ROOT/*
Clone this wiki locally