Comments (6)
Thanks very much for your reply.
Is that the Spring @Bean
annotation?
We are not using Spring and the example I gave is the simplest packaging possible of your library on Tomcat (Just 3 small files).
Please let me know which @Bean
annotation it is so I can give it a try.
The cleanest fix I have found is to update your dependencies:
<!-- Brevo mailinglist integration -->
<dependency>
<groupId>com.sendinblue</groupId>
<artifactId>sib-api-v3-sdk</artifactId>
<version>7.0.0</version>
<exclusions>
<exclusion>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>3.0.0</version>
</dependency>
from apiv3-java-library.
Please see https://github.com/PeterTrotter/brevo-tomcat-7 as a minimal example of the library failing when run packed in a war file on tomcat 7.
Any thoughts as to what might be causing this / solutions?
from apiv3-java-library.
Could you confirm the okio
version is as expected:
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>1.14.0</version>
</dependency>
It seems to explicitly conflict with the transitive dependencies of com.squareup.okhttp3:okhttp:jar:4.10.0
, specifically com.squareup.okio:okio-jvm:jar:3.0.0
.
Is this strongly related to #50 ?
If okio
is required it looks like the problem is that the release 6 months ago updated okhttp-version
but not okio-version
when the two are related.
from apiv3-java-library.
Please try this way to resolve it:
#1 Install okhttp package
<dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> <version>4.9.1</version> </dependency>
@Bean
public OkHttpClient okHttpClient() {
return new OkHttpClient.Builder()
.readTimeout(60, TimeUnit.SECONDS)
.connectTimeout(60, TimeUnit.SECONDS)
.build();
}
from apiv3-java-library.
Hi all,
Faced the same issue with Spring Boot.
@Bean
public ApiClient apiClient(@Value("${brevo.api-key}") String brevoApiKey) {
ApiClient defaultClient = new ApiClient();
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey(brevoApiKey);
return defaultClient;
}
Issue is throws on the first line new ApiClient()
Caused by: java.lang.NoSuchFieldError: Class okio.Options does not have member field 'okio.Options$Companion Companion'
at okhttp3.internal.Util.<clinit>(Util.kt:70)
at okhttp3.OkHttpClient.<clinit>(OkHttpClient.kt:1073)
at sendinblue.ApiClient.<init>(ApiClient.java:80)
Fixed by adding maven dependency (#51 (comment))
from apiv3-java-library.
Funnily, Mailjet does have a similiar problem: mailjet/mailjet-apiv3-java#184
from apiv3-java-library.
Related Issues (20)
- Error when calling campaignApi.getEmailCampaign(id) for campaign without scheduled date HOT 2
- Example Fails HOT 1
- UpdateContact, boolean attributes are not updating HOT 3
- apiInstance.getTransacEmailContent allways returning NotFound exception HOT 1
- Example Code for sendTransacEmail not working HOT 4
- OSGI Support HOT 1
- When sending transaction email, params are not taken into account HOT 2
- How to disable HTTP logs HOT 3
- Non-typed return values for a few of your api calls HOT 4
- Use htmlContent on MessageVersions
- Please update Gson dependency HOT 2
- Update maven-gpg-plugin to avoid CVE-2017-1000487
- Deprecated function: Return type of SendinBlue\Client\Model\CreateContact::offsetExists($offset)
- Issue when migrating to okhttp3
- CreateContact model is missing "ext_id" HOT 2
- Fix your dependencies, please! HOT 1
- Whatsapp fecha sozinho
- How to send an email HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apiv3-java-library.