I am new in JBoss and I try to add a jdbc driver for derby as a module in WidlFly 8.2.0.
What I did:
I added the org/apache/derby/main folder in the JBOSS_HOME/modules/system/layers/base directory
In this new folder, I added derbyclient.jar (from jdk 1.8.0_40, it contains the driver) and a new module.xml file.
The module.xml file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.apache.derby">
<resources>
<resource-root path="derbyclient.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
Then, I updated the standalone.xml file as follows:
addition of this tag (in <extensions>): <extension module="org.apache.derby"/>
Declaration of my datasource and of the driver:
<datasource jndi-name="java:/DerbyDS" pool-name="DerbyDS" enabled="true" use-ccm="false">
<connection-url>jdbc:derby:MyDB;create=true</connection-url>
<driver>org.apache.derby</driver>
<security>
<user-name>demo</user-name>
<password>demo</password>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
<statement>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="org.apache.derby" module="org.apache.derby">
<xa-datasource-class>org.apache.derby.jdbc.ClientXADataSource</xa-datasource-class>
</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
I am getting the following error when I start WildFly:
`16:19:49,856 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "DerbyDS")
]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => [
"jboss.data-source.java:/DerbyDS is missing [jboss.jdbc-driver.org_apache_derby]",
"jboss.driver-demander.java:/DerbyDS is missing [jboss.jdbc-driver.org_apache_derby]"
]}
16:19:49,866 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "DerbyDS")
]) - failure description: {
"JBAS014771: Services with missing/unavailable dependencies" => [
"jboss.data-source.java:/DerbyDS is missing [jboss.jdbc-driver.org_apache_derby]",
"jboss.driver-demander.java:/DerbyDS is missing [jboss.jdbc-driver.org_apache_derby]"
],
"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {
"Services that were unable to start:" => [
"jboss.data-source.reference-factory.DerbyDS",
"jboss.naming.context.java.DerbyDS"
],
"Services that may be the cause:" => ["jboss.jdbc-driver.org_apache_derby"]
}
}
16:19:49,897 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "MyApp.ear" (runtime-name : "MyApp.ear")
16:19:49,897 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "MyApp2.ear" (runtime-name : "MyApp2.ear")
16:19:49,907 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.org_apache_derby (missing) dependents: [service jboss.driver-demander.java:/DerbyDS, service jboss.data-source.java:/DerbyDS]`
Do you know what I did wrong?
Thanks in advance
I finally solved the issue by:
adding derbyclient.jar in the standalone directory (where my applications are deployed)
modifying the datasource declaration in the standalone.xml to make it reference the jar name :
<datasource jndi-name="java:/DerbyDS" pool-name="DerbyDS"enabled="true" use-ccm="false"> <connection-url>jdbc:derby:MyDB;create=true</connection-url> <driver>derbyclient.jar</driver>...
(I deleted the <drivers> tag, I don't use it anymore.)
So, I don't have errors anymore when I start WildFly. The derby driver is not declared as a module, but it will be shared among my different applications, so that's ok.
Your URL jdbc:derby://:MyDB looks invalid.
Related
Hoping some one can point me in the right direction.
Trying to get away from hardcoded passwd for postgres in the config file for keycloak 19. I dont want to make changes code nor write a custom class based on sdk aws provides, if possible ; keycloak 19.x and using legacy/wildfly
what is needed here in the code below
jdbc-secretsmanager:postgresql://somename.rds.amazonaws.com:5432/keycloak?ssl=true;sslfactory=org.postgresql.ssl.NonValidatingFactory
<driver>awspostgresql</driver>
<pool>
<max-pool-size>20</max-pool-size>
</pool>
<security>
<user-name>_aws_secret_name</user-name>
</security>
</datasource>
<drivers>
<driver name="awspostgresql" module="com.amazonaws">
<driver-class>com.amazonaws.secretsmanager.sql.AWSSecretsManagerPostgreSQLDriver</driver-class>
</driver>
</drivers>
</datasources>
===
After satisfying all dependencies/jars, it throws error
===
Jakarta Enterprise Beans subsystem suspension complete
,522 WARN [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 32) WFLYJCA0003: Unable to instantiate driver class "com.amazonaws.secretsmanager.sql.AWSSecretsManagerPostgreSQLDriver": java.lang.IllegalStateException: Could not load real driver with name, "org.postgresql.Driver".
followed by
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.postgresql"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.KeycloakDS is missing [jboss.jdbc-driver.postgresql]",
"jboss.driver-demander.java:jboss/datasources/KeycloakDS is missing [jboss.jdbc-driver.postgresql]"
==== ]
What or how is this supposed to be configured? Appreciate any pointers. Thanks
I am trying to add a mysql datasource to my wildfly 26 server and when I deploy it I encounter the following error:
I saved a copy of my standalone and tried to redo it, since I've heard the xml can be quite tricky, however that didn't change anything. Also looked for blankspaces in the beginning of each xml document as per another stackoverflow post - but no bueno.
13:07:14,521 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "ISProjectEAR.ear")]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.datasources.jdbc.dsLabs"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.persistenceunit.\"ISProjectEAR.ear/ISEJBProject.jar#LabEJBSql\" is missing [jboss.naming.context.java.jboss.datasources.jdbc.dsLabs]",
"jboss.persistenceunit.\"ISProjectEAR.ear/ISEJBProject.jar#LabEJBSql\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jboss.datasources.jdbc.dsLabs]"
]
}
13:07:14,675 INFO [org.jboss.as.server] (ServerService Thread Pool -- 45) WFLYSRV0010: Deployed "ISProjectEAR.ear" (runtime-name : "ISProjectEAR.ear")
13:07:14,727 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.naming.context.java.jboss.datasources.jdbc.dsLabs (missing) dependents: [service jboss.persistenceunit."ISProjectEAR.ear/ISEJBProject.jar#LabEJBSql", service jboss.persistenceunit."ISProjectEAR.ear/ISEJBProject.jar#LabEJBSql".__FIRST_PHASE__]
WFLYCTL0448: 33 additional services are down due to their dependencies being missing or failed
13:07:14,864 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
13:07:14,873 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 26.0.0.Final (WildFly Core 18.0.0.Final) started (with errors) in 16170ms - Started 607 of 832 services (43 services failed or missing dependencies, 347 services are lazy, passive or on-demand)
13:07:14,878 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
13:07:14,879 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
Here's my module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="com.microsoft.sqlserver.jdbc">
<resources>
<resource-root path="sqljdbc4.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
</dependencies>
</module>
This is the datasource from my standalone.xml
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<datasource jta="true" jndi-name="java:jboss/datasources/jdbc/dsLabs" pool-name="MysqlDS" enabled="true" use-ccm="false" statistics-enabled="true">
<connection-url>jdbc:sqlserver://localhost:1433; databaseName=T4Lab;</connection-url>
<driver>sqljdbc4</driver>
<security>
<user-name>Din anvandare</user-name>
<password>Ditt password</password>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
<background-validation-millis>1</background-validation-millis>
</validation>
<statement>
<prepared-statement-cache-size>0</prepared-statement-cache-size>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="sqljdbc4" module="com.microsoft.sqlserver.jdbc">
<xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
Here's the persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="LabEJBSql">
<jta-data-source>java:jboss/datasources/jdbc/dsLabs</jta-data-source>
<non-jta-data-source>java:jboss/datasources/jdbc/dsLabs</non-jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"></property>
<property name="hibernate.hbm2ddl.auto" value="update"/>
</properties>
</persistence-unit>
</persistence>
How to configure MongoDB DataSource JNDI in JBoss Server.
I downloaded MongoDB jar (mongo-java-driver-3.4.2.jar) and deployed using admin console, it got successfully deployed but when I went to add Datasource in customize option I am not able to see MongoDB driver, the only one option available was h2. Why so? Do I have to do any other configuration change or am I missing any step?
I Even tried to manually create the MongoDB driver and datasource but that is also not working.
I placed module.xml and mongo-java-driver- 3.4.2.jar to the following path
..\devstudio\runtimes\jboss-eap\modules\system\layers\base\org\mongodb\main
--------- module.xml ---------------------
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.mongodb">
<resources>
<resource-root path="mongo-java-driver-3.4.2.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
--------------standalone.xml ------------
<datasource jndi-name="java:jboss/datasources/mongodb" pool-name="mongodb"
enabled="true" use-java-context="true">
<connection-url>jdbc:mongodb://127.0.0.1:27017/example;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>mongodb</driver>
</datasource>
<driver name="mongodb" module="org.mongodb">
<xa-datasource-class>mongodb.jdbc.MongoXADataSource</xa-datasource-class>
</driver>
I was getting the following error when i started the server
("subsystem" => "datasources"),
("data-source" => "mongodb")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable
dependencies" => [
"org.wildfly.data-source.mongodb is missing [jboss.jdbc-driver.mongodb]",
"jboss.driver-demander.java:jboss/datasources/mongodb is missing
[jboss.jdbc-driver.mongodb]"
]}
23:51:44,277 ERROR [org.jboss.as.controller.management-operation]
(Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "mongodb")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable
dependencies" => [
"org.wildfly.data-source.mongodb is missing [jboss.jdbc-driver.mongodb]",
"jboss.driver-demander.java:jboss/datasources/mongodb is missing
[jboss.jdbc-driver.mongodb]",
"org.wildfly.data-source.mongodb is missing [jboss.jdbc-driver.mongodb]"
]}
Could you let me know how to do JNDI Datasource configuration in JBoss Server ?? Please explain in detail as I am new for JNDI Configuration
Refer https://www.progress.com/blogs/configure-connect-for-jdbc-mongodb-driver-with-jboss-eap-64enter link description here
I'm trying to migrate from Glassfish to WildFly 10, my app connects whit Sybase ASE database. I put jconn3.jar in WILDFLY_HOME\modules\system\layers\base\com\sybase\sybase\main, created modules.xml with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.sybase.sybase">
<resources>
<resource-root path="jconn3.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
and inserted to the standalone.xml:
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<datasource jndi-name="java:jboss/datasources/FRAME_IBS" pool-name="FRAME_IBS" enabled="true" use-java-context="true">
<connection-url>jdbc:sybase:Tds:localhost:5000/Banksys;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>sybase</driver>
<pool>
<min-pool-size>5</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
</pool>
<driver-class>
com.sybase.jdbc3.jdbc.SybDriver
</driver-class>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="sybase" module="com.sybase.sybase">
<datasource-class>com.sybase.jdbc3.jdbc.SybDataSource</datasource-class>
<xa-datasource-class>com.sybase.jdbc3.jdbc.SybXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
I got this error in server.log file when I started WF:
2017-02-17 12:48:56,297 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "FRAME_IBS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.sybase"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.driver-demander.java:jboss/datasources/FRAME_IBS is missing [jboss.jdbc-driver.sybase]",
"org.wildfly.data-source.FRAME_IBS is missing [jboss.jdbc-driver.sybase]"
]
}
2017-02-17 12:48:56,297 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "FRAME_IBS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => [
"jboss.jdbc-driver.sybase",
"jboss.jdbc-driver.sybase"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.driver-demander.java:jboss/datasources/FRAME_IBS is missing [jboss.jdbc-driver.sybase]",
"org.wildfly.data-source.FRAME_IBS is missing [jboss.jdbc-driver.sybase]",
"org.wildfly.data-source.FRAME_IBS is missing [jboss.jdbc-driver.sybase]"
]
}
2017-02-17 12:48:56,453 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.sybase (missing) dependents: [service org.wildfly.data-source.FRAME_IBS, service jboss.driver-demander.java:jboss/datasources/FRAME_IBS]
I googled it and tried all that I found but still have this error. Please, help me.
Excuse if my english it´s not correct, it's not my native language.
I rename module and move it to WILDFLY_HOME\modules following Leozeo and Mark recommendations, and still have the same message. I remove my datasource from standalone.xml, run WF again, and I se this message:
ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 33) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "sybase")
File module.xml and .jar are both present now in WILDFLY_HOME\modules
Make sure you have driver installed properly. Check for driver jar and modules.xml file is present at under WILDFLY_HOME\modules\system\layers\base\com\sybase\main directory.
update value of name attribute
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.sybase">
<resources>
<resource-root path="jconn3.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
I need to create an oracle data source in JBOSS EAP 7.0 server
I deployed ojdbc6.jar from the JBOSS management CLI(Command Line Interface) using the below command
deploy <PATH_TO_ORACLE_DRIVER_JAR>
I could see the server log as below after the driver is deployed
01:25:53,338 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = ojdbc6.jar
01:25:53,747 INFO [org.jboss.as.server] (management-handler-thread - 6) WFLYSRV0010: Deployed "ojdbc6.jar" (runtime-name : "ojdbc6.jar")
But when I try to create oracle data source(oracle.jdbc.driver.OracleDriver as driver class) from Jboss management console, I get the below error
01:31:35,084 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 66) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "OracleDS")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.driver-demander.java:/OracleDS is missing [jboss.jdbc-driver.oracle]",
"org.wildfly.data-source.OracleDS is missing [jboss.jdbc-driver.oracle]"
]}
01:31:35,092 INFO [org.jboss.as.controller] (ServerService Thread Pool -- 66) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.data-source.reference-factory.OracleDS (missing) dependents: [service jboss.naming.context.java.OracleDS]
service jboss.data-source-config.OracleDS (missing) dependents: [service org.wildfly.data-source.OracleDS]
service jboss.jdbc-driver.oracle (missing) dependents: [service jboss.driver-demander.java:/OracleDS, service org.wildfly.data-source.OracleDS]
1) May I know what is causing this issue? What dependency is missing?
2) Is installing JDBC driver as a JAR deployment for data source creation correct method?
Install a JDBC Driver as a Core Module
Create a directory under $JBOSS_HOME/modules. In this example: "$JBOSS_HOME/modules/com/oracle/jdbc/main".
Put the the JDBC driver jar (ojdbc6.jar) in this directory.
Create a module configuration file module.xml:
Example Oracle JDBC Driver module.xml File
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.1" name="com.oracle">
<resources>
<resource-root path="ojdbc6.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
Example Oracle Datasource Configuration
<datasources>
<datasource jndi-name="java:jboss/OracleDS" pool-name="OracleDS">
<connection-url>jdbc:oracle:thin:#localhost:1521:XE</connection-url>
<driver>oracle</driver>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"/>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
</validation>
</datasource>
<drivers>
<driver name="oracle" module="com.oracle">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
Example Management CLI Commands
This example configuration can be achieved by using the following management CLI commands.
1# Add the Oracle JDBC driver as a core module.
module add --name=com.oracle --resources=/path/to/misc/jdbc_drivers/oracle/ojdbc7.jar --dependencies=javax.api,javax.transaction.api
2#Register the Oracle JDBC driver.
/subsystem=datasources/jdbc-driver=oracle:add(driver-name=oracle,driver-module-name=com.oracle,driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource)
3#Add the Oracle datasource.
data-source add --name=OracleDS --jndi-name=java:jboss/OracleDS --driver-name=oracle --connection-url=jdbc:oracle:thin:#localhost:1521:XE --user-name=admin --password=admin --validate-on-match=true --background-validation=false --valid-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker --exception-sorter-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter --stale-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker
Refer the link https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/version-7.0/configuration-guide/#datasource_management