title: WSO2 IS - org.wso2.carbon.user.core.UserStoreException: null
body: <p>I'm running a WSO2 container with all products together(apim-is-as-km-with-analytics) using mysql as database and I'm facing an error when the docker compose starts. My problem is on wso2-is server, it shows the following message:</p>
  <pre><code>[2021-02-26 21:38:17,531] []  INFO {org.wso2.carbon.mex2.internal.DynamicCRMCustomMexComponent} - DynamicCRMSupport MexServiceComponent bundle activated successfully.
   [2021-02-26 21:38:19,923] []  INFO {org.apache.jasper.servlet.TldScanner} - At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
   [2021-02-26 21:38:20,098] []  INFO {org.wso2.carbon.identity.authenticator.x509Certificate.internal.X509CertificateServiceComponent} - X509 Certificate Servlet activated successfully..
   [2021-02-26 21:38:23,807] [] ERROR {org.wso2.carbon.user.core.common.DefaultRealm} - nullType class java.lang.reflect.InvocationTargetException org.wso2.carbon.user.core.UserStoreException: nullType class java.lang.reflect.InvocationTargetException
      at org.wso2.carbon.user.core.common.DefaultRealm.createObjectWithOptions(DefaultRealm.java:397)
      at org.wso2.carbon.user.core.common.DefaultRealm.initializeObjects(DefaultRealm.java:224)
      at org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:129)
      at org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:276)
      at org.wso2.carbon.user.core.common.DefaultRealmService.&lt;init&gt;(DefaultRealmService.java:102)
      at org.wso2.carbon.user.core.common.DefaultRealmService.&lt;init&gt;(DefaultRealmService.java:115)
      at org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:72)
      at org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:61)
      at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:842)
      at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:834)
      at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:791)
      at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1013)
      at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
      at org.eclipse.osgi.container.Module.doStart(Module.java:598)
      at org.eclipse.osgi.container.Module.start(Module.java:462)
      at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$1.run(ModuleContainer.java:1820)
      at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$2$1.execute(EquinoxContainerAdaptor.java:150)
      at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1813)
      at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1770)
      at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1735)
      at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1661)
      at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
      at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
      at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
   Caused by: java.lang.reflect.InvocationTargetException
      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
      at org.wso2.carbon.user.core.common.DefaultRealm.createObjectWithOptions(DefaultRealm.java:351)
      ... 25 more
   Caused by: org.wso2.carbon.user.core.UserStoreException: DB error occurred while persisting domain : PRIMARY &amp; tenant id : -1234
      at org.wso2.carbon.user.core.util.UserCoreUtil.persistDomain(UserCoreUtil.java:871)
      at org.wso2.carbon.user.core.common.AbstractUserStoreManager.persistDomain(AbstractUserStoreManager.java:8595)
      at org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.&lt;init&gt;(ReadOnlyLDAPUserStoreManager.java:243)
      at org.wso2.carbon.user.core.ldap.UniqueIDReadOnlyLDAPUserStoreManager.&lt;init&gt;(UniqueIDReadOnlyLDAPUserStoreManager.java:148)
      at org.wso2.carbon.user.core.ldap.UniqueIDReadWriteLDAPUserStoreManager.&lt;init&gt;(UniqueIDReadWriteLDAPUserStoreManager.java:122)
      ... 30 more
   Caused by: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
  </code></pre>
  <p>The last line on log shows a message</p>
  <pre><code> Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
  </code></pre>
  <p>It's estrange because I already put the mysql driver on Dockerfile from wso2-is:</p>
  <pre><code># copy MySQL JDBC connector to server home as a third party library
  COPY --chown=wso2carbon:wso2 /binary/mysql-connector-java-8.0.17.jar ${WSO2_SERVER_HOME}/repository/components/dropins/
  </code></pre>
  <p><strong>Does anybody know what am I missing?</strong></p>
  <p>I already check all jdbc address on toml files.<br>
  wso2am:3.2.0-alpine <br>
  wso2is:5.10.0-alpine <br>
  mysql:5.7.33 <br>
  wso2am-analytics-dashboard:3.2.0-alpine <br>
  wso2am-analytics-worker:3.2.0-alpine</p>