4 Replies Latest reply on Sep 7, 2005 1:39 PM by Kabir Khan

    Properties MC example

    Kabir Khan Master

      Hi Adrian,


      I'm just going through the microcontainer examples, and was wondering why subtitle, link and title get set twice, the second time to null? Is this part of the "undeploy" step?


      Kabir@KabirDell /c/temp/microcontainer-1.0.0/examples/properties
      $ ant
      Buildfile: build.xml

      compile:
      [mkdir] Created dir: C:\temp\microcontainer-1.0.0\examples\properties\build
      [javac] Compiling 1 source file to C:\temp\microcontainer-1.0.0\examples\properties\build

      dist:
      [copy] Copying 1 file to C:\temp\microcontainer-1.0.0\examples\properties\build
      [mkdir] Created dir: C:\temp\microcontainer-1.0.0\examples\properties\dist
      [jar] Building jar: C:\temp\microcontainer-1.0.0\examples\properties\dist\example-properties.beans

      run:
      [java] PropertiesBean()
      [java] setSubTitle: null
      [java] setNumber: 4 type=java.lang.Long
      [java] setTitle: JBoss Microcontainer property example
      [java] setLink: http://www.jboss.org
      [java] setSubTitle: null
      [java] setLink: null
      [java] setTitle: null

      Also, when attempting to deploy the properties example into jboss, I get the following error:

      12:05:20,468 WARN [EntityResolver] Entity is not registered, publicId=null systemId=jar:file:/C:/temp/jboss-4.0.3RC2/server/defau
      lt/tmp/deploy/tmp50747example-properties.beans!/META-INF/bean-deployer_1_0.xsd
      12:05:20,468 WARN [SaxJBossXBParser] schema_reference.4: Failed to read schema document 'bean-deployer_1_0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. @ jar:file:/C:
      /temp/jboss-4.0.3RC2/server/default/tmp/deploy/tmp50747example-properties.beans!/META-INF/jboss-beans.xml[5,45]
      12:05:20,796 INFO [STDOUT] PropertiesBean()
      12:05:20,796 ERROR [AbstractKernelController] Error installing to Configured: name=PropertiesBean state=Instantiated mode=Manual r equiredState=Create
      java.lang.NoSuchMethodException: java.lang.Number.(java.lang.String)
      at java.lang.Class.getConstructor0(Class.java:1937)
      at java.lang.Class.getConstructor(Class.java:1027)
      at org.jboss.beans.metadata.plugins.StringValueMetaData.getValue(StringValueMetaData.java:107)
      at org.jboss.kernel.plugins.config.Configurator.getPropertySetterJoinPoint(Configurator.java:469)
      at org.jboss.kernel.plugins.config.Configurator.getPropertySetterJoinPoint(Configurator.java:416)
      at org.jboss.kernel.plugins.config.Configurator.getPropertySetterJoinPoints(Configurator.java:382)
      at org.jboss.kernel.plugins.config.AbstractKernelConfigurator.getPropertySetterJoinPoints(AbstractKernelConfigurator.java:
      109)
      at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$ConfigureAction.installAction(KernelControllerContex
      tActions.java:176)
      at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$KernelControllerContextAction.install(KernelControll
      erContextActions.java:84)
      at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:36)
      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:211)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:560)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:328)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:411)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:361)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:207)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:133)
      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:257)
      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:236)
      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:87)
      at org.jboss.kernel.deployment.jboss.JBossBeanDeployment.createService(JBossBeanDeployment.java:55)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:252)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:234)
      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:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:974)
      at $Proxy0.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:356)
      at org.jboss.system.ServiceController.create(ServiceController.java:295)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy16.create(Unknown Source)
      at org.jboss.deployment.SimpleSubDeployerSupport.createService(SimpleSubDeployerSupport.java:312)
      at org.jboss.deployment.SimpleSubDeployerSupport.create(SimpleSubDeployerSupport.java:87)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:919)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:773)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
      at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy9.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
      12:05:20,796 WARN [ServiceController] Problem starting service jboss.beans:name='example-properties.beans',service=JBossBeanDeplo
      yment
      org.jboss.deployment.DeploymentException: Cannot start AbstractKernelDeployment@75a744{name=jar:file:/C:/temp/jboss-4.0.3RC2/serve
      r/default/tmp/deploy/tmp50747example-properties.beans!/META-INF/jboss-beans.xml installed=true beans=[AbstractBeanMetaData@387202{
      name=PropertiesBean bean=org.jboss.example.microcontainer.properties.PropertiesBean properties=[title, subTitle, link, number] con structor=null}]}; - nested throwable: (java.lang.IllegalStateException: Incompletely deployed:

      *** DEPLOYMENTS IN ERROR:
      PropertiesBean -> java.lang.NoSuchMethodException: java.lang.Number.(java.lang.String)
      )
      at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:39)
      at org.jboss.kernel.deployment.jboss.JBossBeanDeployment.startService(JBossBeanDeployment.java:72)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:287)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:236)
      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:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:974)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:453)
      at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy16.start(Unknown Source)
      at org.jboss.deployment.SimpleSubDeployerSupport.startService(SimpleSubDeployerSupport.java:330)
      at org.jboss.deployment.SimpleSubDeployerSupport.start(SimpleSubDeployerSupport.java:112)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:973)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:774)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
      at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy9.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
      Caused by: java.lang.IllegalStateException: Incompletely deployed:

      *** DEPLOYMENTS IN ERROR:
      PropertiesBean -> java.lang.NoSuchMethodException: java.lang.Number.(java.lang.String)

      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:216)
      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:146)
      at org.jboss.kernel.deployment.jboss.JBossBeanDeployment.startService(JBossBeanDeployment.java:68)
      ... 47 more
      12:05:20,812 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.beans:name='example-properties.beans',service=JBossBeanDeployment
      State: FAILED
      Reason: org.jboss.deployment.DeploymentException: Cannot start AbstractKernelDeployment@75a744{name=jar:file:/C:/temp/jboss-4.0.
      3RC2/server/default/tmp/deploy/tmp50747example-properties.beans!/META-INF/jboss-beans.xml installed=true beans=[AbstractBeanMetaDa ta@387202{name=PropertiesBean bean=org.jboss.example.microcontainer.properties.PropertiesBean properties=[title, subTitle, link, n umber] constructor=null}]}; - nested throwable: (java.lang.IllegalStateException: Incompletely deployed:

      *** DEPLOYMENTS IN ERROR:
      PropertiesBean -> java.lang.NoSuchMethodException: java.lang.Number.(java.lang.String)
      )

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.beans:name='example-properties.beans',service=JBossBeanDeployment
      State: FAILED
      Reason: org.jboss.deployment.DeploymentException: Cannot start AbstractKernelDeployment@75a744{name=jar:file:/C:/temp/jboss-4.0.
      3RC2/server/default/tmp/deploy/tmp50747example-properties.beans!/META-INF/jboss-beans.xml installed=true beans=[AbstractBeanMetaDa ta@387202{name=PropertiesBean bean=org.jboss.example.microcontainer.properties.PropertiesBean properties=[title, subTitle, link, n umber] constructor=null}]}; - nested throwable: (java.lang.IllegalStateException: Incompletely deployed:

      *** DEPLOYMENTS IN ERROR:
      PropertiesBean -> java.lang.NoSuchMethodException: java.lang.Number.(java.lang.String)
      )


      Cheers,

      Kabir

        • 1. Re: Properties MC example
          Adrian Brock Master

           

          "kabir.khan@jboss.com" wrote:
          Hi Adrian,


          I'm just going through the microcontainer examples, and was wondering why subtitle, link and title get set twice, the second time to null? Is this part of the "undeploy" step?


          That is the expected behaviour. See the readme.txt

          The MC nulls all none primitive properties at "undeploy", actually "unconfigure"
          1) to help the GC by breaking links
          2) to help in avoiding inadvertant memory leaks

          If the POJO doesn't like this, e.g. it throws an Exception,
          the MC just ignores the error.

          • 2. Re: Properties MC example
            Adrian Brock Master

             

            "kabir.khan@jboss.com" wrote:

            12:05:20,796 ERROR [AbstractKernelController] Error installing to Configured: name=PropertiesBean state=Instantiated mode=Manual r equiredState=Create
            java.lang.NoSuchMethodException: java.lang.Number.<init>(java.lang.String)
            at java.lang.Class.getConstructor0(Class.java:1937)
            at java.lang.Class.getConstructor(Class.java:1027)


            I don't see this error ..
            Either you have an old version of the MC in jboss-4.0.x
            or you are missing the property editor?

            Failing that, you can enable TRACE logging, e.g. StringValueMetaData
            has this logging just before it tries to find the property editor:
             log.trace("getValue value=" + value + " type=" + type + " info=" + info);
            



            • 3. Re: Properties MC example
              Adrian Brock Master

               

              "adrian@jboss.org" wrote:

              Either you have an old version of the MC in jboss-4.0.x


              I just updated the 4.0.x branch to use JBossMC_1_0_0 jars this morning.
              So 4.0.x now how the same code as the standalone examples in the distribution.

              • 4. Re: Properties MC example
                Kabir Khan Master

                Old version was the culprit, all is well following an update of the 4.0.x branch.

                Great stuff!