https://kotlinlang.org logo
#komapper
Title
# komapper
d

dave08

10/12/2023, 4:12 PM
@Toshihiro Nakamura I'm getting an error on my servers:
Copy code
│ device-api-5b7c4c9fc-p58pc java.lang.NullPointerException: null cannot be cast to non-null type kotlinx.datetime.LocalDateTime                                                                                       │
│ device-api-5b7c4c9fc-p58pc     at com.....api.model.entitydef._Application.newEntity(_Application.kt:101)                                                                                           │
│ device-api-5b7c4c9fc-p58pc     at com.....api.model.entitydef._Application.newEntity(_Application.kt:7)                                                                                             │
│ device-api-5b7c4c9fc-p58pc     at org.komapper.r2dbc.dsl.runner.R2dbcEntityMapper.execute(R2dbcEntityMapper.kt:23)                                                                                                   │
│ device-api-5b7c4c9fc-p58pc     at org.komapper.r2dbc.dsl.runner.R2dbcRowTransformers$singleEntity$1.invoke(R2dbcRowTransformers.kt:15)                                                                               │
│ device-api-5b7c4c9fc-p58pc     at org.komapper.r2dbc.dsl.runner.R2dbcRowTransformers$singleEntity$1.invoke(R2dbcRowTransformers.kt:13)                                                                               │
│ device-api-5b7c4c9fc-p58pc     at org.komapper.r2dbc.R2dbcExecutor$executeQuery$1$1.invokeSuspend$lambda$2$lambda$0(R2dbcExecutor.kt:43)                                                                             │
│ device-api-5b7c4c9fc-p58pc     at com.github.jasync.r2dbc.mysql.JasyncResult$map$2.invoke(JasyncResult.kt:47)                                                                                                        │
│ device-api-5b7c4c9fc-p58pc     at com.github.jasync.r2dbc.mysql.JasyncResult$map$2.invoke(JasyncResult.kt:47)                                                                                                        │
│ device-api-5b7c4c9fc-p58pc     at com.github.jasync.r2dbc.mysql.JasyncResult.map$lambda$1(JasyncResult.kt:47)
what's funny is that when I looked at the field being assigned, on
_Application.kt:101
, in the db, it's not defined as nullable...
Just before that I get this
[db-sql-netty-thread-2] WARN  c.g.j.sql.db.mysql.MySQLConnection - <mysql-connection-22> onResultSet - called without active query
and before that I get komappers'
TRACE org.komapper.SqlWithArgs
...
t

Toshihiro Nakamura

10/12/2023, 11:03 PM
This error message says that a null was assigned to a non-null field. Can you show me your code? Maybe it Is a Driver issue? https://github.com/jasync-sql/jasync-sql/blob/2.2.4/mysql-async/src/main/java/com/github/jasync/sql/db/mysql/MySQLConnection.kt#L447
4 Views