[erlang-questions] Multiple embedded Yaws instances

Christopher Faulet christopher.faulet@REDACTED
Fri May 11 21:18:19 CEST 2012

On 08/05/2012 20:49, Arjan Hakkesteegt wrote:
> Hi,
> I am trying to setup a Common Test mock layer around my SUT (System
> Under Test). Both the SUT and CT should start an embedded Yaws instance
> because both should both act as client and as server for SOAP.
> Client(SUT) -> Server(CT)
> Server(SUT) <- Client(CT)
> However, it appears that it is not possible to run more than 1 embedded
> Yaws within a VM? When starting the second instance I get
> already_started errors from the supervisor. I tried to modify the
> ChildSpecs returned by yaws_api:embedded_start_conf/4 to append the Yaws
> instance Id to the supervisor child Ids, but still get the
> already_started errors. I tried it like this:
> [{yaws_log_myid,
> {yaws_log,start_link,[]},
> permanent,5000,worker,
> [yaws_log]},
> {yaws_server_myid,
> ...}]
> I've used multiple SConfs within a single embedded Yaws instance before,
> but I don't think that this is an option here as my SUT and the CT suite
> are completely separate applications and the SUT should be seen as a
> blackbox.
> I guess it could be an option to start the SUT in its own Erlang VM, but
> how would I start and stop this VM from the Common Test one (from
> init_per_suite/end_per_suite)?
> Any solutions to this problem? Or am I missing something obvious?


Unfortunately, it's not possible to have multiple instances of Yaws on 
the same VM, there are some named processes.

I never used the soap server of Yaws but it is possible to run several 
services. Each one can be registered using yaws_soap_srv:setup/2.
So you can have a service for your client and another for your server.

You can find some information on Yaws website:


More information about the erlang-questions mailing list