Replies: 5 comments 11 replies
-
I had the same problem. Did you solve it? |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
@mschorsch thank, but another error occurred... build.gradle.kts implementation("org.ktorm:ktorm-core:${ktOrmVersion}")
implementation("io.quarkus:quarkus-agroal")
implementation("io.quarkus:quarkus-jdbc-mysql") KtOrmConfigurationclass KtOrmConfiguration {
@Inject
lateinit var defaultDataSource: AgroalDataSource
@Singleton
fun database(): Database {
return Database.connect(defaultDataSource)
}
} User.ktenum class Status {
NORMAL,
SUSPEND;
}
interface User: BaseEntity<User> {
companion object : Entity.Factory<User>()
var name: String
var status: Status
}
object Users: BaseTable<User>("user") {
val name = varchar("name").bindTo { it.name }
val status = enum<Status>("status").bindTo { it.status }
} application.propertiesquarkus.datasource.jdbc.url=jdbc:mysql://127.0.0.1:3306/demo
quarkus.datasource.username=root
quarkus.datasource.password=root it work on dev, but build native image failure build log
when i remove enum like this, it can be work and build native image success User.ktinterface User: BaseEntity<User> {
companion object : Entity.Factory<User>()
var name: String
}
object Users: BaseTable<User>("user") {
val name = varchar("name").bindTo { it.name }
} hi mschorsch , do you have any suggestions? |
Beta Was this translation helpful? Give feedback.
-
I use dbcp2 run successfully in native image pom.xml<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.9.0</version>
</dependency> application.ymlquarkus:
native:
additional-build-args:
- --initialize-at-run-time=org.apache.commons.dbcp2.ObjectNameWrapper,org.apache.commons.dbcp2.PoolableConnection Hope it helps you |
Beta Was this translation helpful? Give feedback.
-
it can be work, but interface maybe not support? enum class Status {
NORMAL, SUSPEND;
companion object {
fun of(name: String): Status {
return values().first { it.name == name }
}
}
}
interface User : Entity<User> {
companion object : Entity.Factory<User>()
var id: Int
var name: String
var status: Status
}
object Users : Table<User>("user") {
val id = int("id").bindTo { it.id }
val name = varchar("name").bindTo { it.name }
val status = varchar("status").transform({ Status.of(it) }, { it.name }).bindTo { it.status }
// val status = enum<Status>("status").bindTo { it.status }
} build and run native mode success, but some error Request failed: com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface com.example.demo.entity.User] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles=<comma-separated-config-files> and -H:DynamicProxyConfigurationResources=<comma-separated-config-resources> options. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
KtOrmConfiguration
Dockerfile.multistage
Build error log
Beta Was this translation helpful? Give feedback.
All reactions