Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the unnamed module reads package io.micronaut.inject.annotation from both io.micronaut.core_processor and io.micronaut.inject #10299

Open
jbescos opened this issue Dec 22, 2023 · 15 comments

Comments

@jbescos
Copy link

jbescos commented Dec 22, 2023

Expected Behavior

The modules io.micronaut.core_processor and io.micronaut.inject contains the same package io.micronaut.inject.annotation.

I guess the correct fix is that either there should not be in module-path both modules, or they should have different package names. For example in io.micronaut.core_processor the package could be io.micronaut.core_processor.annotation

Actual Behaviour

When both modules are in module-path, there is the next error:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] error: the unnamed module reads package io.micronaut.inject.annotation from both io.micronaut.core_processor and io.micronaut.inject
[ERROR] error: module io.micronaut.core reads package io.micronaut.inject.annotation from both io.micronaut.inject and io.micronaut.core_processor
[ERROR] error: module io.micronaut.core_processor reads package io.micronaut.inject.annotation from both io.micronaut.inject and io.micronaut.core_processor
[ERROR] error: module io.micronaut.inject reads package io.micronaut.inject.annotation from both io.micronaut.core_processor and io.micronaut.inject

Steps To Reproduce

Create one module-info.java having:

    requires io.micronaut.core;
    requires io.micronaut.core_processor;
    requires io.micronaut.inject;

With the next java class for example:

import io.micronaut.core.annotation.AnnotationValue;
import io.micronaut.inject.annotation.NamedAnnotationTransformer;
import io.micronaut.inject.visitor.VisitorContext;
import jakarta.inject.Scope;
import jakarta.inject.Singleton;

public class ApplicationScopedTransformer implements NamedAnnotationTransformer {
    @Override
    public String getName() {
        return "jakarta.enterprise.context.ApplicationScoped";
    }

    @Override
    public List<AnnotationValue<?>> transform(AnnotationValue<Annotation> annotation, VisitorContext visitorContext) {
        return List.of(
                AnnotationValue.builder(Scope.class).build(),
                AnnotationValue.builder(Singleton.class).build()
        );
    }
}

Environment Information

  • Linux Mint 21
  • Java(TM) SE Runtime Environment (build 21+35-LTS-2513)

Example Application

No response

Version

4.2.2

@graemerocher
Copy link
Contributor

core_processor is designed for use in the compiler not as an API

@sgammon
Copy link
Contributor

sgammon commented Dec 24, 2023

@jbescos see #6395

@jbescos
Copy link
Author

jbescos commented Jan 10, 2024

core_processor is designed for use in the compiler not as an API

I am back to this after holidays.

We are doing it in 2 steps. We have one maven module that generates a jar with all the annotation transformers. And then, this jar is set in the compiler. To illustrate it better, we have:

Step 1:
Creation of transformers-artifact jar with: ApplicationScopedTransformer, DependentTransformer and RequestScopedTransformer.

Step 2:
The maven-compiler-plugin is using it, as you said before, for compiler:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                ...
                    <annotationProcessorPaths>
                        <path>
                            <groupId>io.micronaut</groupId>
                            <artifactId>micronaut-inject-java</artifactId>
                        </path>
                        <path>
                            <groupId>io.micronaut</groupId>
                            <artifactId>micronaut-validation</artifactId>
                        </path>
                        <path>
                            <groupId>io.micronaut.data</groupId>
                            <artifactId>micronaut-data-processor</artifactId>
                        </path>
                        <!-- Here we use our dependency generated in step 1 -->
                        <path>
                            <groupId>transformers</groupId>
                            <artifactId>artifact</artifactId>
                        </path>
                    </annotationProcessorPaths>
                 </configuration>
            </plugin>

As you can see, the first step needs to generate the transformers-artifact jar to be used later by the compiler. The problem is that currently we cannot do the step 1 because of the previous error.

@dstepanov
Copy link
Contributor

What's the point of using modules for the annotation processer?

@jbescos
Copy link
Author

jbescos commented Jan 10, 2024

What's the point of using modules for the annotation processer?

It should not be mandatory, but then, why does core_processor have it too?.

@dstepanov
Copy link
Contributor

Have what?

@jbescos
Copy link
Author

jbescos commented Jan 10, 2024

Have what?

I mean, Micronaut core-processor has a module named Automatic-Module-Name: io.micronaut.core_processor and this lib is also supposed to be used for annotation processor, or this is my understanding. This is why I was asking why does core_processor have a module too.

@dstepanov
Copy link
Contributor

It looks like something added by Gradle; I don't think it supposted to activate the module system or something. I'm not sure what do you mean by core_processor having a module.

@jbescos
Copy link
Author

jbescos commented Jan 10, 2024

It looks like something added by Gradle; I don't think it supposted to activate the module system or something. I'm not sure what do you mean by core_processor having a module.

That is another way to define the module name, without adding a module-info.java. For the consumers of core-processor lib, we need to add in our module-info.java the next: requires io.micronaut.core_processor;

There is more information about that here https://openjdk.org/projects/jigsaw/spec/sotms/#automatic-modules . It is a bit complex, but this sentence defines it: An automatic module is a named module that is defined implicitly, since it does not have a module declaration.

There are three options in my opinion:

  1. I don't use module-info in my module transformers-artifact
  2. Micronaut team removes that entry in META-INF: Automatic-Module-Name: io.micronaut.core_processor
  3. Or Micronaut solves the package names issue. Two different modules cannot have same package names.

@dstepanov
Copy link
Contributor

  1. I think that's the easiest, considering there is no need for modules in the annotation processor classpath
  2. I don't think that's the issue. You can try to modify the Jar in your repository to check
  3. That has to wait for Micronaut 5

@jbescos
Copy link
Author

jbescos commented Jan 11, 2024

After removing the module, I am passing that issue but I found a new one when I invoke the next javac with:


$ java -version
java version "21" 2023-09-19 LTS
Java(TM) SE Runtime Environment (build 21+35-LTS-2513)
Java HotSpot(TM) 64-Bit Server VM (build 21+35-LTS-2513, mixed mode, sharing)

