Skip to content
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

Spring 4.1 and Integration 4.0.4 results in Caused by: java.lang.NoClassDefFoundError: com/rometools/rome/io/FeedException using HttpRequestHandlingEndpointSupport [INT-3517] #7482

Closed
spring-operator opened this issue Sep 10, 2014 · 3 comments
Assignees
Milestone

Comments

@spring-operator
Copy link
Contributor

Andrew Tulloch opened INT-3517* and commented

Using Spring Integration 4.0.4 in combination with Spring Framework 4.1.x results in the following exception:

Caused by: java.lang.NoClassDefFoundError: com/rometools/rome/io/FeedException
	at org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport.<init>(HttpRequestHandlingEndpointSupport.java:185) ~[spring-integration-http-4.0.4.RELEASE.jar:?]
	at org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway.<init>(HttpRequestHandlingMessagingGateway.java:72) ~[spring-integration-http-4.0.4.RELEASE.jar:?]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_20]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_20]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_20]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:408) ~[?:1.8.0_20]
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:125) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:270) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE]
	... 27 more

This seems to be caused by the conditional on L184:

if ((spring41Present && romeToolsPresent) || romePresent) {

Should be:

if ((spring41Present && romeToolsPresent) || (!spring41Present && romePresent)) {

as romePresent is true causing the attempt to create an instance of AtomFeedHttpMessageConverter, but this actually requires romeToolsPresent to be true (which it isn't in my case) where spring41Present is true as the implementation in Spring 4.1 uses.


Affects: 4.0.4

Referenced from: pull request #1275

@spring-operator
Copy link
Contributor Author

Artem Bilan commented

OK. Thank you for pointing that out.
We definitely must fix it as you suggest, but I'm really not sure that it is so critical.

If you aren't just interested in AtomFeedHttpMessageConverter you can remove rome-fetcher jar from your classpath.
From other side, if you need it and you use Spring 4.1 the message from that exception exactly says what is wrong.

Something similar we get when want to use <object-to-json-transformer>, but don't have Jackson in the classpath.

@spring-operator
Copy link
Contributor Author

Gary Russell commented

Done

@spring-operator
Copy link
Contributor Author

Andrew Tulloch commented

You're right, the dependency tree looks like this:
noformat
[INFO] +- org.springframework.integration:spring-integration-http:jar:4.0.4.RELEASE:compile
[INFO] | +- org.springframework:spring-webmvc:jar:4.1.0.RELEASE:compile
[INFO] | | +- org.springframework:spring-beans:jar:4.1.0.RELEASE:compile
[INFO] | | +- org.springframework:spring-expression:jar:4.1.0.RELEASE:compile
[INFO] | | - org.springframework:spring-web:jar:4.1.0.RELEASE:compile
[INFO] | - net.java.dev.rome:rome-fetcher:jar:1.0.0:compile
noformat

so I can exclude rome-fetcher from spring-integration-http.

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

No branches or pull requests

2 participants