Training Talks: How to create a Mule domain project?

January 18 2017

5 comments 0
training talks

In this week’s we’re going to talk about domains. But first, we have another fun fact from our next instructor, Ethan Port. Back in the 80’s (not that long ago), Ethan played the guitar and drums in a rock band that is still very popular today in Greece. Did I mention the drums were flaming?

Now back to domains. So what is a domain? A domain is a special type of project that you can create in Anypoint Studio which has shared resources like an HTTP connection or JMS connection, and they can be shared between several applications.

Training Talk – Episode 5

In this Training Talks you’ll learn:

  • How to create a domain project
  • How to share resources between Mule applications deployed to the same Mule runtime  
  • How to debug a Mule domain project in Studio

 

Visit our documentation site to learn more about domains and shared resources.

Have questions for the Training team? Drop it in our forum or Training Twitter using the hashtag #TrainingTalks and stay tuned!

Our training modules are designed to help you learn how to be expert at using Anypoint Platform at any stage of development. To find out more about our role based recommended learning paths visit https://training.mulesoft.com/paths.


 


We'd love to hear your opinion on this post

5 Responses to “Training Talks: How to create a Mule domain project?”

  1. Current version of the documentation for shared resources (as of Jan 2017) is found here: https://docs.mulesoft.com/mule-user-guide/v/3.8/shared-resources

    Agree(0)Disagree(0)Comment
  2. Hello, one question…. Domains are supported in CloudHub??? How I can deploy it?

    Agree(0)Disagree(0)Comment
    • Hi Sebastian,
      They are not supported in CloudHub, and cannot currently be deployed there. Domains are only used to share resources when you deploy multiple applications into the same Mule runtime. CloudHub workers currently can only host one application at a time, so domain projects are not relevant or useful there. Instead the application contains all its resource definitions inside the application itself. Hope this helps!

      Agree(0)Disagree(0)Comment
  3. Hi
    I’m trying to test the concept of shared resources, sharing an HTTP connector.

    The applications are very simple, in each app only an HTTP inbound connector and a set Payload to provide a response.

    In Anypoint these apps work perfectly but when I want to deploy it in mule standalone, I have an error because the apps aren’t able to find the domain.

    Is there something that I’m missing.

    INFO 2017-02-28 09:54:10,953 [WrapperListener_start_runner] org.mule.module.launcher.ArtifactArchiveInstaller: Exploding a Mule artifact archive: file:/C:/EDP_POC/MULE/mule-standalone-3.8.0/apps/zz_pru1.zip
    ERROR 2017-02-28 09:54:10,974 [WrapperListener_start_runner] org.mule.module.launcher.DefaultArchiveDeployer:
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    + Failed to deploy artifact ‘zz_pru1’, see below +
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    org.mule.api.MuleRuntimeException: Artifact directory does not exist: ‘C:\EDP_POC\MULE\mule-standalone-3.8.0\domains\zz_pru_domain’
    at org.mule.module.launcher.artifact.ArtifactFactoryUtils.getDeploymentFile(ArtifactFactoryUtils.java:40) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.domain.DefaultDomainFactory.findDomain(DefaultDomainFactory.java:75) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.domain.DefaultDomainFactory.createArtifact(DefaultDomainFactory.java:60) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.domain.DefaultDomainFactory.createArtifact(DefaultDomainFactory.java:23) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.application.DefaultApplicationFactory.createAppFrom(DefaultApplicationFactory.java:70) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.application.DefaultApplicationFactory.createArtifact(DefaultApplicationFactory.java:52) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.application.DefaultApplicationFactory.createArtifact(DefaultApplicationFactory.java:24) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.DefaultArchiveDeployer.installFrom(DefaultArchiveDeployer.java:493) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.DefaultArchiveDeployer.guardedInstallFrom(DefaultArchiveDeployer.java:474) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:145) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:268) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:83) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.DeploymentDirectoryWatcher.deployPackedApps(DeploymentDirectoryWatcher.java:275) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:150) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:104) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:170) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_111]
    at org.mule.module.reboot.MuleContainerWrapper.start(MuleContainerWrapper.java:52) ~[mule-module-reboot-3.8.0.jar:3.8.0]
    at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:2788) ~[wrapper-3.2.3.jar:3.2.3]
    INFO 2017-02-28 09:54:10,974 [WrapperListener_start_runner] org.mule.module.launcher.ArtifactArchiveInstaller: Exploding a Mule artifact archive: file:/C:/EDP_POC/MULE/mule-standalone-3.8.0/apps/zz_pru2.zip
    ERROR 2017-02-28 09:54:10,992 [WrapperListener_start_runner] org.mule.module.launcher.DefaultArchiveDeployer:
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    + Failed to deploy artifact ‘zz_pru2’, see below +
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    org.mule.api.MuleRuntimeException: Artifact directory does not exist: ‘C:\EDP_POC\MULE\mule-standalone-3.8.0\domains\zz_pru_domain’
    at org.mule.module.launcher.artifact.ArtifactFactoryUtils.getDeploymentFile(ArtifactFactoryUtils.java:40) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.domain.DefaultDomainFactory.findDomain(DefaultDomainFactory.java:75) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.domain.DefaultDomainFactory.createArtifact(DefaultDomainFactory.java:60) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.domain.DefaultDomainFactory.createArtifact(DefaultDomainFactory.java:23) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.application.DefaultApplicationFactory.createAppFrom(DefaultApplicationFactory.java:70) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.application.DefaultApplicationFactory.createArtifact(DefaultApplicationFactory.java:52) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.application.DefaultApplicationFactory.createArtifact(DefaultApplicationFactory.java:24) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.DefaultArchiveDeployer.installFrom(DefaultArchiveDeployer.java:493) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.DefaultArchiveDeployer.guardedInstallFrom(DefaultArchiveDeployer.java:474) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:145) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:268) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.DefaultArchiveDeployer.deployPackagedArtifact(DefaultArchiveDeployer.java:83) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.DeploymentDirectoryWatcher.deployPackedApps(DeploymentDirectoryWatcher.java:275) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:150) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:104) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:170) ~[mule-module-launcher-3.8.0.jar:3.8.0]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_111]
    at org.mule.module.reboot.MuleContainerWrapper.start(MuleContainerWrapper.java:52) ~[mule-module-reboot-3.8.0.jar:3.8.0]

    Agree(0)Disagree(0)Comment
    • Hi Roberto,
      You need to copy the domain project’s deployable archive to the domains folder, not into the apps folder. Can you share your question in our Training forums as well? Other members might find your question helpful too and you can get more info from our instructors as well. Thanks!

      Agree(1)Disagree(0)Comment