javac -d /home/jbescos/workspace/helidon/integrations/micronaut/cdi/target/test-classes -classpath /home/jbescos/workspace/helidon/integrations/micronaut/cdi/target/test-classes:/home/jbescos/.m2/repository/jakarta/el/jakarta.el-api/4.0.0/jakarta.el-api-4.0.0.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-inject-java/4.2.2/micronaut-inject-java-4.2.2.jar:/home/jbescos/.m2/repository/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-core-processor/4.2.2/micronaut-core-processor-4.2.2.jar:/home/jbescos/.m2/repository/org/ow2/asm/asm-tree/9.6/asm-tree-9.6.jar:/home/jbescos/.m2/repository/org/ow2/asm/asm/9.6/asm-9.6.jar:/home/jbescos/.m2/repository/org/ow2/asm/asm-commons/9.6/asm-commons-9.6.jar:/home/jbescos/.m2/repository/com/github/javaparser/javaparser-symbol-solver-core/3.25.7/javaparser-symbol-solver-core-3.25.7.jar:/home/jbescos/.m2/repository/com/github/javaparser/javaparser-core/3.25.7/javaparser-core-3.25.7.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-core-reactive/4.2.2/micronaut-core-reactive-4.2.2.jar:/home/jbescos/.m2/repository/org/reactivestreams/reactive-streams/1.0.4/reactive-streams-1.0.4.jar:/home/jbescos/.m2/repository/io/helidon/microprofile/cdi/helidon-microprofile-cdi/3.2.6-SNAPSHOT/helidon-microprofile-cdi-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/microprofile/weld/weld-se-core/3.2.6-SNAPSHOT/weld-se-core-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/microprofile/weld/weld-core-impl/3.2.6-SNAPSHOT/weld-core-impl-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/org/jboss/weld/environment/weld-environment-common/4.0.3.Final/weld-environment-common-4.0.3.Final.jar:/home/jbescos/.m2/repository/org/jboss/weld/weld-api/4.0.SP1/weld-api-4.0.SP1.jar:/home/jbescos/.m2/repository/org/jboss/weld/weld-spi/4.0.SP1/weld-spi-4.0.SP1.jar:/home/jbescos/.m2/repository/org/jboss/logging/jboss-logging/3.5.3.Final/jboss-logging-3.5.3.Final.jar:/home/jbescos/.m2/repository/org/jboss/classfilewriter/jboss-classfilewriter/1.2.5.Final/jboss-classfilewriter-1.2.5.Final.jar:/home/jbescos/.m2/repository/io/helidon/config/helidon-config-mp/3.2.6-SNAPSHOT/helidon-config-mp-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/common/helidon-common-service-loader/3.2.6-SNAPSHOT/helidon-common-service-loader-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/config/helidon-config/3.2.6-SNAPSHOT/helidon-config-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/common/helidon-common-media-type/3.2.6-SNAPSHOT/helidon-common-media-type-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/config/helidon-config-yaml-mp/3.2.6-SNAPSHOT/helidon-config-yaml-mp-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/common/helidon-common-context/3.2.6-SNAPSHOT/helidon-common-context-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/microprofile/config/helidon-microprofile-config/3.2.6-SNAPSHOT/helidon-microprofile-config-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/config/helidon-config-yaml/3.2.6-SNAPSHOT/helidon-config-yaml-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/org/yaml/snakeyaml/2.0/snakeyaml-2.0.jar:/home/jbescos/.m2/repository/io/helidon/config/helidon-config-encryption/3.2.6-SNAPSHOT/helidon-config-encryption-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/common/helidon-common-key-util/3.2.6-SNAPSHOT/helidon-common-key-util-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/common/helidon-common-configurable/3.2.6-SNAPSHOT/helidon-common-configurable-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/common/helidon-common-crypto/3.2.6-SNAPSHOT/helidon-common-crypto-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/config/helidon-config-object-mapping/3.2.6-SNAPSHOT/helidon-config-object-mapping-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/microprofile/tests/helidon-microprofile-tests-junit5/3.2.6-SNAPSHOT/helidon-microprofile-tests-junit5-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/jersey/helidon-jersey-client/3.2.6-SNAPSHOT/helidon-jersey-client-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/org/glassfish/jersey/core/jersey-client/3.0.11/jersey-client-3.0.11.jar:/home/jbescos/.m2/repository/jakarta/ws/rs/jakarta.ws.rs-api/3.0.0/jakarta.ws.rs-api-3.0.0.jar:/home/jbescos/.m2/repository/org/glassfish/jersey/core/jersey-common/3.0.11/jersey-common-3.0.11.jar:/home/jbescos/.m2/repository/org/glassfish/hk2/osgi-resource-locator/1.0.3/osgi-resource-locator-1.0.3.jar:/home/jbescos/.m2/repository/org/glassfish/jersey/inject/jersey-hk2/3.0.11/jersey-hk2-3.0.11.jar:/home/jbescos/.m2/repository/org/glassfish/hk2/hk2-locator/3.0.3/hk2-locator-3.0.3.jar:/home/jbescos/.m2/repository/org/glassfish/hk2/external/aopalliance-repackaged/3.0.3/aopalliance-repackaged-3.0.3.jar:/home/jbescos/.m2/repository/org/glassfish/hk2/hk2-api/3.0.3/hk2-api-3.0.3.jar:/home/jbescos/.m2/repository/org/glassfish/hk2/hk2-utils/3.0.3/hk2-utils-3.0.3.jar:/home/jbescos/.m2/repository/org/javassist/javassist/3.29.2-GA/javassist-3.29.2-GA.jar:/home/jbescos/.m2/repository/jakarta/xml/bind/jakarta.xml.bind-api/3.0.1/jakarta.xml.bind-api-3.0.1.jar:/home/jbescos/.m2/repository/com/sun/activation/jakarta.activation/2.0.1/jakarta.activation-2.0.1.jar:/home/jbescos/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.7.0/junit-jupiter-api-5.7.0.jar:/home/jbescos/.m2/repository/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.jar:/home/jbescos/.m2/repository/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar:/home/jbescos/.m2/repository/org/junit/platform/junit-platform-commons/1.7.0/junit-platform-commons-1.7.0.jar:/home/jbescos/.m2/repository/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar: --module-path /home/jbescos/workspace/helidon/integrations/micronaut/cdi/target/classes:/home/jbescos/.m2/repository/jakarta/enterprise/jakarta.enterprise.cdi-api/3.0.0/jakarta.enterprise.cdi-api-3.0.0.jar:/home/jbescos/.m2/repository/jakarta/interceptor/jakarta.interceptor-api/2.0.0/jakarta.interceptor-api-2.0.0.jar:/home/jbescos/.m2/repository/jakarta/inject/jakarta.inject-api/2.0.0/jakarta.inject-api-2.0.0.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-inject/4.2.2/micronaut-inject-4.2.2.jar:/home/jbescos/.m2/repository/jakarta/annotation/jakarta.annotation-api/2.0.0/jakarta.annotation-api-2.0.0.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-core/4.2.2/micronaut-core-4.2.2.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-aop/4.2.2/micronaut-aop-4.2.2.jar:/home/jbescos/.m2/repository/io/helidon/common/helidon-common/3.2.6-SNAPSHOT/helidon-common-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/org/eclipse/microprofile/config/microprofile-config-api/3.0.1/microprofile-config-api-3.0.1.jar: -sourcepath /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java:/home/jbescos/workspace/helidon/integrations/micronaut/cdi/target/generated-test-sources/test-annotations: /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestCdiBean.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/CdiIntercepted.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/MicronautCdiExtensionTest.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/MicroInterceptor.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/MicronautBeanDef.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/MicroIntercepted.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestBothBean.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestMicronautBean.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestBean.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/CdiWithInjected.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/CdiInterceptor.java -s /home/jbescos/workspace/helidon/integrations/micronaut/cdi/target/generated-test-sources/test-annotations -g -deprecation --release 17 -encoding UTF-8 -Xlint:all -parameters --patch-module io.helidon.integrations.micronaut.cdi=/home/jbescos/workspace/helidon/integrations/micronaut/cdi/target/classes:/home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java:/home/jbescos/workspace/helidon/integrations/micronaut/cdi/target/generated-test-sources/test-annotations: --add-reads io.helidon.integrations.micronaut.cdi=ALL-UNNAMED -verbose

