HOWTO: remove a deployment context that is in error?
wolfc Jul 3, 2007 7:04 AM
"Brian" wrote:
I think something recently changed in the deployer code. I have a test that deployers a sar where some beans are deliberately meant to fail. At the end of the deployment, the following is logged:
2007-07-01 10:30:16,968 DEBUG [org.jboss.deployers.plugins.deployers.DeployersImpl] Fully Deployed vfsfile:/C:/dev/jboss/jboss-head/testsuite/output/lib/partitionstatetransfer.sar
2007-07-01 10:30:16,968 WARN [org.jboss.deployment.MainDeployer] Failed to deploy: file:/C:/dev/jboss/jboss-head/testsuite/output/lib/partitionstatetransfer.sar
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
*** CONTEXTS IN ERROR: Name -> Error
BadStatePartition -> org.jboss.test.cluster.partition.BadHAPartitionStateException: BadHAPartitionState cannot be deserialized
BadProviderPartition -> java.lang.IllegalStateException: Initial serviceState transfer failed: Channel.getState() returned false
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:552)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:379)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:814)
at org.jboss.deployment.MainDeployer.redeploy(MainDeployer.java:587)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
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:585)
at org.jboss.jmx.connector.invoker.InvokerAdaptorService.invoke(InvokerAdaptorService.java:270)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
at org.jboss.jmx.connector.invoker.SerializableInterceptor.invoke(SerializableInterceptor.java:74)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:179)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:815)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:416)
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:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
The test then does some stuff accessing other bean for a couple seconds, and then undeploys the sar. This doesn't go correctly. You get this logging:
2007-07-01 10:30:19,312 WARN [org.jboss.deployment.MainDeployer] undeploy 'file:/C:/dev/jboss/jboss-head/testsuite/output/lib/partitionstatetransfer.sar' : package not deployed
Thereafter, any test that includes testServerFound() will fail with an org.jboss.deployers.client.spi.IncompleteDeploymentException that lists the above two failed deployments.
Adding Brian's dodgy hack won't work:
2007-07-03 09:38:48,868 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] Remove deployment context: vfsfile:/home/carlo/work/jboss-head/ejb3/output/test-lib/jsr181-client.jar
2007-07-03 09:38:48,868 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] Not scheduling removal of context already in error: vfsfile:/home/carlo/work/jboss-head/ejb3/output/test-lib/jsr181-client.jar
Thus remains the question: how to remove a deployment context that is in error state?