Dynamic creating of datasource in JBoss EAP 6
Issue
-
Ours is a multi-tenanted payment transaction switch supporting a number of end-user clients. In order to maintain separation of data we are required to create separate (Oracle) database schemas for each end-user clients. Also, in order not to have a down-time when a new end-user client is on-boarded we need to dynamically create datasources. We are doing this programmatically in Java essentially implementing jboss-cli commands. So far all works fine and we can see that new datasource definition is added to
standalone.xmland it is also visible in JBoss Management Console. Our datasource is also assoiciated with a security-domain definition as we require the database password be encrypted.) However, when we try to test database connection from the JBoss Management Console we receive an indication that a reload of configuration (standalone.xml) is required. -
Performing this reload (either via the JBOSS 6 management app, or from the command-line) results in JBOSS becoming unavailable as witnessed by no management app connectivity or, say, the jmx-console being available (note: performing a reload without any datasource/security-domain changes results in exactly the same outcome, i.e. no JBOSS 6 availability). There appears to be something peculiar within the our deployed application test.ear file itself that prevents the reload happening because without the Solve3.ear being present in JBOSS, a reload appears to perform okay and the management app is still available.
-
We have seen below in the logs:
ERROR (Thread-125) Error saving status: java.lang.NullPointerException
at org.jboss.security.plugins.JBossSecuritySubjectFactory.createSubject(JBossSecuritySubjectFactory.java:83) [picketbox-4.1.1.Final-redhat-1.jar:4.1.1.Final-redhat-1]
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getSubject(AbstractConnectionManager.java:735) [ironjacamar-core-impl-1.0.31.Final-redhat-1.jar:1.0.31.Final-redhat-1]
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:509) [ironjacamar-core-impl-1.0.31.Final-redhat-1.jar:1.0.31.Final-redhat-1]
at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:143)
....
15:48:39,659 ERROR (pool-7-thread-4) Failed to run task SyncShedulerTask. Trying to reschedule.: java.lang.NullPointerException
at org.jboss.security.plugins.JBossSecuritySubjectFactory.createSubject(JBossSecuritySubjectFactory.java:83) [picketbox-4.1.1.Final-redhat-1.jar:4.1.1.Final-redhat-1]
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getSubject(AbstractConnectionManager.java:735) [ironjacamar-core-impl-1.0.31.Final-redhat-1.jar:1.0.31.Final-redhat-1]
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:509) [ironjacamar-core-impl-1.0.31.Final-redhat-1.jar:1.0.31.Final-redhat-1]
at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:143)
....
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.4.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
