Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-8249

NPE and unclear error message when creation of JDBC batch repository fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 7.1.0.DR14
    • None
    • Batch
    • None

      If you try to create a JDBC batch repository using a data source which is incorrectly configured, eg. it fails to log in to the database:

      [standalone@localhost:9990 /] /subsystem=batch-jberet/jdbc-job-repository=zzz:add(data-source=x)
      {
          "outcome" => "failed",
          "failure-description" => {
              "WFLYCTL0080: Failed services" => {"org.wildfly.batch.job.repository.zzz" => "org.jboss.msc.service.StartException in service org.wildfly.batch.job.repository.zzz: WFLYBATCH000011: Failed to create JDBC job repository.
          Caused by: java.lang.NullPointerException"},
              "WFLYCTL0412: Required services that are not installed:" => ["org.wildfly.batch.job.repository.zzz"],
              "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
          },
          "rolled-back" => true
      }
      

      If you look into server log you see the details of the NPE:

      16:29:39,435 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 58) MSC000001: Failed to start service org.wildfly.batch.job.repository.zzz: org.jboss.msc.service.StartException in service org.wildfly.batch.job.repository.zzz: WFLYBATCH000011: Failed to create JDBC job repository.
      	at org.wildfly.extension.batch.jberet.job.repository.JdbcJobRepositoryService.lambda$startJobRepository$0(JdbcJobRepositoryService.java:59)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      	at org.jboss.threads.JBossThread.run(JBossThread.java:320)
      Caused by: java.lang.NullPointerException
      	at org.jberet.repository.JdbcRepository.close(JdbcRepository.java:1009)
      	at org.jberet.repository.JdbcRepository.createTables(JdbcRepository.java:295)
      	at org.jberet.repository.JdbcRepository.<init>(JdbcRepository.java:205)
      	at org.jberet.repository.JdbcRepository.<init>(JdbcRepository.java:167)
      	at org.wildfly.extension.batch.jberet.job.repository.JdbcJobRepositoryService.lambda$startJobRepository$0(JdbcJobRepositoryService.java:56)
      	... 4 more
      

      You can also see the root cause in the server log only, for example this

      (...)
      Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database "dballo03" requested by the login. The login failed. ClientConnectionId:2ec18f2d-84a4-4a76-998d-72bee6eedbc0
      (...)
      

      The NPE should not occur and the error shown in CLI should be more informative.

              jperkins-rhn James Perkins
              jmartisk@redhat.com Jan Martiska
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: