Comments (3)
at io.vertx.core.impl.future.FutureImpl$2.onFailure(FutureImpl.java:117)
at io.vertx.core.impl.future.FutureImpl$ListenerArray.onFailure(FutureImpl.java:268)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:75)
at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:230)
at io.vertx.core.impl.future.Mapping.onFailure(Mapping.java:45)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:75)
at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:230)
at io.vertx.core.impl.future.PromiseImpl.tryFail(PromiseImpl.java:23)
at io.vertx.sqlclient.impl.QueryResultBuilder.tryFail(QueryResultBuilder.java:116)
at io.vertx.core.Promise.fail(Promise.java:89)
at io.vertx.core.Promise.handle(Promise.java:53)
at io.vertx.core.Promise.handle(Promise.java:29)
at io.vertx.core.impl.future.FutureImpl$3.onFailure(FutureImpl.java:153)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:75)
at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:230)
at io.vertx.core.impl.future.Composition$1.onFailure(Composition.java:66)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:75)
at io.vertx.core.impl.future.FailedFuture.addListener(FailedFuture.java:98)
at io.vertx.core.impl.future.Composition.onFailure(Composition.java:55)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:75)
at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:230)
at io.vertx.core.impl.future.PromiseImpl.tryFail(PromiseImpl.java:23)
at io.vertx.core.impl.future.PromiseImpl.onFailure(PromiseImpl.java:54)
at io.vertx.core.impl.future.PromiseImpl.handle(PromiseImpl.java:43)
at io.vertx.core.impl.future.PromiseImpl.handle(PromiseImpl.java:23)
at io.vertx.core.impl.EventLoopContext.emit(EventLoopContext.java:55)
at io.vertx.core.impl.EventLoopContext.lambda$emit$1(EventLoopContext.java:62)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:566)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
May 09, 2023 11:59:11 PM com.coral.bookstore.service.BookHandler$Companion$buildErrorResponse$1 invoke
SEVERE: buildErrorResponse - Error : io.vertx.core.impl.NoStackTraceThrowable: Pool closed
from vertx-sql-client.
my DB Connection class as following:
`
class DBConnection {
private val logger = Logger.getLogger(DBConnection::class.java.name)
fun pgPool(vertx : Vertx): PgPool {
val context: Context = vertx.orCreateContext
val activeProfile : String = context.config().getString("active_profile", "TEST")
logger.info("DBConnection - active Profile : ".plus(activeProfile))
lateinit var config: JsonObject
lateinit var connectOptions : PgConnectOptions
lateinit var poolOptions : PoolOptions
if (activeProfile.equals("DEV")) {
config = vertx.fileSystem().readFileBlocking("DB_Connection.json").toJsonObject()
connectOptions = PgConnectOptions()
.setPort(config.getInteger("port"))
.setHost(config.getString("host"))
.setDatabase(config.getString("database"))
.setUser(config.getString("user"))
.setPassword(config.getString("password"))
// Pool Options
poolOptions = PoolOptions().setMaxSize(config.getInteger("max_pool_size")).setShared(true)
}else {
connectOptions = PgConnectOptions.fromUri(context.config().getString("db.uri"))
.setUser(context.config().getString("db.username"))
.setPassword(context.config().getString("db.password"))
poolOptions = PoolOptions().setMaxSize(context.config().getInteger("max_pool_size")).setShared(true)
}
// Create the pool from the data object
return PgPool.pool(vertx, connectOptions, poolOptions)
}
}
`
from vertx-sql-client.
my Test class as following :
`
@testcontainers
@ExtendWith(VertxExtension::class)
class MainVerticleIntegrationTest {
private val logger = Logger.getLogger(MainVerticleIntegrationTest::class.java.name)
private val deploymentOptions: DeploymentOptions = DeploymentOptions()
@beforeeach
fun deploy_verticle(vertx: Vertx, testContext: VertxTestContext) {
val dbUri = postgresqlContainer.jdbcUrl.substringAfter("jdbc:")
deploymentOptions.config = jsonObjectOf(
"db.uri" to dbUri,
"db.username" to DB_USERNAME,
"db.password" to DB_PASSWORD,
"max_pool_size" to 5
)
vertx.deployVerticle(MainVerticle(), deploymentOptions, testContext.succeeding { _ -> testContext.completeNow() })
}
@test
fun test() {
assertThat(postgresqlContainer.isRunning).isTrue
}
@test
@DisplayName("test_return_all_books")
fun test_return_all_books(vertx: Vertx, testContext: VertxTestContext) {
var bookInfoToBeMatched = BookInfo(1, "zxc3", "Test 1", 52)
var client: HttpClient = vertx.createHttpClient()
client.request(HttpMethod.GET, 8090, "localhost", "/books")
.compose(HttpClientRequest::send)
.compose(HttpClientResponse::body)
.onSuccess { body ->
testContext.verify {
val bookInfos = toList(body.toJsonArray())
assertThat(bookInfos).anyMatch { it -> checkingBookMatching(it, bookInfoToBeMatched) }
}
testContext.completeNow()
}
.onFailure { failure -> testContext.failNow(failure) };
}
companion object {
private const val DB_NAME = "coral_book_store"
private const val DB_USERNAME = "coral"
private const val DB_PASSWORD = "coral"
@Container
private var postgresqlContainer: PostgreSQLContainer<Nothing> = PostgreSQLContainer<Nothing>("postgres:15")
.apply {
withDatabaseName(DB_NAME)
withUsername(DB_USERNAME)
withPassword(DB_PASSWORD)
}
}
}
`
from vertx-sql-client.
Related Issues (20)
- Support for Oracle collections HOT 14
- Remove Oracle Client from tech preview HOT 1
- Connection error using virtual threads HOT 3
- CascadeTest fails with Hibernate Reactive 2.0 and Vert.x 4.4 HOT 1
- NullPointerException in PgDecoder.decodeError() HOT 1
- PgSubscriberImpl.fetch() not implemented HOT 3
- PgSubscriberImpl silently does not register exception handler HOT 1
- authenticationScheme, integratedSecurity and trustServerCertificate param in sql URI is not effective HOT 1
- NTLM Authentication to connect to SQL Server HOT 11
- Cursor .close() not finishes in case of multiple close attempts
- PGClient not correctly handling SSL MODE ALWAYS HOT 1
- [MySQL] errors during test for graal native-compile project
- Sql Client always disables HostnameVerificationAlgorithm HOT 13
- Call Function with INOUT-Null-Value HOT 2
- MySQLConnectionImpl.resetConnection() does not clear PreparedStatementCache HOT 1
- Event loop blocked inside vertx-pg-client during DNS resolution HOT 12
- Update to SCRAM 3.0 and support channel binding HOT 1
- SQL Server has closed connection unexpectedly if sql request size more then package size and it is chunked (probably only together with ssl) HOT 2
- Memory leak in Aurora Postgres since 3.9.1
- MySQL client does not use providers by default available in FIPS-enabled environment HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vertx-sql-client.