6 Replies Latest reply on Sep 15, 2011 9:18 AM by Derek Howlett

    Unable to undeploy EAR

    log Newbie

      Hi,

       

      I'm quite new to RHQ but our office decided to install RHQ4.0.1 to monitor our integration platform and automatically deploy our applications. Unfortunately, I'm encountering various problems.  One of it is that I can't undeploy a EAR child previously added in the inventory via RHQ.  We're using jboss-4.2.3.GA as application server.  We've set <attribute name="ScanEnabled">false</attribute> in jboss-service.xml.  When I try to undeploy the EAR, I got this error :

       

      java.lang.UnsupportedOperationException: Cannot remove the package backing an EAR/WAR resource.

      at org.rhq.plugins.jbossas.ApplicationComponent.removePackages(ApplicationComponent.java:194)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525)

      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

      at java.util.concurrent.FutureTask.run(FutureTask.java:138)

      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

      at java.lang.Thread.run(Thread.java:619)

       

      What could possibly cause this problem.  Thank you very much for your help.  I've been searching a lot on the net but I wasn't able to get the answers to my problem.

       

       

      LOG

        • 1. Re: Unable to undeploy EAR
          log Newbie

          I was able to work around this problem.  I used the JBOSS ON user interface.  I deleted the child resource by selecting and deleting it from the inventory.  This deleted physically the EAR from the deploy folder in JBOSS.

          • 2. Re: Unable to undeploy EAR
            Ian Springer Master

            Yes, that's the way EARs are undeployed using JON. How were you trying to do it originally - via the Content tab of the EAR resource?

            • 3. Re: Unable to undeploy EAR
              log Newbie

              Hi Ian,

               

              Thanks for the response.  Yes I was undeploying the application via the Content tab of the EAR resource, as the delete option is also proposed here.  This must be specific to other resources other than EAR / WAR. 

               

              If I may, can I ask you another question.  Actually I had another concern and I posted it yesterday.  I'm having a hard time updating an existing EAR resource by the content tab.  When I try to upload the new package via the "NEW" option in the content tab, in JBOSS deploy folder, the old EAR has been renamed with a .rej extension and it remains as such.  There's an error in JBOSS log saying that it could not make local copy for EAR file, then the deployment fails.  However, I can deploy a new EAR application by crating a new resource.  After that, I'm unable to upgrade it.

               

              Am I doing the updating the right way?  Is it possible to upgrade a EAR resource deployed under JBOSS AS 4.2.3?  Is our version of JBOSS compatible with RHQ4.0.1?

               

              Thanks a lot in advance.

              • 4. Re: Unable to undeploy EAR
                Derek Howlett Newbie

                so we have the same problem, we have deployed a simple webapp using a bunde!

                 

                Q1. we had to re-import the inventory to get the agent to recognise the app in the first place. shouldn't this be auto discovered?

                 

                But once we had that reporting statistics, we tried to delete the bunde using first the bundle manager, but couldn't find a un-deploy button.

                So we went into the content tab for the webapp and tried to delete it there and got the following error.

                      java.lang.UnsupportedOperationException: Cannot remove the package backing a WAR resource.

                finally we found the above posts and deleted it from the inventory tab and that worked.

                 

                Q2. Why isn't there a undelete/remove bundle button?

                 

                Q3. Why didn't the content delete work ?

                • 5. Re: Unable to undeploy EAR
                  mazz Master

                  > Q1. we had to re-import the inventory to get the agent to recognise the app in the first place. shouldn't this be auto discovered?

                   

                  That doesn't sound right. I see no reason why you would have to re-import the agent to do this. We would need replication procedures to see what it was you actually did. Realize that the resource discover runs on a periodic basis, many times it won't detect something immediately - you have to wait for the scan to happen. See the FAQ on how the agent scans resources.

                   

                  > Q2. Why isn't there a undelete/remove bundle button?

                   

                  There is an purge button on the Bundle Deployment View - but I think that was added later. It should be in the RHQ 4 BETA, but not sure it was in the last GA release before that. Not sure what version you were using. If you watch this demo, at the end you'll see it use the Purge functionality.

                   

                  > Q3. Why didn't the content delete work ?

                   

                  As I understand it, that only works if you deployed the WAR using the Content tab - not bundles. I could be wrong there, as I have not played with the EAR/WAR deployment in a long time.

                  • 6. Re: Unable to undeploy EAR
                    Derek Howlett Newbie

                    Thanks John.

                     

                    So re Q1 getting the newly deployed service to be recongnised. I want to show the deployment of the app and then immediately look at the statistics. I can force this to happed by issuing discovery -f at the agent command line. But wouldn't it be better for a deployed app to trigger the actual rediscovery at the time of deployment. I wouldn't want to change the "rhq.agent.plugins.server-discovery.period-secs" to say 30 secs just for this use case. Is this a bug or a feature request ?

                     

                    Derek