eclipse-edc / Samples

Apache License 2.0
29 stars 54 forks source link

Sample Basic 3 adding management-api as described in section #321

Closed juerware closed 1 hour ago

juerware commented 3 hours ago

Bug Report

Describe the Bug

Following documentation in: https://github.com/eclipse-edc/Samples/blob/main/basic/basic-03-configuration/README.md#management-api in order to add:

dependencies {
    // ...
    implementation(libs.edc.management.api)
    // ...
}

I had the following error:

Exception in thread "main" org.eclipse.edc.spi.EdcException: org.eclipse.edc.boot.system.injection.EdcInjectionException: The following injected fields were not provided:
Field "jsonLd" of type [interface org.eclipse.edc.jsonld.spi.JsonLd] required by org.eclipse.edc.connector.api.management.configuration.ManagementApiConfigurationExtension
Field "assetService" of type [interface org.eclipse.edc.connector.controlplane.services.spi.asset.AssetService] required by org.eclipse.edc.connector.controlplane.api.management.asset.AssetApiExtension
Field "service" of type [interface org.eclipse.edc.connector.controlplane.services.spi.catalog.CatalogService] required by org.eclipse.edc.connector.controlplane.api.management.catalog.CatalogApiExtension
Field "service" of type [interface org.eclipse.edc.connector.controlplane.services.spi.contractagreement.ContractAgreementService] required by org.eclipse.edc.connector.controlplane.api.management.contractagreement.ContractAgreementApiExtension
Field "service" of type [interface org.eclipse.edc.connector.controlplane.services.spi.contractdefinition.ContractDefinitionService] required by org.eclipse.edc.connector.controlplane.api.management.contractdefinition.ContractDefinitionApiExtension
Field "service" of type [interface org.eclipse.edc.connector.controlplane.services.spi.contractnegotiation.ContractNegotiationService] required by org.eclipse.edc.connector.controlplane.api.management.contractnegotiation.ContractNegotiationApiExtension
Field "service" of type [interface org.eclipse.edc.connector.controlplane.services.spi.policydefinition.PolicyDefinitionService] required by org.eclipse.edc.connector.controlplane.api.management.policy.PolicyDefinitionApiExtension
Field "service" of type [interface org.eclipse.edc.connector.controlplane.services.spi.transferprocess.TransferProcessService] required by org.eclipse.edc.connector.controlplane.api.management.transferprocess.TransferProcessApiExtension
        at org.eclipse.edc.boot.system.runtime.BaseRuntime.onError(BaseRuntime.java:143)
        at org.eclipse.edc.boot.system.runtime.BaseRuntime.boot(BaseRuntime.java:106)
        at org.eclipse.edc.boot.system.runtime.BaseRuntime.main(BaseRuntime.java:77)
Caused by: org.eclipse.edc.boot.system.injection.EdcInjectionException: The following injected fields were not provided:
Field "jsonLd" of type [interface org.eclipse.edc.jsonld.spi.JsonLd] required by org.eclipse.edc.connector.api.management.configuration.ManagementApiConfigurationExtension
Field "assetService" of type [interface org.eclipse.edc.connector.controlplane.services.spi.asset.AssetService] required by org.eclipse.edc.connector.controlplane.api.management.asset.AssetApiExtension
Field "service" of type [interface org.eclipse.edc.connector.controlplane.services.spi.catalog.CatalogService] required by org.eclipse.edc.connector.controlplane.api.management.catalog.CatalogApiExtension
Field "service" of type [interface org.eclipse.edc.connector.controlplane.services.spi.contractagreement.ContractAgreementService] required by org.eclipse.edc.connector.controlplane.api.management.contractagreement.ContractAgreementApiExtension
Field "service" of type [interface org.eclipse.edc.connector.controlplane.services.spi.contractdefinition.ContractDefinitionService] required by org.eclipse.edc.connector.controlplane.api.management.contractdefinition.ContractDefinitionApiExtension
Field "service" of type [interface org.eclipse.edc.connector.controlplane.services.spi.contractnegotiation.ContractNegotiationService] required by org.eclipse.edc.connector.controlplane.api.management.contractnegotiation.ContractNegotiationApiExtension
Field "service" of type [interface org.eclipse.edc.connector.controlplane.services.spi.policydefinition.PolicyDefinitionService] required by org.eclipse.edc.connector.controlplane.api.management.policy.PolicyDefinitionApiExtension
Field "service" of type [interface org.eclipse.edc.connector.controlplane.services.spi.transferprocess.TransferProcessService] required by org.eclipse.edc.connector.controlplane.api.management.transferprocess.TransferProcessApiExtension
        at org.eclipse.edc.boot.system.DependencyGraph.of(DependencyGraph.java:102)
        at org.eclipse.edc.boot.system.ExtensionLoader.loadServiceExtensions(ExtensionLoader.java:120)
        at org.eclipse.edc.boot.system.runtime.BaseRuntime.createExtensions(BaseRuntime.java:163)
        at org.eclipse.edc.boot.system.runtime.BaseRuntime.boot(BaseRuntime.java:91)
        ...

Expected Behavior

After executing:

./gradlew clean basic:basic-03-configuration:build; # it works right
java -Dedc.fs.config=basic/basic-03-configuration/config.properties -jar basic/basic-03-configuration/build/libs/filesystem-config-connector.jar; # it fails

We expect it works

Observed Behavior

Somewhere there is an unresolved dependecy

Steps to Reproduce

Steps to reproduce the behavior:

  1. Change file basic/basic-03-configuration/build.gradle.kts according to it said in: https://github.com/eclipse-edc/Samples/blob/main/basic/basic-03-configuration/README.md#management-api
  2. Execute: ./gradlew clean basic:basic-03-configuration:build; and it was right
  3. Execute: java -Dedc.fs.config=basic/basic-03-configuration/config.properties -jar basic/basic-03-configuration/build/libs/filesystem-config-connector.jar;
  4. Watch the error.

Context Information

  1. respository: https://github.com/eclipse-edc/Samples
  2. commit (last at the moment this was written): 27883d7
  3. java --version: openjdk 17.0.12 2024-07-16 OpenJDK Runtime Environment (build 17.0.12+7-Ubuntu-1ubuntu222.04) OpenJDK 64-Bit Server VM (build 17.0.12+7-Ubuntu-1ubuntu222.04, mixed mode, sharing)

Detailed Description

It was explained above.

Possible Implementation

I don´t have that information.

github-actions[bot] commented 3 hours ago

Thanks for your contribution :fire: We will take a look asap :rocket:

ndr-brt commented 3 hours ago

Thanks for reporting. My thought here is that the "management api" paragraph does not belong to this sample, it should stay in a separate sample eventually. I would just remove it as the management api are targeted by the transfer samples.