<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=white lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Should ServiceProxy be serializable?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'>Caused by:
java.io.NotSerializableException: org.jboss.system.microcontainer.ServiceProxy<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'> at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'> at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'> at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>for:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>ServiceControllerMBean scmb =
(ServiceControllerMBean)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>
MBeanServerInvocationHandler.newProxyInstance(server,
ServiceControllerMBean.OBJECT_NAME,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>
ServiceControllerMBean.class, false);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>and also for:<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>ServiceContext
sc = (ServiceContext)<span style='background:silver'>server</span>.invoke(so, </span></font><font
size=2 color="#2a00ff" face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:#2A00FF'>"getServiceContext"</span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>,
</span></font><b><font size=2 color="#7f0055" face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;font-weight:
bold'>new</span></font></b><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> Object[]{serviceOName}, </span></font><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
</span></font><b><font size=2 color="#7f0055" face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:#7F0055;font-weight:
bold'>new</span></font></b><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> String[]{</span></font><font
size=2 color="#2a00ff" face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:#2A00FF'>"javax.management.ObjectName"</span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>});<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>Why cannot ServiceContext be
an attribute on the ServiceControllerMBean(feature request?)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>Basically, when the
ServiceController has entered the Error state for a service, then I get the
state of the service (after unregister->create->start) is the state “REGISTERED”
(instead of Started)</span></font><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
color=black face="Times New Roman"><span style='font-size:12.0pt;color:windowtext'>
<hr size=3 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 color=black face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;color:windowtext;font-weight:bold'>From:</span></font></b><font
size=2 color=black face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
color:windowtext'> jboss-development-bounces@lists.jboss.org
[mailto:jboss-development-bounces@lists.jboss.org] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Scott M Stark<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, August 23, 2006
8:32 AM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">JBoss.org
development list</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [JBoss-dev]
AbstractKernelController behavior inconsistent</span></font><font color=black><span
style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'>The question is which constructs should be working and
which should not. I have added a testErrorInContainedStartRedeployAfterError to
the
org.jboss.test.system.controller.lifecycle.test.LifecycleRedeployAfterErrorTest
on the MC_VDF_WORK branch, and although this does not show a problem with being
able to redeploy a failed deployment, it does show that the errors from the
lifecycle methods are not being propagated back to the caller. From the test
logging, the ContainedMBeanService is throwing an error because it did not see
the expected error from the contained SimpleMBean start:<br>
<br>
1720 ERROR [AbstractKernelController] Error installing to Start:
name=jboss.test:type=test state=Create mode=Manual requiredState=Installed<br>
java.lang.Error: Did not see expected ERRORINSTART from:
jboss.test:contained=SimpleMBean,type=test<br>
at
org.jboss.test.system.controller.support.ContainedMBeanService.startService(ContainedMBeanService.java:87)<br>
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)<br>
at
org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)<br>
at
jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown
Source)<br>
at
java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;J)Ljava.lang.Object;(Unknown
Source)<br>
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)<br>
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)<br>
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)<br>
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)<br>
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)<br>
at
org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:167)<br>
at $Proxy0.start()V(Unknown Source)<br>
at
org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)<br>
at org.jboss.system.microcontainer.ServiceControllerContextAction.install(ServiceControllerContextAction.java:46)<br>
at
org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)<br>
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226)<br>
at
org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:198)<br>
at
org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:596)<br>
at
org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:346)<br>
at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:438)<br>
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:379)<br>
at
org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:263)<br>
at
org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:164)<br>
at org.jboss.system.ServiceController.doChange(ServiceController.java:632)<br>
at
org.jboss.system.ServiceController.start(ServiceController.java:407)<br>
at
org.jboss.test.system.controller.SimpleSARDeployer.start(SimpleSARDeployer.java:131)<br>
at org.jboss.test.system.controller.SimpleSARDeployer.deploy(SimpleSARDeployer.java:86)<br>
at
org.jboss.test.system.controller.ControllerTestDelegate.deploy(ControllerTestDelegate.java:176)<br>
at
org.jboss.test.system.controller.ControllerTestDelegate.assertDeployFailure(ControllerTestDelegate.java:227)<br>
<br>
This is the first change in behavior that is breaking Anil's example.<br>
<br>
Adrian Brock wrote: <o:p></o:p></span></font></p>
<pre wrap=""><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>On Wed, 2006-08-23 at 09:53 -0500, Anil Saldhana wrote:<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'> <o:p></o:p></span></font></pre>
<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt' type=cite><pre wrap=""><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><a
href="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=89066">http://www.jboss.com/index.html?module=bb&op=viewtopic&t=89066</a><o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>What about getting the ServiceController to get out of the Error state<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>and undeploy the service when asked to?<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'> <o:p></o:p></span></font></pre></blockquote>
<pre wrap=""><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>It already does when you undeploy, I have a test for just that.<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Unless you have a test that shows otherwise.<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'> <o:p></o:p></span></font></pre>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>