# Wildfly NullPointerException

**URL:** <https://forum.keycloak.org/t/wildfly-nullpointerexception/747>\
**Category:** Configuring the server\
**Created:** [December 19, 2019, 9:04pm UTC](https://forum.keycloak.org/t/wildfly-nullpointerexception/747 "2019-12-19T21:04:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASTP001](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/astp001/32/107_2.png) [@ASTP001](https://forum.keycloak.org/u/ASTP001)\
**Post date:** [December 19, 2019, 9:04pm UTC](https://forum.keycloak.org/t/wildfly-nullpointerexception/747/1 "2019-12-19T21:04:01Z")

</div>

Hello,

I am trying to deploy Keycloak using a helm chart provided by code centric at: [https://codecentric.github.io/helm-charts](https://codecentric.github.io/helm-charts)

this method worked by default, but when I added environment variables I keep getting the following error:

```
20:58:23,868 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "microprofile-metrics-smallrye")]): java.lang.NullPointerException
	at org.wildfly.extension.microprofile.metrics.MicroProfileMetricsSubsystemAdd$2.execute(MicroProfileMetricsSubsystemAdd.java:86)
	at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:999)
	at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:743)
	at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:467)
	at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1412)
	at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:521)
	at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:472)
	at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:434)
	at org.jboss.as.server.ServerService.boot(ServerService.java:435)
	at org.jboss.as.server.ServerService.boot(ServerService.java:394)
	at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:374)
	at java.lang.Thread.run(Thread.java:748)

```

If I restart the postgres pod, the issue resolves itself however I lose all my settings.  
I was wondering if someone could help, thanks!

---

<div class="post-metadata">

**Author:** ![ASTP001](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/astp001/32/107_2.png) [@ASTP001](https://forum.keycloak.org/u/ASTP001)\
**Post date:** [December 20, 2019, 9:29pm UTC](https://forum.keycloak.org/t/wildfly-nullpointerexception/747/2 "2019-12-20T21:29:12Z")

</div>

Turns out I had to set the postgres password explicitly, since in each deploy KC server generated new password but the database remained the same. I added the following to my values.yaml file under the keycloak values which solved the issue:

```
  postgresql:
    postgresqlPassword: <some static password>
```

---

<div class="post-metadata">

**Author:** ![bentatham](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/bentatham/32/160_2.png) [@bentatham](https://forum.keycloak.org/u/bentatham)\
**Post date:** [February 13, 2020, 2:09pm UTC](https://forum.keycloak.org/t/wildfly-nullpointerexception/747/3 "2020-02-13T14:09:01Z")

</div>

I have the same exception stack trace, but I am using an existing postgres database (not deployed with the chart). Adding `postgresql.postgresqlPassword` doesn’t help in my case (based on the comments in values, its because those values are only used for postgres if running as part of the helm chart).

Chart version: 6.2.0  
Keycloak version: 8.0.2

Any other ideas?

---

<div class="post-metadata">

**Author:** ![fri-sch](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@fri-sch](https://forum.keycloak.org/u/fri-sch)\
**Post date:** [February 14, 2020, 5:47pm UTC](https://forum.keycloak.org/t/wildfly-nullpointerexception/747/4 "2020-02-14T17:47:32Z")

</div>

I have an instance with a MySQL database running with docker-compose. I’m currently on version 7.0.0 and whenever I try to upgrade to 7.0.1 or 8.0.x I get the same exception above. Downgrading to 7.0.0 and the problem is gone again.

Please can anyone help to resolve this?  
Thanks!

---

<div class="post-metadata">

**Author:** ![fri-sch](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@fri-sch](https://forum.keycloak.org/u/fri-sch)\
**Post date:** [February 19, 2020, 4:34pm UTC](https://forum.keycloak.org/t/wildfly-nullpointerexception/747/5 "2020-02-19T16:34:54Z")

</div>

In my case I missed to set JDBC\_PARAMS correctly to disable SSL for the db connection.  
See: [https://issues.redhat.com/browse/KEYCLOAK-13033?focusedCommentId=13976326](https://issues.redhat.com/browse/KEYCLOAK-13033?focusedCommentId=13976326)

---

<div class="post-metadata">

**Author:** ![Cracky5457](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/cracky5457/32/5937_2.png) [@Cracky5457](https://forum.keycloak.org/u/Cracky5457)\
**Post date:** [June 24, 2020, 1:19pm UTC](https://forum.keycloak.org/t/wildfly-nullpointerexception/747/6 "2020-06-24T13:19:47Z")

</div>

I have a similar error

Trying to upgrade from 6.0.1 to 10.0.2

```
2020-06-24 15:06:44,254 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "microprofile-metrics-smallrye")]): java.lang.NullPointerException
	at org.wildfly.extension.microprofile.metrics.MicroProfileMetricsSubsystemAdd$2.execute(MicroProfileMetricsSubsystemAdd.java:86)
	at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:999)
	at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:743)
	at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:467)
	at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1413)
	at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:527)
	at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:515)
	at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:477)
	at org.jboss.as.server.ServerService.boot(ServerService.java:448)
	at org.jboss.as.server.ServerService.boot(ServerService.java:401)
	at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:416)
	at java.lang.Thread.run(Thread.java:748)

2020-06-24 15:06:44,259 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0190: Step handler org.jboss.as.server.DeployerChainAddHandler$FinalRuntimeStepHandler@6826e014 for operation add-deployer-chains at address [] failed -- java.util.concurrent.RejectedExecutionException: java.util.concurrent.RejectedExecutionException
	at org.jboss.threads.RejectingExecutor.execute(RejectingExecutor.java:37)
	at org.jboss.threads.EnhancedQueueExecutor.rejectShutdown(EnhancedQueueExecutor.java:2026)
	at org.jboss.threads.EnhancedQueueExecutor.execute(EnhancedQueueExecutor.java:757)
	at org.jboss.as.controller.notification.NotificationSupports$NonBlockingNotificationSupport.emit(NotificationSupports.java:95)
	at org.jboss.as.controller.OperationContextImpl.notifyModificationBegun(OperationContextImpl.java:877)
	at org.jboss.as.controller.OperationContextImpl.ensureWriteLockForRuntime(OperationContextImpl.java:866)
	at org.jboss.as.controller.OperationContextImpl.removeService(OperationContextImpl.java:639)
	at org.jboss.as.server.DeployerChainAddHandler$FinalRuntimeStepHandler$1.handleRollback(DeployerChainAddHandler.java:135)
	at org.jboss.as.controller.AbstractOperationContext$RollbackDelegatingResultHandler.handleResult(AbstractOperationContext.java:1561)
	at org.jboss.as.controller.AbstractOperationContext$Step.invokeResultHandler(AbstractOperationContext.java:1533)
	at org.jboss.as.controller.AbstractOperationContext$Step.handleResult(AbstractOperationContext.java:1515)
	at org.jboss.as.controller.AbstractOperationContext$Step.finalizeInternal(AbstractOperationContext.java:1472)
	at org.jboss.as.controller.AbstractOperationContext$Step.finalizeStep(AbstractOperationContext.java:1455)
	at org.jboss.as.controller.AbstractOperationContext$Step.access$400(AbstractOperationContext.java:1319)
	at org.jboss.as.controller.AbstractOperationContext.executeResultHandlerPhase(AbstractOperationContext.java:876)
	at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:756)
	at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:467)
	at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1413)
	at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:527)
	at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:515)
	at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:477)
	at org.jboss.as.server.ServerService.boot(ServerService.java:448)
	at org.jboss.as.server.ServerService.boot(ServerService.java:401)
	at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:416)
	at java.lang.Thread.run(Thread.java:748)
	Suppressed: java.util.concurrent.RejectedExecutionException: Executor is being shut down
		at org.jboss.threads.EnhancedQueueExecutor.rejectShutdown(EnhancedQueueExecutor.java:2028)
		... 23 more
```

---

<div class="post-metadata">

**Author:** ![spa](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/spa/32/1065_2.png) [@spa](https://forum.keycloak.org/u/spa)\
**Post date:** [June 29, 2020, 10:10am UTC](https://forum.keycloak.org/t/wildfly-nullpointerexception/747/7 "2020-06-29T10:10:03Z")

</div>

I had the same error upgrading from 6.0.1 to 10.0.2. It turned out, that one of the realms had the “account” client deleted. I recreated the client from scratch and it works like a charm now.

Is this a bug that is worth filing? IMHO deleting this client is sure my fault.
