-
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
Remove illegal refletive access warning for xstream for parameterized tests #10303
Comments
See #10271 |
This should be mostly fixed in But if it's not, then I can look into fixing it upstream. |
It does not appear in 1.6.0.CR1 for me. In 1.5.x I could observe it immediately after adding any |
Hm, I am able to provoke this in 1.6.1.Final via: public class FooParamResover implements ParameterResolver {
@Override
public boolean supportsParameter(final ParameterContext parameterContext, final ExtensionContext extensionContext) throws ParameterResolutionException {
return parameterContext.getParameter().getType() == Foo.class;
}
@Override
public Foo resolveParameter(final ParameterContext parameterContext, final ExtensionContext extensionContext) throws ParameterResolutionException {
return new Foo();
}
} public class Foo {
public String get() {
return CDI.current().select(SomeBean.class).get().toString();
}
} @Test
public void test(final Foo foo) {
System.err.println(foo.get());
} PS: The resolver is registered via Reopen XOR new ticket? |
Indeed that does provoke the message (it's known). The problem used to be that the message was shown whether or not the was a parameter resolver. I'd say reopen the issue but adjust the title. |
I am not allowed to change the title so I'd kindly ask you @geoand or @emmanuelbernard to do this. Thanks! Btw, it has nothing to do with the CDI lookup (just checked), but you certainly knew that already. 😉 |
Do we need a reproducer or is it obvious? |
Nah, I think it's obvious. The fix of course needs to be upstream in the xstream project |
I fear that route doesn't look very promising: x-stream/xstream#101 |
I took a stab at this upstream: x-stream/xstream#216 This won't help for certain scenarios (e.g. if your parameter class contains a Now lets hope it gets merged and released soon. |
That's great! Let's see what happens |
Until a new release of xstream (which might take a long time), we could work around this in Quarkus by registering our own list of converters. Just saying. |
Yeah, if the release don't come soon, I'll let you do a PR for that :) |
Workaround until then:
(yes, even AWT) |
Update: My changes were merged into xstream master but since 1.5 seems to take more time, I've created another PR against the 1.4 branch. |
1.4.13 is out (but not yet on central): https://github.com/x-stream/xstream/releases/tag/XSTREAM_1_4_13 <dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<!-- Avoid adding this to the BOM / Version has to be kept in sync with what optaplanner uses otherwise the enforcer complains -->
<version>1.4.11.1</version>
</dependency> |
Good thing is that octaplanner is no longer part of the core, so we shouldn't have any problems |
Fixes quarkusio#10303 for some cases when using JUnit5 ParameterResolver. Includes x-stream/xstream#218 that tries to avoid such warnings at XStream creation time. Also adds xstream to dependabot. Comment regardings optaplanner was outdated.
Does xstream work with native mode quarkus? Because i had classloading issues with its own custom class loader .... |
Is that the problem? I met it, too. How did you solve it? Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.core.util.TypedNull |
Hello. I didn't, I just gave up on xstream. Libraries that do serialisation are hard to just use in native mode, usually need some kind of conversion.
Obtenir Outlook pour Android<https://aka.ms/AAb9ysg>
…________________________________
From: Chuang ***@***.***>
Sent: Tuesday, June 28, 2022 5:03:49 AM
To: quarkusio/quarkus ***@***.***>
Cc: Adrian Ciobanu ***@***.***>; Comment ***@***.***>
Subject: Re: [quarkusio/quarkus] Remove illegal refletive access warning for xstream for parameterized tests (#10303)
Does xstream work with native mode quarkus? Because i had classloading issues with its own custom class loader ....
Is that the problem? I met it, too. How did you solve it?
Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.core.util.TypedNull
Caused by: java.lang.NoClassDefFoundError
—
Reply to this email directly, view it on GitHub<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fquarkusio%2Fquarkus%2Fissues%2F10303%23issuecomment-1168124479&data=05%7C01%7C%7C05d9a139b03a4ae8b01108da58aa71cb%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637919786325770655%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1Y0fyxZAW4h%2ForDJrxE32Z4JhLSt6JReoNz7TzyLOsE%3D&reserved=0>, or unsubscribe<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAUHR47ZKEQOPARO6OZAYITVRJMQLANCNFSM4OJJ75GQ&data=05%7C01%7C%7C05d9a139b03a4ae8b01108da58aa71cb%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637919786325770655%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YMLLa7waDJKptw4NevFChCl7VQks1fhEqtk87MLuaIE%3D&reserved=0>.
You are receiving this because you commented.Message ID: ***@***.***>
|
The text was updated successfully, but these errors were encountered: