(un)deploying via asadmin fails randomly

415 views
Skip to first unread message

Koen Serneels

unread,
Apr 7, 2017, 10:12:30 AM4/7/17
to Payara Forum
Server: 4.1.1.163 #badassfish (build 215) OS: Solaris

Hi. To automatically deploy and undeploy our WARs we are testing with asadmin from a Java autodeploy "script". To do this we use the com.sun.enterprise.admin.remote.RemoteRestAdminCommand to enable remote communication with the DAS. This way we can remotely execute commands from Java (our autodeploy "script"). The remote administration is all working fine as we also use it to configure our servers and with that we never had a problem. However, while (un)deploying applications we sometimes get a strange error back from the server. In the case of undeploy:


Command: undeploy {target: [CLUSTER]
DEFAULT: [ARTIFACT]

Result: ARTIFACT disabled failed
An error occurred during replication
Failure: Command disable failed on server instance CLUSTER remote failure: Application not registered

Everything after "Result" is returned by the RemoteRestAdminCommand. For the record, when we immediately try to undeploy locally on the machine using asadmin via the CLI directly, the exact same error is given. So just to say that it is not related to the fact that this is ran remotely. When undeploying fails, our script  continuous  and tries to deploy the application anyway. But if undeploy failed, the deploy will also fail with this error:

Command: deploy {target: [CLUSTER]
contextroot: [APPCTXROOT]
DEFAULT: [<location of WAR FILE>]
upload: [true]
property: [implicitCdiEnabled=false]
Unexpected exception: org.glassfish.api.admin.CommandException: remote failure: Error occurred during deployment: Application with name <name> already registered. Either specify that redeployment must be forced, or redeploy the application. Or if this is a new deployment, pick a different name. Please see server.log for more details.

Weird, first it was not registered, now it is already registered? This also happens when we specify "force=true".  The errors are not always appearing, sometimes the application undeploys and deploys without problems. As this application is now deployed on a cluster, we also tried to deploy it on a local instance instead that was created within the domain, but that didn't make any difference. The application in question we are deploying is working fine. We also tried restarting the cluster/instance in between but no difference. Another strange thing is that when the error is given at undeploy, undeploying manually but this time via the web (the admin UI) works without a problem. This is a bit weird as I would have expected that the UI uses the same commands to undeploy as I would do via asadmin (so I was expecting the same error).

Does anyone have an idea what this could be or where we could look?

On a side note: I know there is an option for autodeploying on the domain itself using the "autodeploy'" directory. Does such an option also exist for a local-instance and possibly a cluster? 

Thanks






Reply all
Reply to author
Forward
0 new messages