[JBoss-dev] InstanceAlreadyExistsException afterundeployandrepeated deploy in JBoss AS 5.0.0 Beta

Brian Stansberry brian.stansberry at jboss.com
Tue Aug 15 19:07:40 EDT 2006


I believe the EJB container is not being unregistered from the
MBeanServer.  In Branch_4_0 it worked like this:

Registration: EjbModule.createService() --> MBeanServer.registerMBean()
Unregistration: EjbModule.destroyService() -->
ServiceController.remove() --> ServiceCreator.remove() -->
MBeanServer.unregisterMBean()

That seems like a pairing of actions that could easily get broken.

In HEAD, the registration part is the same.  Unregistration is:

EjbModule.destroyService() --> ServiceController.remove()  -->
ServiceController.safelyRemoveAnyRegisteredContext() -->
org.jboss.dependency.spi.Controller.uninstall() ....

>From there I don't know what happens, but it wouldn't surprise me if a
registerMBean call in EjbModule.createService() wasn't magically being
reversed ;)
 
Adding a server.unregisterMBean() call to EjbModule.destroyService()
made the problem go away, but I suspect that's not the right solution.
 

Brian Stansberry
Lead, AS Clustering
JBoss, a division of Red Hat
Ph: 510-396-3864
skype: bstansberry 

 


________________________________

	From: Brian Stansberry 
	Sent: Monday, August 14, 2006 2:06 PM
	To: JBoss.org development list
	Subject: RE: [JBoss-dev] InstanceAlreadyExistsException
afterundeployandrepeated deploy in JBoss AS 5.0.0 Beta
	
	
	There is a clustering test case (HAJndiTestCase) that fails in
HEAD for this same reason -- an earlier test deploys and undeploys the
same ejb jar HAJndiTestCase uses.  I've looked at the test log and there
is no indication of a problem with the earlier test.  In Jaroslaw's
first post before, the log of the undeploy is also clean.

	Brian Stansberry
	Lead, AS Clustering
	JBoss, a division of Red Hat
	Ph: 510-396-3864
	skype: bstansberry 

	 


________________________________

		From: jboss-development-bounces at lists.jboss.org
[mailto:jboss-development-bounces at lists.jboss.org] On Behalf Of Jaroslaw
Kijanowski
		Sent: Monday, August 14, 2006 1:56 PM
		To: JBoss.org development list
		Subject: RE: [JBoss-dev] InstanceAlreadyExistsException
afterundeployandrepeated deploy in JBoss AS 5.0.0 Beta
		
		
		I run the tests in one-test mode, so no time outs in
previous tests are the reason for IAEE. The first time I run test "X"
everything is fine, deploying jar, binding home interfaces and finally
unbinding home interfaces (what's not true because there are still
visible in the JMXConsole). When I run the test again I get the IAEE.
The whole package org.jboss.test.cmp2.* (over 250 tests) would run
without any errors (now over 230 errors), when unbinding would work
correct.
		For example, many tests have to bind EJBTestRunner to
jndi, but only the first test can do it successfully, the others can't
because EJBTestRunner isn't properly unbound and a repeated bind cause
the IAEE.
		I doesn't happen with JBoss4.
________________________________

		From: jboss-development-bounces at lists.jboss.org on
behalf of Ryan Campbell
		Sent: Mon 2006-08-14 13:42
		To: JBoss.org development list
		Subject: RE: [JBoss-dev] InstanceAlreadyExistsException
afterundeployandrepeated deploy in JBoss AS 5.0.0 Beta
		
		

		Jaroslaw, look for any test timeouts.  As Adrian
mentioned, it is some test failing to teardown and tests timing out are
likely suspects.  Debug them first.  If you see no test timeouts, then
the problem becomes harder. 

		 

		In that case, would it be realistic for JBossTestCase to
assert that the number of deployments remain constant between each
deploy and undeploy()?  Could be a simple mechanism to flag bad tests.

		 

		
________________________________


		From: jboss-development-bounces at lists.jboss.org
[mailto:jboss-development-bounces at lists.jboss.org] On Behalf Of Jaroslaw
Kijanowski
		Sent: Saturday, August 12, 2006 10:58 AM
		To: jboss-development at lists.jboss.org
		Subject: [JBoss-dev] InstanceAlreadyExistsException
afterundeploy andrepeated deploy in JBoss AS 5.0.0 Beta

		 

		Hello,
		 I've got the following issue with JBoss AS 5.0.0 Beta:
		After I run a test (in "one-test" mode, so no previous
test caused an time out etc.), I see on the server console that the
corresponding jar is undeploying and the home interfaces are unbinding.
But when I run the test again, I get InstanceAlreadyExistsException:

		
		11:43:12,406 INFO  [Server] JBoss (MX MicroKernel)
[5.0.0.Beta (build: CVSTag=HE
		AD date=200608071122)] Started in 1m:3s:563ms
		11:43:53,046 INFO  [EjbModule] Deploying Customer
		11:43:53,234 INFO  [EjbModule] Deploying Account
		11:43:53,250 INFO  [EjbModule] Deploying Teller
		11:43:53,281 INFO  [EjbModule] Deploying Bank
		11:43:54,687 INFO  [ProxyFactory] Bound EJB Home
'Customer' to jndi 'bank/Custom
		er'
		11:43:54,703 INFO  [ProxyFactory] Bound EJB Home
'Account' to jndi 'bank/Account
		'
		11:43:54,718 INFO  [ProxyFactory] Bound EJB Home
'Teller' to jndi 'bank/Teller'
		11:43:54,734 INFO  [ProxyFactory] Bound EJB Home 'Bank'
to jndi 'bank/Bank'
		11:43:54,734 INFO  [EJBDeployer] Deployed:
file:/D:/jboss-svn4/jboss-head/testsu
		ite/output/lib/bank.jar
		11:44:02,093 INFO  [EJBDeployer] Undeploying:
file:/D:/jboss-svn4/jboss-head/tes
		tsuite/output/lib/bank.jar
		11:44:02,125 INFO  [ProxyFactory] Unbind EJB Home 'Bank'
from jndi 'bank/Bank'
		11:44:02,125 INFO  [EjbModule] Undeployed Bank
		11:44:02,125 INFO  [ProxyFactory] Unbind EJB Home
'Teller' from jndi 'bank/Telle
		r'
		11:44:02,125 INFO  [EjbModule] Undeployed Teller
		11:44:02,125 INFO  [ProxyFactory] Unbind EJB Home
'Account' from jndi 'bank/Acco
		unt'
		11:44:02,140 INFO  [EjbModule] Undeployed Account
		11:44:02,140 INFO  [ProxyFactory] Unbind EJB Home
'Customer' from jndi 'bank/Cus
		tomer'
		11:44:02,140 INFO  [EjbModule] Undeployed Customer

		*************
		An now I run the test again:
		*************

		11:44:17,390 INFO  [EjbModule] Deploying Customer
		11:44:17,421 INFO  [EjbModule] Deploying Account
		11:44:17,421 INFO  [EjbModule] Deploying Teller
		11:44:17,437 INFO  [EjbModule] Deploying Bank
		11:44:17,453 INFO  [EntityContainer] Registration is not
done -> stop
		11:44:17,453 ERROR [AbstractKernelController] Error
installing to Create: name=j
		boss.j2ee:module=bank.jar,service=EjbModule,uid=29596937
state=Configured mode=M
		anual requiredState=Create
		javax.management.InstanceAlreadyExistsException:
jboss.j2ee:jndiName=bank/Custom
		er,service=EJB already registered.
		        at
org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistr
		y.java:765)
		        at
org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMB
		eanRegistry.java:234)
		.
		.
		.
		11:44:17,531 INFO  [EJBDeployer] Deployed:
file:/D:/jboss-svn4/jboss-head/testsu
		ite/output/lib/bank.jar
		11:44:17,968 INFO  [EJBDeployer] Undeploying:
file:/D:/jboss-svn4/jboss-head/tes
		tsuite/output/lib/bank.jar
		******************
		I saw similar issues for previous versions of the AS
(all resolved) but I think this is the first for the Beta 5.0 version.

		 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-development/attachments/20060815/e3a34ef0/attachment.html 


More information about the jboss-development mailing list