Comments (9)
do you know of any modular jars out there that contain static resources that we could use in this test? Currently Micronaut doesn't support the module system, but maybe with the change you propose it could be possible I guess.
I'll prepare one just for testing. Notice in the exception that io.micronaut.context.event.ApplicationEventPublisher cannot be found when micronaut-inject-x.y.z.jar is on the modulepath instead of on the classpath. It is not a third-party jar issue, just the specs of modulepath that's causing an issue.
from micronaut-core.
@rfscholte I did some experiments in this area a few months ago, they may be useful to you. I would be happy to help on this as we have been wanting to use jlink
and Micronaut together too.
Edit: Ah, I see you are a Java champion and work on Maven. You probably don't need my help. But I would still be happy to test or assist any way I can 😄
from micronaut-core.
do you know of any modular jars out there that contain static resources that we could use in this test? Currently Micronaut doesn't support the module system, but maybe with the change you propose it could be possible I guess.
from micronaut-core.
A bit of background: One of the requirements of the application I'm building is that is has to be built with jlink.
It should also use a DI-container, but currently there's no modularized implementation available, so I patch them a bit. Guice +Sisu seems okay, but has quite some third party dependencies that are not modularized yet. Micronaut looks like a better option if a few issues are solved (including this one).
One of the things I'm wondering: why did you choose for a services-directory with empty files where the name is the implementation?
sisu guice works, because is has the file META-INF/sisu/javax.inject.Named containing all the named classes. (and you probably also notice another issue here: as I'm writing a new application, I'd like to start with the jakarta namespaced classes).
Can we work on a similiar approach here?
from micronaut-core.
we used to have META-INF/services
definition that contained a single file with all of the classes, but the issue with this approach is it needs a full recompile of all classes that participated in its creation each time any of them change which is not great for incremental compilation performance.
We had a project that has over a million lines of code and was taking a significant amount of time to compile, we switched the implementation to a directory with a list of files that represent the class names and with this solution you have a 1-to-1 relationship between annotated class and generated file so we could effectively compile incrementally and significantly improve compiler performance.
from micronaut-core.
for reference #7195
from micronaut-core.
This only seems to be an issue when using jlink.
logger.error("{}", Application.class.getClassLoader().getResource("META-INF/micronaut/io.micronaut.inject.BeanDefinitionReference") != null );
logger.error("{}", Application.class.getClassLoader().getResource("META-INF/micronaut/io.micronaut.inject.BeanDefinitionReference/io.micronaut.context.event.ApplicationEventPublisherFactory") != null );
[main] ERROR micronaut.Application - false
[main] ERROR micronaut.Application - true
The steps to reproduce it using modulelayers are incorrect, which makes it even harder to verify this.
I guess the approach with the least impact here is to whitelist paths like META-INF/micronaut/io.micronaut.inject.BeanDefinitionReference
; don't verify if it exists. WDYT?
from micronaut-core.
This only seems to be an issue when using jlink.
logger.error("{}", Application.class.getClassLoader().getResource("META-INF/micronaut/io.micronaut.inject.BeanDefinitionReference") != null ); logger.error("{}", Application.class.getClassLoader().getResource("META-INF/micronaut/io.micronaut.inject.BeanDefinitionReference/io.micronaut.context.event.ApplicationEventPublisherFactory") != null ); [main] ERROR micronaut.Application - false [main] ERROR micronaut.Application - true
The steps to reproduce it using modulelayers are incorrect, which makes it even harder to verify this.
I guess the approach with the least impact here is to whitelist paths like
META-INF/micronaut/io.micronaut.inject.BeanDefinitionReference
; don't verify if it exists. WDYT?
Seems reasonable to me
from micronaut-core.
Just received confirmation from Alan Bateman that this is indeed the expected behavior: https://mail.openjdk.org/pipermail/jigsaw-dev/2024-June/015042.html
from micronaut-core.
Related Issues (20)
- Graal annotation processor doesn't mark package-private injected fields for reflective access HOT 1
- Multiple client filters in Micronaut HOT 8
- Connection closed before response was received on concurrent requests HOT 1
- Micronaut v4.3.1 causing stackoverflow exception on java compilation HOT 3
- @RequestScope cannot be used with HTTP client blocking requests HOT 7
- Instantiation methods in introspection of abstract class tries to instantiate the abstract class
- NoSuchMethodError/KSP generated bean definition constructor missing parameters for class with AOP advice HOT 2
- While upgrading to micronuat 4.4 from 3.8 HTTPResponse Body content is in unpooledContent and body is null HOT 12
- Rendering issue in docs HOT 1
- Injection of map of beans does not work if some of the services are injected by implementation type HOT 1
- Micronaut Management stopped working after migration to Micronaut 4.5.3 HOT 5
- Micronaut 3 to 4 migration issue: request.getHaaders.getFirst (key, type.class) can no longer convert HOT 1
- CompletableFuture endpoint with a redirect response returns a 200
- Micronaut 4 throws 404 error for an endpoint having special characters in path parameter HOT 1
- SslContext with Micronaut HttpClient HOT 2
- Support inject a list of values in expression language
- ClassCastException: class io.netty.handler.codec.http.LastHttpContent$1 cannot be cast to class io.netty.handler.codec.http.HttpRequest HOT 10
- @JsonFormat not working for @Emeddable class HOT 3
- Micronaut 4.5 silently ignores classpath issues and doesn't register the beans
- Threading model for HTTP Client and Java 21+ HOT 4
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 micronaut-core.