5 Replies Latest reply on Nov 10, 2011 7:09 AM by Ales Justin

    setter declared in a superclass prevents sar from being deployed

    Radim Hanus Expert

      Hi guys,

       

      While migrating an application into jboss7 I've encounter unpleasant problem with sar backward compatability

      I've following jboss-service descriptor and bean classes:

       

      <server xmlns="urn:jboss:service:7.0"

            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

            xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">

       

          <mbean code="XXX" name="jboss:service=XXX">

              <attribute name="CustomName">custom_name/attribute>

          </mbean>

      </server>

       

      public class XXX extends YYY {

      ...

      }

       

      public class YYY {

      ...

           setCustomName(String name) {

           ....

           }

      ...

      }

       

      But following error occurs under deployment:

       

      15:19:55,234 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."xxx.sar".INSTALL: org.jboss.msc.service.

      StartException in service jboss.deployment.unit."xxx.sar".INSTALL: Failed to process phase INSTALL of deployment "xxx.sar"

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_29]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_29]

              at java.lang.Thread.run(Thread.java:662) [:1.6.0_29]

      Caused by: java.lang.IllegalStateException: No such set method for property 'CustomName' found on class XXX

              at org.jboss.as.service.ReflectionUtils.getSetter(ReflectionUtils.java:75)

              at org.jboss.as.service.ParsedServiceDeploymentProcessor.getValue(ParsedServiceDeploymentProcessor.java:186)

              at org.jboss.as.service.ParsedServiceDeploymentProcessor.addServices(ParsedServiceDeploymentProcessor.java:143)

              at org.jboss.as.service.ParsedServiceDeploymentProcessor.deploy(ParsedServiceDeploymentProcessor.java:102)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)

              ... 5 more