Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy on a specific Server. #17

Open
massimogai opened this issue Jan 19, 2015 · 4 comments
Open

Deploy on a specific Server. #17

massimogai opened this issue Jan 19, 2015 · 4 comments

Comments

@massimogai
Copy link

Some days ago I wrote a changes to deploy an archive on a specified server because the current implementation deploys on all server managed by the AdminServer. See the code below for WebLogicJMXClient. Can be useful?

private void doDeploy(String deploymentName, File deploymentArchive) throws DeploymentException {
try {
String serverName = configuration.getTarget();
String[] targets = new String[]{serverName};
ObjectName domainRuntime = (ObjectName) connection.getAttribute(domainRuntimeService, "DomainRuntime");
ObjectName deploymentManager = (ObjectName) connection.getAttribute(domainRuntime, "DeploymentManager");

        ObjectName deploymentProgressObject = (ObjectName) connection.invoke(
                deploymentManager, "deploy",
                new Object[]{deploymentName, deploymentArchive.getAbsolutePath(), targets, null, new Properties()},
                new String[]{String.class.getName(), String.class.getName(), String[].class.getName(), String.class.getName(), java.util.Properties.class.getName()}
        );

        processDeploymentProgress(deploymentName, deploymentManager, deploymentProgressObject);
    } catch (DeploymentException e) {
        throw e;
    } catch (Exception e) {
        throw new DeploymentException(e.getMessage(), e);
    }
}
@aslakknutsen
Copy link
Member

By using the Container Configuration option 'target' you should be able to target the deployment to any server.

The name of the target for the deployment. This can be the name of the Admin Server i.e.
"AdminServer", the name of an individual Managed Server or the name of a Cluster (not
yet supported).

Unless this somehow got lost in the implementation?

@massimogai
Copy link
Author

Il 19/01/2015 17:25, Aslak Knutsen ha scritto:

By using the Container Configuration option 'target' you should be
able to target the deployment to server.

|The name of the target for the deployment. This can be the name of the Admin Server i.e.
"AdminServer", the name of an individual Managed Server or the name of a Cluster (not
yet supported).
|


Reply to this email directly or view it on GitHub
#17 (comment).

I'm using the Target property but the archive is installed on all
managed servers. In the Mbean call,if you do not specify the target
server for the deploy it will be installed at all.
Indeed the Mbean documentation say:
https://docs.oracle.com/middleware/1213/wls/WLMBR/core/index.html
the same for WLS 12.1.2

@aslakknutsen
Copy link
Member

Aah, ic. Missed the use of configuration.getTarget in your sample code there.

So right.. the actual implementation of target got lost in implementation.. :)

Would you mind sending this as a pullrequest?

@massimogai
Copy link
Author

Done.
Thanks.
Il 19/01/2015 17:37, Aslak Knutsen ha scritto:

Aah, ic. Missed the use of configuration.getTarget in your sample code
there.

So right.. the actual implementation of target got lost in
implementation.. :)

Would you mind sending this as a pullrequest?


Reply to this email directly or view it on GitHub
#17 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants