I'm seeing start being
called twice for a particular MBean and thus, I'm getting an error. I
think what is happening is this:
1. deploy 'A' MBean, its dependency 'B' has not been resolved
2. Deploy 'B', resolve 'A''s dependency, call create/start
3. Undeploy 'B'
4. Deploy 'B'
Is this the correct behavior? Is the 4.0.4 kernel attempting to do
redploys correct?
This is a JUnit test. testPUDependencies runs fine. testDepends fails
as a service EJB3 created MBean gets start() called twice.
public class DependencyUnitTestCase
extends JBossTestCase
{
public void testPUDependencies() throws Exception
{
Stateless2 test = null;
boolean exceptionThrown = false;
try
{
test = (Stateless2)
getInitialContext().lookup("Stateless2Bean/remote");
test.createCustomer();
}
catch (Exception ex)
{
exceptionThrown = true;
}
assertTrue(exceptionThrown);
super.deploy("dependedon.sar");
try
{
test = (Stateless2)
getInitialContext().lookup("Stateless2Bean/remote");
test.createCustomer();
}
finally
{
super.undeploy("dependedon.sar");
}
}
public void testDepends() throws Exception
{
boolean exceptionThrown = false;
try
{
HasMBeanDependency dependency =
(HasMBeanDependency)getInitialContext().lookup("dependency-test/HasMBeanDependencyBean/remote");
}
catch (Exception e)
{
exceptionThrown = true;
}
assertTrue(exceptionThrown);
exceptionThrown = false;
try
{
HasXmlMBeanDependency dependency =
(HasXmlMBeanDependency)getInitialContext().lookup("dependency-test/HasXmlMBeanDependencyBean/remote");
}
catch (Exception e)
{
exceptionThrown = true;
}
assertTrue(exceptionThrown);
exceptionThrown = false;
super.deploy("dependedon.sar");
try
{
try
{
HasMBeanDependency dependency =
(HasMBeanDependency)getInitialContext().lookup("dependency-test/HasMBeanDependencyBean/remote");
}
catch (Exception e)
{
exceptionThrown = true;
}
assertTrue(exceptionThrown);
// should pass now
HasXmlMBeanDependency dependency =
(HasXmlMBeanDependency)getInitialContext().lookup("dependency-test/HasXmlMBeanDependencyBean/remote");
dependency.noop();
super.deploy("anotherdependedon.sar");
try
{
HasMBeanDependency dependency2 =
(HasMBeanDependency)getInitialContext().lookup("dependency-test/HasMBeanDependencyBean/remote");
dependency2.testNotNull();
}
finally
{
super.undeploy("anotherdependedon.sar");
}
}
finally
{
super.undeploy("dependedon.sar");
}
}
public static Test suite() throws Exception
{
return getDeploySetup(DependencyUnitTestCase.class,
"dependency-test.ear, ejbdepends.jar");
}
}
--
Bill Burke
Chief Architect
JBoss Inc.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development