-
Notifications
You must be signed in to change notification settings - Fork 12
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
NoSuchFieldError: Companion
when packaged in WAR
#51
Comments
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? |
Could you confirm the
It seems to explicitly conflict with the transitive dependencies of Is this strongly related to #50 ? If |
Please try this way to resolve it:
|
Thanks very much for your reply. Is that the Spring 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 The cleanest fix I have found is to update your dependencies:
|
Hi all, Faced the same issue with Spring Boot.
Issue is throws on the first line
Fixed by adding maven dependency (#51 (comment)) |
Funnily, Mailjet does have a similiar problem: mailjet/mailjet-apiv3-java#184 |
Problem is still present. Fix as of today is: <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.6.0</version>
</dependency> Any chance to make a new minor release to fix that issue plz? @sendinblue @getbrevo I'd be happy to make a PR if you can make that happen 😄 |
solved by adding this into dependencies
|
We've added
sib-api-v3-sdk
to an older project using Maven served on tomcat 7.When run with
mvn clean tomcat7:run
everything seems fine.Packaged as a war
mvn clean tomcat7:run-war
it fails with:Attaching a debugger and evaluating
Configuration.getDefaultApiClient();
gives:Looking at
mvn dependency:tree
:All the jars are present in the war file
WEB_INF/lib/
and there don't appear to be differing versions aside from those requested above.Any suggestions?
It's a frustrating issue and it seems a waste of time to bypass your library and go direct to the API even though we would then get proper typing and far fewer dependencies ;-)
Targeting language level 1.8 on OpenJDK-11
The text was updated successfully, but these errors were encountered: