Geronimo
  1. Geronimo
  2. GERONIMO-4844

There is an error after undeploy the application and deploy the application again when configure WADI clustering,

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.4, 2.2
    • Fix Version/s: 2.1.5, 2.2.1, 3.0.0
    • Component/s: Clustering
    • Security Level: public (Regular issues)
    • Labels:
      None
    • Environment:

      windows:sp2
      jdk1.6

      Description

      I deploy the application cviewer.war after undeploy it when configure the WADI clustering ,the there is an error:

      org.apache.geronimo.common.DeploymentException: Unable to deploy cviewer-2.1.1.2.war: Module com.ibm.wasce.samples/cviewer/2.1.1.2/car already exists in the server. Try to undeploy it first or use the redeploy command.

      at org.apache.geronimo.deployment.cli.CommandDeploy.runCommand(CommandDeploy.java:45)
      at org.apache.geronimo.deployment.cli.CommandDistribute.executeOnline(CommandDistribute.java:139)
      at org.apache.geronimo.deployment.cli.CommandDistribute.execute(CommandDistribute.java:125)
      at org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java:168)
      at org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45)
      at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:65)
      at org.apache.geronimo.cli.deployer.DeployerCLI.main(DeployerCLI.java:31)

      However,actually,there are no any module in the server.

        Activity

        Ben Liang created issue -
        Shawn Jiang made changes -
        Field Original Value New Value
        Assignee Shawn Jiang [ genspring ]
        Hide
        Ashish Jain added a comment -

        It seems the gbean is still in the running state after undeployment. The inforegistry has an entry for the application which suggests the gbean is in the running state
        even after undeployment. That is the reason Deployer.getConfigID returns an exception suggesting Module already exists. I will investigate more and will try to provide
        a patch for this issue.

        Show
        Ashish Jain added a comment - It seems the gbean is still in the running state after undeployment. The inforegistry has an entry for the application which suggests the gbean is in the running state even after undeployment. That is the reason Deployer.getConfigID returns an exception suggesting Module already exists. I will investigate more and will try to provide a patch for this issue.
        Ashish Jain made changes -
        Affects Version/s 2.1.4 [ 12313380 ]
        Affects Version/s 2.2 [ 12312965 ]
        Ashish Jain made changes -
        Affects Version/s 2.2 [ 12312965 ]
        Ashish Jain made changes -
        Fix Version/s 2.1.5 [ 12313729 ]
        Hide
        Ashish Jain added a comment -

        Attaching a patch. However this patch results in BasicClusterConfigurationStoreClientTest.recordUninstall(Kernel kernel) to fail with a null pointer exception. The testing framework used here is RMOCK which does not allow to mock a final class. The patch uses ConfigurationUtil which is a final class. Please review the patch and advice thanks.

        Show
        Ashish Jain added a comment - Attaching a patch. However this patch results in BasicClusterConfigurationStoreClientTest.recordUninstall(Kernel kernel) to fail with a null pointer exception. The testing framework used here is RMOCK which does not allow to mock a final class. The patch uses ConfigurationUtil which is a final class. Please review the patch and advice thanks.
        Ashish Jain made changes -
        Attachment GERONIMO-4844.patch [ 12428070 ]
        Hide
        Ashish Jain added a comment -

        Can someone help review and provide comments over the patches?

        Show
        Ashish Jain added a comment - Can someone help review and provide comments over the patches?
        Hide
        David Jencks added a comment -

        I had to stop using ConfigurationUtil and adjust the expections a little bit to get rmock to pass.

        Nice work!

        2.1 rev 903520
        2.2 rev 903521
        3.0 rev 903525

        Show
        David Jencks added a comment - I had to stop using ConfigurationUtil and adjust the expections a little bit to get rmock to pass. Nice work! 2.1 rev 903520 2.2 rev 903521 3.0 rev 903525
        David Jencks made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 2.2.1 [ 12314336 ]
        Fix Version/s 3.0 [ 12314206 ]
        Hide
        Ashish Jain added a comment -

        Hi David,

        I see some issues with the modified patch where we are using kernel.getGbean(ConfigurationManager.class). I see the following error

        2010-02-12 20:02:51,768 INFO [BasicClusterConfigurationStoreClient] Ignoring error while uninstalling [default/ClusterTestWARFile5/1.0/car]from [org.apache.geronimo.farm.config.BasicNodeInfo@65b265b2]
        java.io.IOException: See nested
        at org.apache.geronimo.farm.deployment.BasicClusterConfigurationStoreClient.uninstall(BasicClusterConfigurationStoreClient.java:141)
        at org.apache.geronimo.farm.deployment.BasicClusterConfigurationStoreClient.uninstall(BasicClusterConfigurationStoreClient.java:100)
        at org.apache.geronimo.farm.deployment.BasicClusterConfigurationStoreClient.uninstall(BasicClusterConfigurationStoreClient.java:94)
        at org.apache.geronimo.farm.deployment.MasterConfigurationStore.uninstall(MasterConfigurationStore.java:175)
        at org.apache.geronimo.kernel.config.SimpleConfigurationManager.uninstallConfiguration(SimpleConfigurationManager.java:1283)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:615)
        at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
        at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
        at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
        at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
        at org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:342)
        at sun.reflect.GeneratedMethodAccessor146.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:615)
        at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
        at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
        at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
        at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
        at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(MBeanGBeanBridge.java:172)
        at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:231)
        at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:238)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:833)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:802)
        at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1423)
        at javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectionImpl.java:96)
        at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1260)
        at java.security.AccessController.doPrivileged(AccessController.java:275)
        at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1363)
        at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:797)
        at sun.reflect.GeneratedMethodAccessor133.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:615)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:309)
        at sun.rmi.transport.Transport$1.run(Transport.java:168)
        at java.security.AccessController.doPrivileged(AccessController.java:275)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:164)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:506)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.handleRequest(TCPTransport.java:838)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:912)
        at java.lang.Thread.run(Thread.java:801)
        Caused by:
        org.apache.geronimo.kernel.InternalKernelException: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
        java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.geronimo.kernel.config.EditableKernelConfigurationManager
        at org.apache.geronimo.system.jmx.KernelDelegate.getGBean(KernelDelegate.java:111)
        at org.apache.geronimo.farm.deployment.BasicClusterConfigurationStoreClient.uninstall(BasicClusterConfigurationStoreClient.java:135)
        ... 42 more
        Caused by:
        java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
        java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.geronimo.kernel.config.EditableKernelConfigurationManager
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:172)
        at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
        at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(RMIConnectionImpl_Stub.java:400)
        at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:984)
        at org.apache.geronimo.system.jmx.KernelDelegate.invokeKernel(KernelDelegate.java:890)
        at org.apache.geronimo.system.jmx.KernelDelegate.getGBean(KernelDelegate.java:105)
        ... 43 more
        Caused by:
        java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.geronimo.kernel.config.EditableKernelConfigurationManager
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:362)
        at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:305)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:154)
        ... 48 more
        Caused by:
        java.io.NotSerializableException: org.apache.geronimo.kernel.config.EditableKernelConfigurationManager
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1108)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:324)
        at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:273)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:319)
        ... 7 more

        Show
        Ashish Jain added a comment - Hi David, I see some issues with the modified patch where we are using kernel.getGbean(ConfigurationManager.class). I see the following error 2010-02-12 20:02:51,768 INFO [BasicClusterConfigurationStoreClient] Ignoring error while uninstalling [default/ClusterTestWARFile5/1.0/car] from [org.apache.geronimo.farm.config.BasicNodeInfo@65b265b2] java.io.IOException: See nested at org.apache.geronimo.farm.deployment.BasicClusterConfigurationStoreClient.uninstall(BasicClusterConfigurationStoreClient.java:141) at org.apache.geronimo.farm.deployment.BasicClusterConfigurationStoreClient.uninstall(BasicClusterConfigurationStoreClient.java:100) at org.apache.geronimo.farm.deployment.BasicClusterConfigurationStoreClient.uninstall(BasicClusterConfigurationStoreClient.java:94) at org.apache.geronimo.farm.deployment.MasterConfigurationStore.uninstall(MasterConfigurationStore.java:175) at org.apache.geronimo.kernel.config.SimpleConfigurationManager.uninstallConfiguration(SimpleConfigurationManager.java:1283) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:615) at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867) at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239) at org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:342) at sun.reflect.GeneratedMethodAccessor146.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:615) at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867) at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239) at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(MBeanGBeanBridge.java:172) at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:231) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:238) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:833) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:802) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1423) at javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectionImpl.java:96) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1260) at java.security.AccessController.doPrivileged(AccessController.java:275) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1363) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:797) at sun.reflect.GeneratedMethodAccessor133.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:615) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:309) at sun.rmi.transport.Transport$1.run(Transport.java:168) at java.security.AccessController.doPrivileged(AccessController.java:275) at sun.rmi.transport.Transport.serviceCall(Transport.java:164) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:506) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.handleRequest(TCPTransport.java:838) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:912) at java.lang.Thread.run(Thread.java:801) Caused by: org.apache.geronimo.kernel.InternalKernelException: java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.geronimo.kernel.config.EditableKernelConfigurationManager at org.apache.geronimo.system.jmx.KernelDelegate.getGBean(KernelDelegate.java:111) at org.apache.geronimo.farm.deployment.BasicClusterConfigurationStoreClient.uninstall(BasicClusterConfigurationStoreClient.java:135) ... 42 more Caused by: java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.geronimo.kernel.config.EditableKernelConfigurationManager at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:172) at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source) at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(RMIConnectionImpl_Stub.java:400) at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:984) at org.apache.geronimo.system.jmx.KernelDelegate.invokeKernel(KernelDelegate.java:890) at org.apache.geronimo.system.jmx.KernelDelegate.getGBean(KernelDelegate.java:105) ... 43 more Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.geronimo.kernel.config.EditableKernelConfigurationManager at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:362) at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:305) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:154) ... 48 more Caused by: java.io.NotSerializableException: org.apache.geronimo.kernel.config.EditableKernelConfigurationManager at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1108) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:324) at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:273) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:319) ... 7 more
        Hide
        David Jencks added a comment -

        Ashish,

        I think this should work on 2.2 where the getGBean call used returns a proxy. In 2.1 it looks like we're trying to get the actual gbean from the remote kernel which doesn't work.

        2.2 code:

        public <T> T getGBean(Class<T> type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
        Set<AbstractName> set = listGBeans(new AbstractNameQuery(type.getName()));
        for (AbstractName name : set)

        { return proxyManager.createProxy(name, type); }

        throw new GBeanNotFoundException("No implementation found for type " + type.getName(), null, set);
        }

        2.1 code:

        public Object getGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {
        try {
        return invokeKernel("getGBean", new Object[]

        {type}

        , new String[]

        {Class.class.getName()}

        );
        } catch (GBeanNotFoundException e)

        { throw e; } catch (RuntimeException e) { throw e; }

        catch (Exception e)

        { throw new InternalKernelException(e); }

        }

        I'm not sure why the other getGBean methods also don't use proxies. Can you see if this change fixes things in 2.1?

        Show
        David Jencks added a comment - Ashish, I think this should work on 2.2 where the getGBean call used returns a proxy. In 2.1 it looks like we're trying to get the actual gbean from the remote kernel which doesn't work. 2.2 code: public <T> T getGBean(Class<T> type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { Set<AbstractName> set = listGBeans(new AbstractNameQuery(type.getName())); for (AbstractName name : set) { return proxyManager.createProxy(name, type); } throw new GBeanNotFoundException("No implementation found for type " + type.getName(), null, set); } 2.1 code: public Object getGBean(Class type) throws GBeanNotFoundException, InternalKernelException, IllegalStateException { try { return invokeKernel("getGBean", new Object[] {type} , new String[] {Class.class.getName()} ); } catch (GBeanNotFoundException e) { throw e; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new InternalKernelException(e); } } I'm not sure why the other getGBean methods also don't use proxies. Can you see if this change fixes things in 2.1?
        Hide
        Ashish Jain added a comment -

        Hi David,

        What you suggested is correct and the 2.2 code once backported to 2.1 works fine. I see the entries are removed from config.xml successfully. I think the same can be applied to 2.1 branch as well.

        Thanks
        Ashish

        Show
        Ashish Jain added a comment - Hi David, What you suggested is correct and the 2.2 code once backported to 2.1 works fine. I see the entries are removed from config.xml successfully. I think the same can be applied to 2.1 branch as well. Thanks Ashish
        Hide
        Ashish Jain added a comment -

        David, Created a JIRA GERONIMO-5145 to address this issue.

        Show
        Ashish Jain added a comment - David, Created a JIRA GERONIMO-5145 to address this issue.
        Hide
        Ashish Jain added a comment -

        Just to add up on my comments earlier today I had just built the geronimo-system jar which has KernelDelegate and replaced it with the existing one. I will be running a full build now and can update the results if there are other dependencies getting affected. We can wait for some more time before commiting a patch.

        Show
        Ashish Jain added a comment - Just to add up on my comments earlier today I had just built the geronimo-system jar which has KernelDelegate and replaced it with the existing one. I will be running a full build now and can update the results if there are other dependencies getting affected. We can wait for some more time before commiting a patch.

          People

          • Assignee:
            Shawn Jiang
            Reporter:
            Ben Liang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development