oracle / weblogic-deploy-tooling

WebLogic Deploy Tooling
https://oracle.github.io/weblogic-deploy-tooling/
Universal Permissive License v1.0
152 stars 90 forks source link

How to specify an in-EAR JMS subdeployment #951

Closed sschober closed 3 years ago

sschober commented 3 years ago

We currently deploy a JMS configuration in our EAR file, using a subdeployment.

This leads to the following config.xml in weblogic domain:

<app-deployment>
    <name>my-app</name>
    <target>ManagedServer</target>
    <module-type>ear</module-type>
    <source-path>servers/AdminServer/upload/my-app/app/my-app-2.1.0-SNAPSHOT.ear</source-path>
    <sub-deployment>
      <name>my-app-jms</name>
      <sub-deployment>
        <name>my-app</name>
        <target>JMSServer-My-App</target>
      </sub-deployment>
    </sub-deployment>
...
  </app-deployment>

To reproduce this with WDT, we tried specifying a SubDeployment child node in the domain.yaml, like so, but failed expectedly:

appDeployments:
    Application:
        # Quote needed because of hyphen in string
        '@@PROP:ApplicationName@@':
            SourcePath: 'wlsdeploy/applications/@@PROP:ApplicationFile@@'
            ModuleType: ear
            Target: 'ManagedServer'
            StagingMode: nostage
            PlanStagingMode: nostage
            SubDeployment:
                'my-app-jms':
                    SubDeployment:
                        'my-app':
                            Target: 'JMSServer-My-App'

WDT log result:

...
#13 26.53         2. WLSDPLY-05026: SubDeployment is not one of the folder names allowed in model location appDeployments:/Application/my-app
...

Is it all possible to specify a in EAR-subdeployment JMS configuration in a domain.yaml file with WDT?

CarolynRountree commented 3 years ago

We do need to add the SubDeployment to the AppDeployments. However, why are you using a double SubDeployment when the first level has everything you need?

sschober commented 3 years ago

However, why are you using a double SubDeployment when the first level has everything you need?

If you ask about the situation in config.xml - I am not really sure, why this situation arose... we were using the REST interface to deploy the app containing the jms configuration. I suspect, supporting a single level of subdeployments would be enough.

sschober commented 3 years ago

Thank you so much for addressing our issue!

Unfortunately, the solution does not seem to solve our use case completely. We seem to really need the nested subdeployments, as we try to deploy queues and connection factories as part of a java ee application. When trying to implement this with only one subdeployment, we ran into error BEA-040456 (see here):

If the JMS module is inside a Java EE application (an EAR file), then you must add the sub-deployment stanza to the subdeployment that represents this JMS module in the Java EE application.

So, I think we need support for nested subdeployments. Should I create a ticket for this?