Skip to content

fix: use @Feature annotation instead of @Features#707

Merged
anthony-swirldslabs merged 1 commit intohashgraph:mainfrom
ivanguravel:fix-helidon-feature-metadata
Dec 15, 2025
Merged

fix: use @Feature annotation instead of @Features#707
anthony-swirldslabs merged 1 commit intohashgraph:mainfrom
ivanguravel:fix-helidon-feature-metadata

Conversation

@ivanguravel
Copy link
Copy Markdown
Contributor

@ivanguravel ivanguravel commented Dec 13, 2025

Description:

Fix IllegalStateException on Block Node startup caused by invalid Helidon feature metadata.

The pbj-grpc-helidon-config module uses @Features.* annotations which don't generate the required m (module name) field in feature-metadata.properties. This causes Helidon 4.3.2 to throw an exception during feature scanning.

  • Replace @Features.Preview with @Preview annotation
  • Replace @Features.Name, @Features.Description, @Features.Flavor, @Features.Path with consolidated @Feature annotation (which is old, but works)
  • Match annotation pattern already used in pbj-grpc-helidon module

Related issue(s):

Fixes hiero-ledger/hiero-block-node#1964

Notes for reviewer:

Before fix - feature-metadata.properties was missing m field:

n=PBJConfig
d=WebServer gRPC-PBJ Config

After fix - feature-metadata.properties contains all required fields:

m=com.hedera.pbj.grpc.helidon.config
n=PBJConfig
d=WebServer gRPC-PBJ Config
in=SE
p=WebServer,PBJpr=true

Checklist

  • Documented (Code comments, README, etc.) - probably don't need
  • Tested (unit, integration, etc.)
Снимок экрана 2025-12-13 в 18 25 55

@ivanguravel ivanguravel requested review from a team as code owners December 13, 2025 17:44
@ivanguravel ivanguravel force-pushed the fix-helidon-feature-metadata branch from 703b577 to ca63204 Compare December 13, 2025 21:59
@ivanguravel ivanguravel changed the title fix: use @Feature annotation instead of deprecated @Features fix: use @Feature annotation instead of @Features Dec 14, 2025
@ivanguravel
Copy link
Copy Markdown
Contributor Author

ivanguravel commented Dec 14, 2025

seems like some weird behaviour is present on the framework side with the naming helidon-io/helidon#8163

https://helidon.io/docs/v4/apidocs/io.helidon.common.features.api/io/helidon/common/features/api/Feature.html - that's old annotation, but works fine with metadata files.

added the potential bug here helidon-io/helidon#10936 . maybe there is some workaround.

@akugal
Copy link
Copy Markdown

akugal commented Dec 15, 2025

@ivanguravel, I don't have the full context, but did you try to modify pbj-core/pbj-grpc-helidon-config/build.gradle.kts annotation processors list to have a similar fix like here?

@ivanguravel
Copy link
Copy Markdown
Contributor Author

@akugal no, but I will try

@anthony-swirldslabs
Copy link
Copy Markdown
Contributor

@ivanguravel it appears that you have unsigned commits which prevents this PR from merging. Could you please sign the commits?

@ivanguravel ivanguravel force-pushed the fix-helidon-feature-metadata branch from ca63204 to 4e4bbd6 Compare December 15, 2025 20:09
@ivanguravel
Copy link
Copy Markdown
Contributor Author

@anthony-swirldslabs that's done.

@anthony-swirldslabs
Copy link
Copy Markdown
Contributor

  • Commits must have verified signatures.

GitHub still says Commits must have verified signatures. though. Are you sure you're running git commit -S -s -m "..." to sign your commits? Note the double s - both capital and lower case.

Replace deprecated @Features.* annotations with @feature annotation to fix
IllegalStateException on startup caused by missing module name in generated
feature-metadata.properties.

* Replace @Features.Preview with @Preview annotation
* Replace @Features.Name, Description, Flavor, Path with @feature
* Match annotation pattern used in pbj-grpc-helidon module

Fixes: hiero-ledger/hiero-block-node#1964
Signed-off-by: Ivan Zhuravel <ivanguravel@gmail.com>
@ivanguravel ivanguravel force-pushed the fix-helidon-feature-metadata branch from 4e4bbd6 to 9ca3fb5 Compare December 15, 2025 22:29
@ivanguravel
Copy link
Copy Markdown
Contributor Author

@anthony-swirldslabs ok. you are about gpg.... I thought about Signed-off-by. nm. It's verified

@anthony-swirldslabs anthony-swirldslabs merged commit e0b3f4e into hashgraph:main Dec 15, 2025
10 checks passed
@anthony-swirldslabs
Copy link
Copy Markdown
Contributor

@ivanguravel Thanks! I just merged it. The fix is being released in PBJ v0.13.1 as we speak (it should be available in Maven in about 20 minutes.)

@ivanguravel
Copy link
Copy Markdown
Contributor Author

@anthony-swirldslabs
I updated the lib locally and rebuild the image using: ./gradlew :block-node-app:build --refresh-dependencies && ./gradlew createDockerImage startDockerContainer - issue was gone (see the screen)

Снимок экрана 2025-12-16 в 10 22 45

on the other hand seems like some additional changes have been added into the repo and I did one more fix for the build procedure itself -> org.hiero.block.node.stream.publisher.PublisherHandler.java

line 374:

default -> {
                final String message = "Handler %d received EndStream with code %s. %s"
                        .formatted(handlerId, code, earliestAndLatestBlockNumbers);
                yield handleEndStream(DEBUG, message);
            }

could you please tell me if it's ok to update the hiero-block-node with a new version of the lib and this small fix?

@anthony-swirldslabs
Copy link
Copy Markdown
Contributor

@ivanguravel Thanks for confirming that the PBJ fix works for you!
As for a change in the org.hiero.block.node.stream.publisher.PublisherHandler.java , I presume you want to bring it up with the Block Node team. This code isn't owned by PBJ.

@ivanguravel
Copy link
Copy Markdown
Contributor Author

@anthony-swirldslabs
Copy link
Copy Markdown
Contributor

@ivanguravel thanks!

@ivanguravel
Copy link
Copy Markdown
Contributor Author

Hello @anthony-swirldslabs

In terms of the following info from the helidon side helidon-io/helidon#10936 (comment) I'm wondering if I should find another way how to resolve that issue with the config exception ?

@anthony-swirldslabs
Copy link
Copy Markdown
Contributor

@ivanguravel : Yes, that would be great. Per the reply from Helidon, it sounds like the best approach would be to switch back to the new annotations (that we used before this PR) AND replace the old processor with the new codegen module. It seems like we just were missing this second part in order to make the new annotations work.

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

Successfully merging this pull request may close these issues.

IllegalStateException on Block Node Startup

3 participants