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

SpringComponentProvider in jersey-spring6 never binds components #5093

Closed
wilkinsona opened this issue Jun 27, 2022 · 3 comments
Closed

SpringComponentProvider in jersey-spring6 never binds components #5093

wilkinsona opened this issue Jun 27, 2022 · 3 comments
Assignees
Milestone

Comments

@wilkinsona
Copy link

It would appear that the jersey-spring6 artifact on Maven Central contains the result of compiling https://github.com/eclipse-ee4j/jersey/blob/3.x/ext/spring6/src/main/javaPre17/org/glassfish/jersey/server/spring/SpringComponentProvider.java rather than https://github.com/eclipse-ee4j/jersey/blob/3.x/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/SpringComponentProvider.java. I believe it needs to contain the result of compiling the latter to work correctly.

Looking at the bytecode using javap confirms that bind is hardcoded to return false:

javap -v -cp /Users/awilkinson/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.ext/jersey-spring6/3.0.5/a3152fed45ab33faa41f9f6e3ed5edc238b4623e/jersey-spring6-3.0.5.jar org.glassfish.jersey.server.spring.SpringComponentProvider
Classfile jar:file:///Users/awilkinson/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.ext/jersey-spring6/3.0.5/a3152fed45ab33faa41f9f6e3ed5edc238b4623e/jersey-spring6-3.0.5.jar!/org/glassfish/jersey/server/spring/SpringComponentProvider.class
  Last modified 15 Jun 2022; size 1487 bytes
  SHA-256 checksum b9b42b44844fdc0b4b85732d6702bef08e19beff7bc8c05c95092855a554e487
  Compiled from "SpringComponentProvider.java"
  
  …
  
  public boolean bind(java.lang.Class<?>, java.util.Set<java.lang.Class<?>>);
    descriptor: (Ljava/lang/Class;Ljava/util/Set;)Z
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=1, locals=3, args_size=3
         0: iconst_0
         1: ireturn
      LineNumberTable:
        line 43: 0
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
            0       2     0  this   Lorg/glassfish/jersey/server/spring/SpringComponentProvider;
            0       2     1 component   Ljava/lang/Class;
            0       2     2 providerContracts   Ljava/util/Set;
      LocalVariableTypeTable:
        Start  Length  Slot  Name   Signature
            0       2     1 component   Ljava/lang/Class<*>;
            0       2     2 providerContracts   Ljava/util/Set<Ljava/lang/Class<*>;>;
    Signature: #32                          // (Ljava/lang/Class<*>;Ljava/util/Set<Ljava/lang/Class<*>;>;)Z
@senivam
Copy link
Contributor

senivam commented Jun 28, 2022

thank you for reporting that. You are right. This shall be added to the multi-release jar. It requires modification of the release script.

@senivam senivam self-assigned this Jun 28, 2022
@senivam senivam added this to the 3.0.6 milestone Jun 28, 2022
@senivam
Copy link
Contributor

senivam commented Jun 28, 2022

Release script is modified (for Jakarta Jersey 9 and 10) and will be available since the next release (3.0.6 and 3.1.0 respectively)

@senivam senivam closed this as completed Jun 28, 2022
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

3 participants