Description of problem: When deploying an application with an unmet dependency via admin console (Profile Service API): Admin console reports an error in deployment Application is not copied to deploy/ (or rather it seems that it is copied, but then deleted) Application does not show up in deployed applications in admin console Application *DOES* show up in JMX console, for example: J2EEApplication=null,J2EEServer=Local,j2eeType=WebModule,name=test.war An unmet dependency is NOT an error. Expected behavior: There shouldn't be an error (warning at most). Application should be copied to deploy/. Application should show up as a deployed application (where it could be undeployed). Why does the application still show up in JMX console but not in deploy/? It looks like the profile service assumes an error starting the application means it was never deployed, and doesn't undeploy before removing it from deploy/? Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Here's the code from the as5 plugin for deploying an ear or war (i.e. creating an EAR or WAR Resource): http://pastebin.com/DJmSFAHN Note, it tries to first distribute (i.e. copy into the deploy dir) and then start the app (distribute and start are both operations on the profile service DeploymentManager interface). If the start step fails, it will undeploy the app and consider the EAR or WAR Resource creation a failure. If the unmet dependency is causing start to fail, then this is what you are seeing here. Do we want to change the behavior of the as 5 plugin so if starting the app fails, it logs an error, but does not undeploy the app and abort the Resource creation?
[master 38ce0dd] fixes this. Now, if starting the newly deployed app fails, we do not rollback the deployment or send a failure response, but instead log a warning and set an informative error message on the create response. Unfortunately, due to a bug in the profile service (https://issues.jboss.org/browse/JBPAPP-6754), our check to see whether the app started successfully always returns true, even when the app failed to start. Hopefully we can get a fix from the EAP team for this, but in the meantime, at least now the EAR/WAR Resource creation succeeds for an EAR or WAR with missing dependencies.
>> Unfortunately, due to a bug in the profile service >> (https://issues.jboss.org/browse/JBPAPP-6754), our check to see whether the app >> started successfully always returns true, even when the app failed to start. which means the following never happens: >> log a warning and set an informative error message on the create response Instead, we simply return a status of SUCCESS and don't inform the user that the call to start() failed.
Created attachment 510134 [details] A WAR which has a dependency that can not be met which can be used to test this issue.
Verified the fix - the application gets deployed (stays in deployed state and in "deploy" directory even after errors in EAP console), no error is encountered by JON. The deployed application remains in the EAP's inventory in JON. Build used for verification: RHQ 4.1.0-SNAPSHOT ad51846 GWT Version: 2.0.4 SmartGWT Version: 2.4 Will probably add an automated testcase for this for EAP 6 plugin.
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE