Uploaded image for project: 'IronJacamar'
  1. IronJacamar
  2. JBJCA-941

NPE in ResourceAdapter1516Impl for invalid RAR

XMLWordPrintable

      In case of an invalid RAR (JCA 1.6 but not adapter class) you get the following deployment error in JBoss AS.

      15:38:22,236 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.subunit."sample-application-1.0.0-SNAPSHOT.ear"."sample-adapter-1.0.0-SNAPSHOT.rar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."sample-application-1.0.0-SNAPSHOT.ear"."sample-adapter-1.0.0-SNAPSHOT.rar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "sample-adapter-1.0.0-SNAPSHOT.rar" of deployment "sample-application-1.0.0-SNAPSHOT.ear"
      	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.8.0-ea]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.8.0-ea]
      	at java.lang.Thread.run(Thread.java:722) [rt.jar:1.8.0-ea]
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.NullPointerException
      	at org.jboss.as.connector.deployers.ra.processors.ParsedRaDeploymentProcessor.deploy(ParsedRaDeploymentProcessor.java:185)
      	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
      	... 5 more
      Caused by: java.lang.NullPointerException
      	at org.jboss.jca.common.metadata.ra.common.ResourceAdapter1516Impl.validate(ResourceAdapter1516Impl.java:351)
      	at org.jboss.jca.common.metadata.ra.common.ConnectorAbstractmpl.validate(ConnectorAbstractmpl.java:332)
      	at org.jboss.as.connector.deployers.ra.processors.ParsedRaDeploymentProcessor.deploy(ParsedRaDeploymentProcessor.java:142)
      	... 6 more
      

      It should be a

      org.jboss.jca.common.api.validator.ValidateException

      but ends up being a

      java.lang.NullPointerException

      . The problem is that

      ResourceAdapter1516Impl#validate()

      uses

      this.resourceadapterClass == null
      

      instead of

      XsdString.isNull(this.resourceadapterClass)
      

      like

      #getResourceadapterClass()

      or the constructor.

      this.resourceadapterClass.getValue()
      

      then returns

      null

      so

      this.resourceadapterClass.getValue().trim()
      

      throws a

      NullPointerException

              jpederse@redhat.com Jesper Pedersen
              pmarscha Philippe Marschall (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: