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

Example in readme breaks non feign-form clients #26

Closed
psxpaul opened this Issue Nov 1, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@psxpaul

psxpaul commented Nov 1, 2017

The example in the readme to include:

@configuration
public class MultipartSupportConfig {
...
}

Breaks other feign clients that do need feign-form. The relevant part of the stacktrace is:

feign.codec.EncodeException: class com.concur.ais.cloudelements.model.ElementInstance is not a type supported by this encoder.
at feign.codec.Encoder$Default.encode(Encoder.java:90)
at feign.form.spring.SpringFormEncoder.encode(SpringFormEncoder.java:35)
at feign.ReflectiveFeign$BuildEncodedTemplateFromArgs.resolve(ReflectiveFeign.java:351)
at feign.ReflectiveFeign$BuildTemplateByResolvingArgs.create(ReflectiveFeign.java:213)
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:72)
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:103)
at com.sun.proxy.$Proxy125.createInstance(Unknown Source)

The Spring documentation here indicates that the @configuration annotation is not needed, and actually harmful if the class is included in ComponentScanning:

FooConfiguration does not need to be annotated with @configuration. However, if it is, then take care to exclude it from any @componentscan that would otherwise include this configuration as it will become the default source for feign.Decoder, feign.Encoder, feign.Contract, etc., when specified. This can be avoided by putting it in a separate, non-overlapping package from any @componentscan or @SpringBootApplication, or it can be explicitly excluded in @componentscan.

@xxlabaza xxlabaza added the enhancement label Nov 2, 2017

@xxlabaza xxlabaza self-assigned this Nov 2, 2017

@xxlabaza

This comment has been minimized.

Show comment
Hide comment
@xxlabaza

xxlabaza Nov 2, 2017

Collaborator

Thanks a lot for your comment, I will fix readme asap

Collaborator

xxlabaza commented Nov 2, 2017

Thanks a lot for your comment, I will fix readme asap

@xxlabaza

This comment has been minimized.

Show comment
Hide comment
@xxlabaza

xxlabaza Nov 24, 2017

Collaborator

done

Collaborator

xxlabaza commented Nov 24, 2017

done

@xxlabaza xxlabaza closed this Nov 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment