Oracle Database connection in play framework 2.5.10 - playframework-2.5

I am unable to connect the oracle database in play framework.
Steps I followed as below:
configuration of database in application.conf file as below:
default.driver=oracle.jdbc.driver.OracleDriver
default.url="jdbc:oracle:thin:#localhost:1521:XE"
default.username=username
default.password=password
->added ojdbc14.jar in lib folder in the project
while hitting the browser with url http://localhost:9000
I am getting below error:
Cannot connect to database [default]
exception is as below on console:
[error] c.z.h.p.PoolBase - HikariPool-1 - Failed to execute isValid() for connection, configure connection test query. (oracle.jdbc.driver.T4CConnection.isValid(I)Z)
[info] application - Creating Pool for datasource 'default'
[error] c.z.h.p.PoolBase - HikariPool-2 - Failed to execute isValid() for connection, configure connection test query. (oracle.jdbc.driver.T4CConnection.isValid(I)Z)
[error] application -
! #738nhifg4 - Internal server error, for (GET)
play.api.Configuration$$anon$1: Configuration error[Cannot connect to database [default]]
at play.api.Configuration$.configError(Configuration.scala:154)
at play.api.Configuration.reportError(Configuration.scala:806)
at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:48)
at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:42)
at scala.collection.immutable.List.foreach(List.scala:381)
at play.api.db.DefaultDBApi.connect(DefaultDBApi.scala:42)
at play.api.db.DBApiProvider.get$lzycompute(DBModule.scala:72)
at play.api.db.DBApiProvider.get(DBModule.scala:62)
at play.api.db.DBApiProvider.get(DBModule.scala:58)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
Caused by: play.api.Configuration$$anon$1: Configuration error[Failed to initialize pool: oracle.jdbc.driver.T4CConnection.isValid(I)Z]
at play.api.Configuration$.configError(Configuration.scala:154)
at play.api.PlayConfig.reportError(Configuration.scala:996)
at play.api.db.HikariCPConnectionPool.create(HikariCPModule.scala:70)
at play.api.db.PooledDatabase.createDataSource(Databases.scala:199)
at play.api.db.DefaultDatabase.dataSource$lzycompute(Databases.scala:123)
at play.api.db.DefaultDatabase.dataSource(Databases.scala:121)
at play.api.db.DefaultDatabase.getConnection(Databases.scala:142)
at play.api.db.DefaultDatabase.getConnection(Databases.scala:138)
at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:44)
at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:42)
Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: oracle.jdbc.driver.T4CConnection.isValid(I)Z
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:512)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:105)
at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:71)
at play.api.db.HikariCPConnectionPool$$anonfun$1.apply(HikariCPModule.scala:58)
at play.api.db.HikariCPConnectionPool$$anonfun$1.apply(HikariCPModule.scala:54)
at scala.util.Try$.apply(Try.scala:192)
at play.api.db.HikariCPConnectionPool.create(HikariCPModule.scala:54)
at play.api.db.PooledDatabase.createDataSource(Databases.scala:199)
at play.api.db.DefaultDatabase.dataSource$lzycompute(Databases.scala:123)
at play.api.db.DefaultDatabase.dataSource(Databases.scala:121)
Caused by: java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.isValid(I)Z
at com.zaxxer.hikari.pool.PoolBase.checkDriverSupport(PoolBase.java:400)
at com.zaxxer.hikari.pool.PoolBase.setupConnection(PoolBase.java:375)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:346)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:506)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:105)
at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:71)
at play.api.db.HikariCPConnectionPool$$anonfun$1.apply(HikariCPModule.scala:58)
at play.api.db.HikariCPConnectionPool$$anonfun$1.appl`enter code here`y(HikariCPModule.scala:54)
at scala.util.Try$.apply(Try.scala:192)
at play.api.db.HikariCPConnectionPool.create(HikariCPModule.scala:54)
any advice will be appreciated.

Essentially, the problem is Oracle connectivity with ojdbc14.jar is not supported by Play Framework.
I tried with ojdbc6 for Oracle 11g and it worked.

Related

How to ignore mongo when start application

A legacy Spring boot project, before it used mongo, but now it does not need. Now start this project it has this error
2022-10-27 14:10:13.119 [cluster-ClusterId{value='635a20bb714f8f71e2e5d041', description='null'}-10.48.51.21:40010] [INFO] [org.mongodb.driver.cluster] - Exception in monitor thread while connecting to server 10.48.51.21:40010
com.mongodb.MongoSocketOpenException: Exception opening socket
at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:70)
at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:127)
at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.net.SocketTimeoutException: connect timed out
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
then I exclude related Auto Configuration class
#SpringBootApplication(exclude={MongoAutoConfiguration.class, MongoRepositoriesAutoConfiguration.class,MongoDataAutoConfiguration.class})
but this time project start failed
***************************
APPLICATION FAILED TO START
***************************
Description:
Field mongoTemplate in com.bxt.bmht_support.dao.BmhtMideTableDao required a bean of type 'org.springframework.data.mongodb.core.MongoTemplate' that could not be found.
How to disable mongo without update current code? just want ignore it.

Flyway quarkus extension get "java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus" when executing test

When execute mvnw test in my project using Flyway quarkus extension with version 1.13.2_Final, it produces the following error:
java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
Caused by: java.lang.RuntimeException: Failed to start quarkus
Caused by: org.flywaydb.core.internal.exception.FlywaySqlException:
Unable to obtain connection from database: Error General : "java.lang.NullPointerException"
General error: "java.lang.NullPointerException" [50000-197]
-------------------------------------------------------------------------------------------------------------------------------------------------------
SQL State : HY000
Error Code : 50000
Message : Error General : "java.lang.NullPointerException"
General error: "java.lang.NullPointerException" [50000-197]
Caused by: org.h2.jdbc.JdbcSQLException:
Error General : "java.lang.NullPointerException"
General error: "java.lang.NullPointerException" [50000-197]
Caused by: java.lang.NullPointerException
I have the following configuration for datasource and flyware en test profile.
"%test":
quarkus:
datasource:
db-kind: h2
jdbc:
credentials-provider: my-bbdd-credentials-provider
driver: org.h2.Driver
url: jdbc:h2:tcp://localhost/mem:test;MODE=Oracle
max-size: 13
flyway:
locations: db/migration-test
schemas: PUBLIC
baseline-on-migrate: true
migrate-at-start: true
I think Quarkus flyway extension isn't using the class that implements credential-provider. This class decrypts the user's password from other property. This class works well when using credential-provider with agroal and hibernate-orm-panache extensions.
Can someone help me with this problem?
Thanks

Connection of NEO4J TO Oracle Database

I am trying to run ๐Ÿ‘
call apoc.load.driver('oracle.jdbc.driver.OracleDriver');
in neo4j to load oracle driver but i am getting below error
Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke
procedure apoc.load.driver: Caused by: java.lang.RuntimeException:
Could not load driver class oracle.jdbc.driver.OracleDriver
oracle.jdbc.driver.OracleDriver
I have placed the jdbc and apoc in plugins and i am able to apoc.load.driver procedure on command prompt .
Please help me with the issue

Jenkins Deploy Plugin to Wildfly 8.x resulting in Connection Time Out

