-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
IllegalAccessError
on @QuarkusTest
when using method in package private interface
#29593
Comments
Hm, I am not sure how is this supposed to work. |
Just tried this with Weld to see if I am missing something obvious but Weld has the exact same issue and it doesn't work there either. @xtaixe BTW you can make this work by avoiding proxy creation - instead of |
- make sure that an interface method of an interface-based client proxy is invoked upon the provider type and not the type that declares the method - fixes quarkusio#29593
This pull request should fix the problem: #29705
You can also make the |
@mkouba I made it public for now, but in my actual case it is a base interface that shouldn't be exposed. The anonymous class was just for the reproducer, in my actual case it's not and it still happens (just in case you need to review the fix). |
It depends on the return type of your producer method - if you keep that as an interface, you'll keep seeing the issue. |
Hm, does your producer method return an implementation class or an interface? I was not quite clear - I meant the return type of the producer method must not be an interface but an impl class (and no anonymous class needed). The return type is the only source of information when we generate a client proxy for a producer method. |
The return type it's an interface and I don't know the actual type (it's created using a builder). So the issue will keep happening even with the fix? |
Nope, the fix should solve the problem. In this case, the workaround mentioned by @manovotn is the only option. |
- make sure that an interface method of an interface-based client proxy is invoked upon the provider type and not the type that declares the method - fixes quarkusio#29593 (cherry picked from commit 4d51083)
Describe the bug
IllegalAccessError
on@QuarkusTest
when using method in package private interface (through a public interface that extends that one)Expected behavior
The test executes.
Actual behavior
IllegalAccessError
exception thrown.How to Reproduce?
Reproducer:
code-with-quarkus.zip
Output of
uname -a
orver
Darwin N4MFM06QYD 21.6.0 Darwin Kernel Version 21.6.0: Thu Sep 29 20:13:56 PDT 2022; root:xnu-8020.240.7~1/RELEASE_ARM64_T6000 arm64
Output of
java -version
openjdk version "17.0.4" 2022-07-19 OpenJDK Runtime Environment GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06) OpenJDK 64-Bit Server VM GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.14.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63) Maven home: /Users/xtaixe/.m2/wrapper/dists/apache-maven-3.8.6-bin/67568434/apache-maven-3.8.6 Java version: 17.0.4, vendor: GraalVM Community, runtime: /Library/Java/JavaVirtualMachines/graalvm-ce-java17-22.2.0/Contents/Home Default locale: en_ES, platform encoding: UTF-8 OS name: "mac os x", version: "12.6.1", arch: "aarch64", family: "mac"
Additional information
No response
The text was updated successfully, but these errors were encountered: