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

Helidon MP fails to list @Grpc annotated services on gradle #8907

Open
Baron1Pampa opened this issue Jun 24, 2024 · 0 comments
Open

Helidon MP fails to list @Grpc annotated services on gradle #8907

Baron1Pampa opened this issue Jun 24, 2024 · 0 comments
Assignees
Labels
3.x Issues for 3.x version branch grpc triage
Projects

Comments

@Baron1Pampa
Copy link

Environment Details

  • Helidon Version: 3.2.2
  • Helidon MP
  • JDK version: corretto-17
  • OS: macOS Sonoma 1435
  • Docker version (if applicable):

Problem Summary

I'm trying to run grpc server with Helidon MP using gradle(this is important). When trying to run basic example using mvn, everything works corrects

Problem Description

  • Service Code (taken from helidon example here )
  • Main Class code:

public class MainClass {
    public static void main(String[] args) {
        Server.builder().build().start();
    }
}
  • pom.xml
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <version>1.0-SNAPSHOT</version>
    <artifactId>copy-of-microprofile-grpc</artifactId>
    <name>Dummy grpc Server</name>
    <dependencies>
        <dependency>
            <groupId>io.helidon.microprofile.bundles</groupId>
            <artifactId>helidon-microprofile</artifactId>
            <version>3.2.2</version>
        </dependency>
        <dependency>
            <groupId>io.helidon.microprofile.grpc</groupId>
            <artifactId>helidon-microprofile-grpc-server</artifactId>
            <version>3.2.2</version>
        </dependency>
    </dependencies>
</project>

  • gradle.build.kts
plugins {
    id("java")
    application
}

group = "org.example"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
}

dependencies {
    implementation("io.helidon.microprofile.bundles:helidon-microprofile:3.2.2")
    implementation("io.helidon.microprofile.grpc:helidon-microprofile-grpc-server:3.2.2")
}

application {
    mainClass.set("implicit.MainClass")
}

Output when running the example with mvn:

[Mon Jun 24 14:50:24 IDT 2024] INFO: io.helidon.common.LogConfig doConfigureLogging - Logging at initialization configured using classpath: /logging.properties 
[Mon Jun 24 14:50:24 IDT 2024] INFO: org.jboss.weld.bootstrap.WeldStartup <clinit> - WELD-000900: 4.0.3 (Final) 
[Mon Jun 24 14:50:25 IDT 2024] FINE: io.helidon.microprofile.config.ConfigCdiExtension <init> - ConfigCdiExtension instantiated 
[Mon Jun 24 14:50:25 IDT 2024] INFO: io.helidon.microprofile.openapi.OpenApiCdiExtension <init> - OpenAPI support could not locate the Jandex index file META-INF/jandex.idx so will build an in-memory index.
This slows your app start-up and, depending on CDI configuration, might omit some type information needed for a complete OpenAPI document.
Consider using the Jandex maven plug-in during your build to create the index and add it to your app. 
[Mon Jun 24 14:50:25 IDT 2024] FINE: io.helidon.microprofile.config.ConfigCdiExtension <init> - ConfigCdiExtension instantiated 
[Mon Jun 24 14:50:25 IDT 2024] INFO: org.jboss.weld.environment.deployment.discovery.DiscoveryStrategyFactory create - WELD-ENV-000020: Using jandex for bean discovery 
[Mon Jun 24 14:50:25 IDT 2024] INFO: org.jboss.weld.bootstrap.WeldStartup startContainer - WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously. 
[Mon Jun 24 14:50:25 IDT 2024] INFO: org.jboss.weld.event.ExtensionObserverMethodImpl checkRequiredTypeAnnotations - WELD-000411: Observer method [BackedAnnotatedMethod] private io.helidon.microprofile.openapi.OpenApiCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<X>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds. 
[Mon Jun 24 14:50:25 IDT 2024] INFO: org.jboss.weld.event.ExtensionObserverMethodImpl checkRequiredTypeAnnotations - WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jersey.ext.cdi1x.internal.ProcessAllAnnotatedTypes.processAnnotatedType(@Observes ProcessAnnotatedType<?>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds. 
[Mon Jun 24 14:50:26 IDT 2024] INFO: io.helidon.tracing.tracerresolver.TracerResolverBuilder build - TracerResolver not configured, tracing is disabled 
[Mon Jun 24 14:50:26 IDT 2024] INFO: io.helidon.microprofile.security.SecurityCdiExtension registerSecurity - Authentication provider is missing from security configuration, but security extension for microprofile is enabled (requires providers configuration at key security.providers). Security will not have any valid authentication provider 
[Mon Jun 24 14:50:26 IDT 2024] INFO: io.helidon.microprofile.security.SecurityCdiExtension registerSecurity - Authorization provider is missing from security configuration, but security extension for microprofile is enabled (requires providers configuration at key security.providers). ABAC provider is configured for authorization. 
[Mon Jun 24 14:50:27 IDT 2024] INFO: io.helidon.grpc.server.GrpcServerImpl deploy - gRPC server [test.server]: registered service [StringService] 
[Mon Jun 24 14:50:27 IDT 2024] INFO: io.helidon.grpc.server.GrpcServerImpl deploy - gRPC server [test.server]:       with methods [StringService/echo] 
[Mon Jun 24 14:50:27 IDT 2024] INFO: io.helidon.grpc.server.GrpcServerImpl deploy - gRPC server [test.server]:                    [StringService/join] 
[Mon Jun 24 14:50:27 IDT 2024] INFO: io.helidon.grpc.server.GrpcServerImpl deploy - gRPC server [test.server]:                    [StringService/lower] 
[Mon Jun 24 14:50:27 IDT 2024] INFO: io.helidon.grpc.server.GrpcServerImpl deploy - gRPC server [test.server]:                    [StringService/split] 
[Mon Jun 24 14:50:27 IDT 2024] INFO: io.helidon.grpc.server.GrpcServerImpl deploy - gRPC server [test.server]:                    [StringService/upper] 

[Mon Jun 24 14:50:27 IDT 2024] INFO: io.helidon.grpc.server.GrpcServerImpl start - gRPC server [test.server]: listening on port 1408 (TLS=false) 
[Mon Jun 24 14:50:27 IDT 2024] INFO: io.helidon.microprofile.grpc.server.GrpcServerCdiExtension lambda$startServer$3 - gRPC server started on localhost:1408 (and all other host addresses) in 150 milliseconds.

Output when running with gradle:

[Mon Jun 24 15:14:01 IDT 2024] INFO: io.helidon.common.LogConfig doConfigureLogging - Logging at initialization configured using classpath: /logging.properties 
[Mon Jun 24 15:14:01 IDT 2024] INFO: org.jboss.weld.bootstrap.WeldStartup <clinit> - WELD-000900: 4.0.3 (Final) 
[Mon Jun 24 15:14:01 IDT 2024] INFO: io.helidon.microprofile.openapi.OpenApiCdiExtension <init> - OpenAPI support could not locate the Jandex index file META-INF/jandex.idx so will build an in-memory index.
This slows your app start-up and, depending on CDI configuration, might omit some type information needed for a complete OpenAPI document.
Consider using the Jandex maven plug-in during your build to create the index and add it to your app. 
[Mon Jun 24 15:14:01 IDT 2024] FINE: io.helidon.microprofile.config.ConfigCdiExtension <init> - ConfigCdiExtension instantiated 
[Mon Jun 24 15:14:01 IDT 2024] INFO: org.jboss.weld.environment.deployment.discovery.DiscoveryStrategyFactory create - WELD-ENV-000020: Using jandex for bean discovery 
[Mon Jun 24 15:14:01 IDT 2024] INFO: org.jboss.weld.bootstrap.WeldStartup startContainer - WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously. 
[Mon Jun 24 15:14:02 IDT 2024] INFO: org.jboss.weld.event.ExtensionObserverMethodImpl checkRequiredTypeAnnotations - WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jersey.ext.cdi1x.internal.ProcessAllAnnotatedTypes.processAnnotatedType(@Observes ProcessAnnotatedType<?>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds. 
[Mon Jun 24 15:14:02 IDT 2024] INFO: org.jboss.weld.event.ExtensionObserverMethodImpl checkRequiredTypeAnnotations - WELD-000411: Observer method [BackedAnnotatedMethod] private io.helidon.microprofile.openapi.OpenApiCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType<X>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds. 
[Mon Jun 24 15:14:03 IDT 2024] INFO: io.helidon.tracing.tracerresolver.TracerResolverBuilder build - TracerResolver not configured, tracing is disabled 
[Mon Jun 24 15:14:03 IDT 2024] INFO: io.helidon.microprofile.security.SecurityCdiExtension registerSecurity - Authentication provider is missing from security configuration, but security extension for microprofile is enabled (requires providers configuration at key security.providers). Security will not have any valid authentication provider 
[Mon Jun 24 15:14:03 IDT 2024] INFO: io.helidon.microprofile.security.SecurityCdiExtension registerSecurity - Authorization provider is missing from security configuration, but security extension for microprofile is enabled (requires providers configuration at key security.providers). ABAC provider is configured for authorization. 
[Mon Jun 24 15:14:03 IDT 2024] INFO: io.helidon.grpc.server.GrpcServerImpl start - gRPC server [test.server]: listening on port 1111 (TLS=false) 
[Mon Jun 24 15:14:03 IDT 2024] INFO: io.helidon.microprofile.grpc.server.GrpcServerCdiExtension lambda$startServer$3 - gRPC server started on localhost:1111 (and all other host addresses) in 181 milliseconds. 

When running with gradle, grpc services are not listed

Is there any hidden dependency the need to be specified in gradle?

@github-actions github-actions bot added this to Triage in Backlog Jun 24, 2024
@m0mus m0mus added grpc 3.x Issues for 3.x version branch triage labels Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issues for 3.x version branch grpc triage
Projects
Backlog
  
Triage
Development

No branches or pull requests

3 participants