Python 3 - Format String fun
This post is dedicated for cases where we intend to append a variable value in a…
August 10, 2019
Assuming your web application is using oracle, and you are deploying your app on Jboss wildfly. If you run on fresh download of wildfly or docker image of jboss/wildfly, you will get following error:
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service
.
.
.
10:15:56,901 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "oracle")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.OracleJDBCDriver"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.oracle is missing [jboss.jdbc-driver.OracleJDBCDriver]",
"jboss.driver-demander.java:/oracle is missing [jboss.jdbc-driver.OracleJDBCDriver]"
]
}
10:15:56,903 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "oracle")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => [
"jboss.jdbc-driver.OracleJDBCDriver",
"jboss.jdbc-driver.OracleJDBCDriver"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.oracle is missing [jboss.jdbc-driver.OracleJDBCDriver]",
"jboss.driver-demander.java:/oracle is missing [jboss.jdbc-driver.OracleJDBCDriver]",
"org.wildfly.data-source.oracle is missing [jboss.jdbc-driver.OracleJDBCDriver]"
]
}
Copy ojdbc to directory: $WILDFLY_HOME/modules/system/layers/base/com/oracle/main
<?xml version="1.0" encoding="UTF-8"?>
<module name="com.oracle" xmlns="urn:jboss:module:1.1">
<resources>
<resource-root path="ojdbc7.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
Put following:
<subsystem xmlns="urn:jboss:domain:datasources:5.0">
<datasources>
<datasource jndi-name="java:/oracle-ds" pool-name="oracle-ds" enabled="true">
<connection-url>jdbc:oracle:thin:@HOSTNAME:PORT/DATABASE</connection-url>
<driver>OracleJDBCDriver</driver>
<pool>
<min-pool-size>5</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
<flush-strategy>IdleConnections</flush-strategy>
</pool>
<security>
<user-name>USERNAME</user-name>
<password>PASSWORD</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<background-validation>true</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>
<timeout>
<blocking-timeout-millis>5000</blocking-timeout-millis>
<idle-timeout-minutes>5</idle-timeout-minutes>
</timeout>
</datasource>
<drivers>
<driver name="OracleJDBCDriver" module="com.oracle">
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
If you are using wildfly docker image, you might require following Dockerfile
FROM jboss/wildfly
COPY ojdbc7.jar /opt/jboss/wildfly/modules/system/layers/base/com/oracle/main/
COPY module.xml /opt/jboss/wildfly/modules/system/layers/base/com/oracle/main/
#Copying required scripts and files
COPY standalone.xml /opt/jboss/wildfly/standalone/configuration/
COPY <WEBAPP>.war /opt/jboss/wildfly/standalone/deployments/
Note: In above file, module.xml is file having following content:
<?xml version="1.0" encoding="UTF-8"?>
<module name="com.oracle" xmlns="urn:jboss:module:1.1">
<resources>
<resource-root path="ojdbc7.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
docker run -it -d jboss/wildfly
# get its container id
docker ps
# Copy standaline.xml file to current path
docker cp <container-id>/opt/jboss/wildfly/standalone/configuration/standalone.xml .
Now, we just need to build another image from our Dockerfile
docker build -t MY_IMAGE_NAME .
# To run it,
docker run -it -d MY_IMAGE_NAME
Hope you get your problem resolved.
This post is dedicated for cases where we intend to append a variable value in a…
Introduction In this post, I will show several ways to use conditionals while…
Its good to write unit tests cases, and this part is mostly forgotten by…
This will take backup of your passed database name, to the passed folder. It…
I have a Java project and dependencies are being managed through maven. I have…
Assuming you have a java project and is using Visual Studio Code as IDE. All of…
In this post, we will see some of the frequently used concepts/vocabulary in…
System design interview is pretty common these days, specially if you are having…
Introduction You are given an array of integers with size N, and a number K…
Graph Topological Sorting This is a well known problem in graph world…
Problem Statement Given a Binary tree, print out nodes in level order traversal…
Problem Statement Given an array nums of n integers and an integer target, are…