-
Notifications
You must be signed in to change notification settings - Fork 48
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
ConcurrentModificationException at apache-cxf #184
Comments
I fixed it by replacing the rather poor cxf library with jersey client. |
thank you for reporting this! Yes, looks like CXF is not thread safe. A fix should be released soon |
Thank you. I changed my dependencies this way and it seems to work:
With jersey I don't have these multithreading problems. I'm not sure if it's a good idea to synchronize the access at an unknown amount of positions because a rs-implementation is poorly implemented. |
Yeah the standard is also not clear on what should be thread safe or not, looks like there is an open issue regarding this: jakartaee/rest#494 I'm not sure if other implementations are thread safe, so it's probably better to add synchronization around the By default we use CXF since it usually has better performance, but it's true that sometimes we may run into tricky issues like this. By the way, when using a different RS implementation, we recommend to enable message compression for better performance. For example, this works for Jersey and 13.0.20.1: GlobalSettings.setHttpClientProvider(new HttpClientProvider()
{
@Override
protected ClientBuilder configureClientBuilder(ClientBuilder clientBuilder) {
return super.configureClientBuilder(clientBuilder)
.register(org.glassfish.jersey.message.GZipEncoder.class)
.register(org.glassfish.jersey.client.filter.EncodingFilter.class);
}
}); |
I'm getting this error (slightly different place) in bingads 13.0.22.1. Did the fix from 13.0.20.1 not generalize?
|
I would recommend using the jersey client. cxf is crap and not thread safe. synchronizing every call to cxf would make the bingads api not multi-threading capable anymore. I completely switched to jersey and have no concurrency problems anymore. unfortunately, to completely remove cxf, I needed a local hack that has to persist until #203 is fixed. |
Thank you Christian. Yeah, I don't want to synchronize calls bc I'm
intentionally multithreading them since I have to do 100s within a short
period of time.
…On Wed, Nov 13, 2024 at 2:30 AM Christian Habermehl < ***@***.***> wrote:
I would recommend using the jersey client. cxf is crap and not thread
safe. synchronizing every call to cxf would make the bingads api not
multi-threading capable anymore. I completely switched to jersey and have
no concurrency problems anymore. unfortunately, to completely remove cxf, I
needed a local hack that has to persist until #203
<#203> is fixed.
—
Reply to this email directly, view it on GitHub
<#184 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADUGD6JCEIXE6KQWOKIKMD2AL5ZBAVCNFSM6AAAAABHDUUJTCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZSGY4DQOJSHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
After switching to 13.0.20 I sometimes get this the exception
it seems the ProviderFactory isn't thread safe. would it be possible to put the access to WebTarget within a synchronized block?
The text was updated successfully, but these errors were encountered: