Comments (6)
Can't guarantee 100% scan on all rounds
Advice: Use injection by class:
@Module
interface FooRepositoryModule {
fun fooRepository(a: AbstractFooRepository): FooRepository = a
}
from kora.
Turned out that checking only requested type for @Repository
annotation is the specific of Kora's Repository extension.
The intended way of solving the problem is adding:
@Module
interface FooRepositoryModule {
fun fooRepository(a: AbstractFooRepository): FooRepository = a
}
from kora.
In 0.13.1 version the above solution doesn't work anymore. But problem still persist.
I get the error:
Required dependency type FooRepository was not found and can't be autocreated.
but now when I try to fix it with module:
@Module
interface FooRepositoryModule {
fun fooRepository(a: AbstractFooRepository): FooRepository = a
}
I get the following error:
More than one component matches dependency claim FooRepository tag=[]:
TargetDependency(claim=DependencyClaim(type=FooRepository, tags=[], claimType=ONE_REQUIRED), component=ResolvedComponent(index=125, declaration=FromExtensionComponent(type=$AbstractFooRepository_Impl ...
TargetDependency(claim=DependencyClaim(type=FooRepository, tags=[], claimType=ONE_REQUIRED), component=ResolvedComponent(index=126, declaration=FromModuleComponent(type=FooRepository, module=MixedInModule(element=Application) ...
The only remaining fix for this issue that I found is manually instantiating $AbstractFooRepository_Impl
:
@Module
interface FooRepositoryModule {
fun fooRepository(/* ... deps ... */): FooRepository = `$AbstractFooRepository_Impl`(/* ... deps ... */)
}
from kora.
Try put @Component
on your repository class.
from kora.
Tried. Got the error:
ApplicationGraph.kt:1655:11: Cannot create an instance of an abstract class
component118 = graphDraw.addNode0(map["component118"],
arrayOf(),
{ AbstractFooRepository(
it.get(holder0.component117)
) },
listOf(),
component117
)
from kora.
Kora version: 0.13.3
Now even my last fix (which btw worked in 0.11.10) to directly instantiate $AbstractFooRepository_Impl
does not work.
The following Module:
@Module
interface FooRepositoryModule {
fun fooRepository(/* ... deps ... */): FooRepository = `$AbstractFooRepository_Impl`(/* ... deps ... */)
}
Makes task :kspKotlin
run forever.
from kora.
Related Issues (20)
- Kora doesn't add abstract @Repository generated implementations to DI container
- Unused ResponseCodeMapper import in openapi generated Kotlin Server
- Broken Abstract @Repository generation in KSP HOT 1
- NPE in KSP when trying to add @Json to data-class property HOT 1
- OpenAPI generator - 400 Bad Request with body "data" if body is null
- Add mode for non-reactive Kotlin Server to OpenAPI Generator
- OpenAPI generator generates kt data classes with errors when using discriminator HOT 4
- Make @JsonDiscriminatorValue repeatable HOT 4
- Escape `?` tokens in SQL in generated JdbcReposiory impl HOT 1
- NoClassDefFoundError: KafkaConsumerMetrics after upgrading to 0.12.0
- JVM metrics are not exposed HOT 1
- Accidental StacklessClosedChannelException when using AsyncHttpClient
- @JsonSkip is not appliable to Kotlin interface property
- @KafkaPublisher support for custom methods
- @KafkaListener headers support
- Kora Examples
- Kora documentation update
- Kora documentation new engine
- @KafkaListener & @KafkaPublisher support for @Json
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 kora.