I am trying to deploy a WAR file on CentOS 7 from Jenkins to Wildfly 8.2.0 Final using version 1.11-SNAPSHOT (I built it from the fork) of the Deploy Plugin (version 1.10 does not have support for Wildfly and has issues if you select JBoss AS 7.x).
Both Jenkins and Wildfly are on the same box and I have opened all the necessary ports.
I am running into the following issue:
Caused by: java.net.ConnectException: JBAS012144: Could not connect to remote://192.28.26.200:9990. The connection timed out
Full stack trace:
Building in workspace /root/.jenkins/workspace/DeployJob
Unable to access upstream artifacts area /root/.jenkins/jobs/BuildJob/builds/50/archive. Does source project archive artifacts?
Copied 2 artifacts from "BuildJob ยป Sample Maven Webapp" build number 50
Deploying /root/.jenkins/workspace/DeployJob/com.sample/Sample/0.0.1-SNAPSHOT/Sample-0.0.1-SNAPSHOT.war under context path somecontext to WildFly 8.x Remote
The undeployment phase of the redeploy action has failed: org.codehaus.cargo.util.CargoException: Cannot undeploy deployable org.codehaus.cargo.container.deployable.WAR[Sample-0.0.1-SNAPSHOT.war]
ERROR: Build step failed with exception
org.codehaus.cargo.util.CargoException: Cannot deploy deployable org.codehaus.cargo.container.deployable.WAR[Sample-0.0.1-SNAPSHOT.war]
at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.deploy(JBoss5xRemoteDeployer.java:216)
at org.codehaus.cargo.container.spi.deployer.AbstractDeployer.redeploy(AbstractDeployer.java:234)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:76)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:128)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:107)
at hudson.FilePath.act(FilePath.java:989)
at hudson.FilePath.act(FilePath.java:967)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:107)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:50)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
at hudson.model.Run.execute(Run.java:1776)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Caused by: java.lang.RuntimeException: java.net.ConnectException: JBAS012144: Could not connect to remote://192.28.26.200:9990. The connection timed out
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeAsync(AbstractModelControllerClient.java:103)
at org.jboss.as.controller.client.helpers.standalone.impl.ModelControllerClientServerDeploymentManager.executeOperation(ModelControllerClientServerDeploymentManager.java:51)
at org.jboss.as.controller.client.helpers.standalone.impl.AbstractServerDeploymentManager.execute(AbstractServerDeploymentManager.java:79)
at org.codehaus.cargo.tools.jboss.JBossDeployer.executeAction(JBossDeployer.java:145)
at org.codehaus.cargo.tools.jboss.JBossDeployer.deploy(JBossDeployer.java:85)
at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.deploy(JBoss5xRemoteDeployer.java:212)
... 17 more
Caused by: java.net.ConnectException: JBAS012144: Could not connect to remote://192.28.26.200:9990. The connection timed out
at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:130)
at org.jboss.as.protocol.ProtocolConnectionManager$EstablishingConnection.connect(ProtocolConnectionManager.java:256)
at org.jboss.as.protocol.ProtocolConnectionManager.connect(ProtocolConnectionManager.java:70)
at org.jboss.as.protocol.mgmt.FutureManagementChannel$Establishing.getChannel(FutureManagementChannel.java:176)
at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getOrCreateChannel(RemotingModelControllerClient.java:144)
at org.jboss.as.controller.client.impl.RemotingModelControllerClient$1.getChannel(RemotingModelControllerClient.java:65)
at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:115)
at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:98)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:236)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:141)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeAsync(AbstractModelControllerClient.java:101)
... 22 more
java.lang.RuntimeException: java.net.ConnectException: JBAS012144: Could not connect to remote://192.28.26.200:9990. The connection timed out
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeAsync(AbstractModelControllerClient.java:103)
at org.jboss.as.controller.client.helpers.standalone.impl.ModelControllerClientServerDeploymentManager.executeOperation(ModelControllerClientServerDeploymentManager.java:51)
at org.jboss.as.controller.client.helpers.standalone.impl.AbstractServerDeploymentManager.execute(AbstractServerDeploymentManager.java:79)
at org.codehaus.cargo.tools.jboss.JBossDeployer.executeAction(JBossDeployer.java:145)
at org.codehaus.cargo.tools.jboss.JBossDeployer.deploy(JBossDeployer.java:85)
at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.deploy(JBoss5xRemoteDeployer.java:212)
at org.codehaus.cargo.container.spi.deployer.AbstractDeployer.redeploy(AbstractDeployer.java:234)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:76)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:128)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:107)
at hudson.FilePath.act(FilePath.java:989)
at hudson.FilePath.act(FilePath.java:967)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:107)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:50)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
at hudson.model.Run.execute(Run.java:1776)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Caused by: java.net.ConnectException: JBAS012144: Could not connect to remote://192.28.26.200:9990. The connection timed out
at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:130)
at org.jboss.as.protocol.ProtocolConnectionManager$EstablishingConnection.connect(ProtocolConnectionManager.java:256)
at org.jboss.as.protocol.ProtocolConnectionManager.connect(ProtocolConnectionManager.java:70)
at org.jboss.as.protocol.mgmt.FutureManagementChannel$Establishing.getChannel(FutureManagementChannel.java:176)
at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getOrCreateChannel(RemotingModelControllerClient.java:144)
at org.jboss.as.controller.client.impl.RemotingModelControllerClient$1.getChannel(RemotingModelControllerClient.java:65)
at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:115)
at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:98)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:236)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:141)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeAsync(AbstractModelControllerClient.java:101)
... 22 more
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE
Anyone has any idea what could be going on in here? I tried to telnet the IP and port and it worked.

Sonar-runner on remote machine not picking up correct jbdc connection?

I have sonarqube 3.5.1, and sonar-runner 2.2.1 on a RHEL6.2 server, sonar-runner works fine against the sample data I've downloaded.
However, I've deployed sonar-runner to a windows client, and its failing to connect to the H2 database.
INFO: Sonar Server 3.5.1
11:58:19.960 INFO - Load batch settings
11:58:20.116 INFO - User cache: C:\Users\e01942082\.sonar\cache
11:58:20.132 INFO - Install plugins
11:58:21.739 INFO - ------------- Executing Project Scan
11:58:22.113 INFO - Install JDBC driver
11:58:22.129 INFO - Apply project exclusions
11:58:22.129 WARN - H2 database should be used for evaluation purpose only
11:58:22.129 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 8.393s
Final Memory: 2M/15M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Fail to connect to database
ERROR: Caused by: Cannot create PoolableConnectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-167])
ERROR: Caused by: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-167]
ERROR: Caused by: Connection refused: connect
So, I've updated the sonar-properties in sonarqube
# Comment the following line to deactivate the default embedded database.
sonar.jdbc.url: jdbc:h2:tcp://gbrpsr000000711.xxxxxxxxx.xxxxxxxxxxx.com:9092/sonar
sonar.jdbc.driverClassName: org.h2.Driver
and sonar-runner conencts to the server with the
sonar.host.url=http://gbrpsr000000711.xxxxxxx.xxxxxxxx.com:9000/sonar
its not clear why its picking up the localhost rather than the full url of the server. Am I missing somehting/ or has this been embedded when I started the service prior to making the config changes????
thanks for you assistance
dD

Resources