Ryan Stull Ryan Stull - 2 months ago 9
Java Question

Can't set "input-channel" on service-activator in spring integration?

I'm trying to run some tests with spring integration and I'm running into this strange error.

enter image description here

It's telling me I can't have an

input-channel
on a service-activator, but I've done this several times before, and in the documentation it's used all over the place.

Here's my namespace config.

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:file="http://www.springframework.org/schema/integration/file"
xmlns:feed="http://www.springframework.org/schema/integration/feed"
xmlns:jms="http://www.springframework.org/schema/integration/jms"
xsi:schemaLocation="http://www.springframework.org/schema/integration/feed http://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
http://www.springframework.org/schema/integration/jms http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd">

Answer

That is problem if your IDE. Looks like it Eclipse.

Try to switch on the Spring Nature for your project.

Or just disagree with it and go ahead with development.

The runtime will tell you properly if you are not right.

On the other hand consider to move away from XML configuration in favor of Java DSL and/or Annotation support.

And yes, try to upgrade to the latest version - 2.0.0.RC1 is very-very old.