error: Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: io.micronaut.annotation.processing.TypeElementVisitorProcessor Unable to get public no-arg constructor
[total 249ms]

It seems that io.micronaut.annotation.processing.TypeElementVisitorProcessor is missing a public constructor.

Is that an issue in Micronaut?, if yes, could you also double check the other processor implementations?:

io.micronaut.annotation.processing.TypeElementVisitorProcessor
io.micronaut.annotation.processing.AggregatingTypeElementVisitorProcessor
io.micronaut.annotation.processing.PackageConfigurationInjectProcessor
io.micronaut.annotation.processing.BeanDefinitionInjectProcessor
io.micronaut.annotation.processing.ConfigurationMetadataProcessor

It looks that the processor implementations are loaded with a ServiceLocator, and that requires public constructors.

@dstepanov
Copy link
Contributor

It does have a public constructor.
What are you trying to do?

@jbescos
Copy link
Author

jbescos commented Jan 11, 2024

That command comes from Maven with the debug enabled. It is just a javac with annotation processor. I removed the module-path from that command and added it into the class-path and I get a different error:

javac -d /home/jbescos/workspace/helidon/integrations/micronaut/cdi/target/test-classes -classpath /home/jbescos/workspace/helidon/integrations/micronaut/cdi/target/test-classes:/home/jbescos/.m2/repository/jakarta/el/jakarta.el-api/4.0.0/jakarta.el-api-4.0.0.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-inject-java/4.2.2/micronaut-inject-java-4.2.2.jar:/home/jbescos/.m2/repository/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-core-processor/4.2.2/micronaut-core-processor-4.2.2.jar:/home/jbescos/.m2/repository/org/ow2/asm/asm-tree/9.6/asm-tree-9.6.jar:/home/jbescos/.m2/repository/org/ow2/asm/asm/9.6/asm-9.6.jar:/home/jbescos/.m2/repository/org/ow2/asm/asm-commons/9.6/asm-commons-9.6.jar:/home/jbescos/.m2/repository/com/github/javaparser/javaparser-symbol-solver-core/3.25.7/javaparser-symbol-solver-core-3.25.7.jar:/home/jbescos/.m2/repository/com/github/javaparser/javaparser-core/3.25.7/javaparser-core-3.25.7.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-core-reactive/4.2.2/micronaut-core-reactive-4.2.2.jar:/home/jbescos/.m2/repository/org/reactivestreams/reactive-streams/1.0.4/reactive-streams-1.0.4.jar:/home/jbescos/.m2/repository/io/helidon/microprofile/cdi/helidon-microprofile-cdi/3.2.6-SNAPSHOT/helidon-microprofile-cdi-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/microprofile/weld/weld-se-core/3.2.6-SNAPSHOT/weld-se-core-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/microprofile/weld/weld-core-impl/3.2.6-SNAPSHOT/weld-core-impl-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/org/jboss/weld/environment/weld-environment-common/4.0.3.Final/weld-environment-common-4.0.3.Final.jar:/home/jbescos/.m2/repository/org/jboss/weld/weld-api/4.0.SP1/weld-api-4.0.SP1.jar:/home/jbescos/.m2/repository/org/jboss/weld/weld-spi/4.0.SP1/weld-spi-4.0.SP1.jar:/home/jbescos/.m2/repository/org/jboss/logging/jboss-logging/3.5.3.Final/jboss-logging-3.5.3.Final.jar:/home/jbescos/.m2/repository/org/jboss/classfilewriter/jboss-classfilewriter/1.2.5.Final/jboss-classfilewriter-1.2.5.Final.jar:/home/jbescos/.m2/repository/io/helidon/config/helidon-config-mp/3.2.6-SNAPSHOT/helidon-config-mp-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/common/helidon-common-service-loader/3.2.6-SNAPSHOT/helidon-common-service-loader-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/config/helidon-config/3.2.6-SNAPSHOT/helidon-config-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/common/helidon-common-media-type/3.2.6-SNAPSHOT/helidon-common-media-type-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/config/helidon-config-yaml-mp/3.2.6-SNAPSHOT/helidon-config-yaml-mp-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/common/helidon-common-context/3.2.6-SNAPSHOT/helidon-common-context-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/microprofile/config/helidon-microprofile-config/3.2.6-SNAPSHOT/helidon-microprofile-config-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/config/helidon-config-yaml/3.2.6-SNAPSHOT/helidon-config-yaml-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/org/yaml/snakeyaml/2.0/snakeyaml-2.0.jar:/home/jbescos/.m2/repository/io/helidon/config/helidon-config-encryption/3.2.6-SNAPSHOT/helidon-config-encryption-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/common/helidon-common-key-util/3.2.6-SNAPSHOT/helidon-common-key-util-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/common/helidon-common-configurable/3.2.6-SNAPSHOT/helidon-common-configurable-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/common/helidon-common-crypto/3.2.6-SNAPSHOT/helidon-common-crypto-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/config/helidon-config-object-mapping/3.2.6-SNAPSHOT/helidon-config-object-mapping-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/microprofile/tests/helidon-microprofile-tests-junit5/3.2.6-SNAPSHOT/helidon-microprofile-tests-junit5-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/helidon/jersey/helidon-jersey-client/3.2.6-SNAPSHOT/helidon-jersey-client-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/org/glassfish/jersey/core/jersey-client/3.0.11/jersey-client-3.0.11.jar:/home/jbescos/.m2/repository/jakarta/ws/rs/jakarta.ws.rs-api/3.0.0/jakarta.ws.rs-api-3.0.0.jar:/home/jbescos/.m2/repository/org/glassfish/jersey/core/jersey-common/3.0.11/jersey-common-3.0.11.jar:/home/jbescos/.m2/repository/org/glassfish/hk2/osgi-resource-locator/1.0.3/osgi-resource-locator-1.0.3.jar:/home/jbescos/.m2/repository/org/glassfish/jersey/inject/jersey-hk2/3.0.11/jersey-hk2-3.0.11.jar:/home/jbescos/.m2/repository/org/glassfish/hk2/hk2-locator/3.0.3/hk2-locator-3.0.3.jar:/home/jbescos/.m2/repository/org/glassfish/hk2/external/aopalliance-repackaged/3.0.3/aopalliance-repackaged-3.0.3.jar:/home/jbescos/.m2/repository/org/glassfish/hk2/hk2-api/3.0.3/hk2-api-3.0.3.jar:/home/jbescos/.m2/repository/org/glassfish/hk2/hk2-utils/3.0.3/hk2-utils-3.0.3.jar:/home/jbescos/.m2/repository/org/javassist/javassist/3.29.2-GA/javassist-3.29.2-GA.jar:/home/jbescos/.m2/repository/jakarta/xml/bind/jakarta.xml.bind-api/3.0.1/jakarta.xml.bind-api-3.0.1.jar:/home/jbescos/.m2/repository/com/sun/activation/jakarta.activation/2.0.1/jakarta.activation-2.0.1.jar:/home/jbescos/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.7.0/junit-jupiter-api-5.7.0.jar:/home/jbescos/.m2/repository/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.jar:/home/jbescos/.m2/repository/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar:/home/jbescos/.m2/repository/org/junit/platform/junit-platform-commons/1.7.0/junit-platform-commons-1.7.0.jar:/home/jbescos/.m2/repository/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar:/home/jbescos/workspace/helidon/integrations/micronaut/cdi/target/classes:/home/jbescos/.m2/repository/jakarta/enterprise/jakarta.enterprise.cdi-api/3.0.0/jakarta.enterprise.cdi-api-3.0.0.jar:/home/jbescos/.m2/repository/jakarta/interceptor/jakarta.interceptor-api/2.0.0/jakarta.interceptor-api-2.0.0.jar:/home/jbescos/.m2/repository/jakarta/inject/jakarta.inject-api/2.0.0/jakarta.inject-api-2.0.0.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-inject/4.2.2/micronaut-inject-4.2.2.jar:/home/jbescos/.m2/repository/jakarta/annotation/jakarta.annotation-api/2.0.0/jakarta.annotation-api-2.0.0.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-core/4.2.2/micronaut-core-4.2.2.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-aop/4.2.2/micronaut-aop-4.2.2.jar:/home/jbescos/.m2/repository/io/helidon/common/helidon-common/3.2.6-SNAPSHOT/helidon-common-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/org/eclipse/microprofile/config/microprofile-config-api/3.0.1/microprofile-config-api-3.0.1.jar: -sourcepath /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java:/home/jbescos/workspace/helidon/integrations/micronaut/cdi/target/generated-test-sources/test-annotations: /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestCdiBean.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/CdiIntercepted.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/MicronautCdiExtensionTest.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/MicroInterceptor.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/MicronautBeanDef.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/MicroIntercepted.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestBothBean.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestMicronautBean.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestBean.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/CdiWithInjected.java /home/jbescos/workspace/helidon/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/CdiInterceptor.java -s /home/jbescos/workspace/helidon/integrations/micronaut/cdi/target/generated-test-sources/test-annotations -processorpath /home/jbescos/.m2/repository/io/micronaut/micronaut-inject-java/4.2.2/micronaut-inject-java-4.2.2.jar:/home/jbescos/.m2/repository/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-core-processor/4.2.2/micronaut-core-processor-4.2.2.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-aop/4.2.2/micronaut-aop-4.2.2.jar:/home/jbescos/.m2/repository/org/ow2/asm/asm-tree/9.6/asm-tree-9.6.jar:/home/jbescos/.m2/repository/org/ow2/asm/asm/9.6/asm-9.6.jar:/home/jbescos/.m2/repository/org/ow2/asm/asm-commons/9.6/asm-commons-9.6.jar:/home/jbescos/.m2/repository/com/github/javaparser/javaparser-symbol-solver-core/3.25.7/javaparser-symbol-solver-core-3.25.7.jar:/home/jbescos/.m2/repository/com/github/javaparser/javaparser-core/3.25.7/javaparser-core-3.25.7.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-validation/3.10.3/micronaut-validation-3.10.3.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-inject/3.10.3/micronaut-inject-3.10.3.jar:/home/jbescos/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar:/home/jbescos/.m2/repository/org/yaml/snakeyaml/2.0/snakeyaml-2.0.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-core-reactive/3.10.3/micronaut-core-reactive-3.10.3.jar:/home/jbescos/.m2/repository/org/reactivestreams/reactive-streams/1.0.4/reactive-streams-1.0.4.jar:/home/jbescos/.m2/repository/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar:/home/jbescos/.m2/repository/io/projectreactor/reactor-core/3.5.0/reactor-core-3.5.0.jar:/home/jbescos/.m2/repository/io/micronaut/data/micronaut-data-processor/3.4.3/micronaut-data-processor-3.4.3.jar:/home/jbescos/.m2/repository/io/micronaut/data/micronaut-data-model/3.4.3/micronaut-data-model-3.4.3.jar:/home/jbescos/.m2/repository/io/micronaut/data/micronaut-data-tx/3.4.3/micronaut-data-tx-3.4.3.jar:/home/jbescos/.m2/repository/jakarta/transaction/jakarta.transaction-api/1.3.3/jakarta.transaction-api-1.3.3.jar:/home/jbescos/.m2/repository/jakarta/persistence/jakarta.persistence-api/3.0.0/jakarta.persistence-api-3.0.0.jar:/home/jbescos/.m2/repository/io/helidon/integrations/micronaut/helidon-integrations-micronaut-cdi-processor/3.2.6-SNAPSHOT/helidon-integrations-micronaut-cdi-processor-3.2.6-SNAPSHOT.jar:/home/jbescos/.m2/repository/io/micronaut/micronaut-core/4.2.2/micronaut-core-4.2.2.jar:/home/jbescos/.m2/repository/jakarta/inject/jakarta.inject-api/2.0.0/jakarta.inject-api-2.0.0.jar:/home/jbescos/.m2/repository/jakarta/annotation/jakarta.annotation-api/2.0.0/jakarta.annotation-api-2.0.0.jar: -g -deprecation --release 17 -encoding UTF-8 -Xlint:all -parameters

error: Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider io.micronaut.annotation.processing.TypeElementVisitorProcessor could not be instantiated
1 error

I will try to get more details of the error.

@dstepanov
Copy link
Contributor

Why can you use the maven?

Googling you can find the cause of your error https://stackoverflow.com/questions/36248959/bad-service-configuration-file-or-exception-thrown-while-constructing-processor

@jbescos
Copy link
Author

jbescos commented Jan 12, 2024

The issue was related to a wrong dependency micronaut-validation, that has changed in version 4.

Now I don't have that compilation issue, although I have my own implementation of io.micronaut.inject.annotation.NamedAnnotationTransformer that is not working for some reason. I will find it out.

Coming back to my original request, it would be nice if you can solve the issue related to have 2 different module names with same package names: #10299 (comment)

For the time being I will not include a module-info to bypass the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants