-
Dec 21st, 2011, 05:13 AM
#1
spring integration spring-integration-2.1.0.RC1
Hello,
1. Kindly let me know about a good link explains about channels, service activators, inbound - outbound with sample configurations.
2. While trying sample code for spring integration gives an error of "no such method" - looks like some jar is missing - not suire which one. Added all jars which comes with download of spring integration spring-integration-2.1.0.RC1.
code is below
public class HelloWorldApp {
private static Logger logger = Logger.getLogger(HelloWorldApp.class);
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext(
"dd/helloworlddemo.xml");
MessageChannel inputChannel = (MessageChannel) context.getBean(
"inputChannel", MessageChannel.class);
PollableChannel outputChannel = (PollableChannel) context.getBean(
"outputChannel", PollableChannel.class);
inputChannel.send(new GenericMessage<String>("World"));
logger.info("==> HelloWorldDemo: "
+ outputChannel.receive(0).getPayload());
}
}
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schem...ring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd">
<channel id="inputChannel"/>
<channel id="outputChannel">
<queue capacity="10"/>
</channel>
<service-activator input-channel="inputChannel"
output-channel="outputChannel"
ref="helloService"
method="sayHello"/>
<beans:bean id="helloService" class="com.hcl.sprngintg.HelloService"/>
</beans:beans>
3. Any example which has inbound as file with polling and outbound as JMS message or webservice message will be great.
Thanks
-
Dec 22nd, 2011, 04:16 AM
#2
error (no such method) with spring integration 2.1.0.rc1
Kindly help we are facing same issue - while running spring integration sample - ver 2.1.0.rc1
(1)
Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.beans.factory.support.RootBean Definition.<init>(Ljava/lang/String
V
at org.springframework.integration.config.xml.Default ConfiguringBeanFactoryPostProcessor.registerIdGene ratorConfigurer(DefaultConfiguringBeanFactoryPostP rocessor.java:86)
at org.springframework.integration.config.xml.Default ConfiguringBeanFactoryPostProcessor.postProcessBea nFactory
(2)
import org.springframework.context.support.AbstractApplic ationContext;
import org.springframework.context.support.ClassPathXmlAp plicationContext;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMes sage;
public class Simple {
public static void main(String[] args) {
AbstractApplicationContext context = null;
context = new ClassPathXmlApplicationContext("dd/simple.xml");
MessageChannel inChannel = (MessageChannel) context.getBean("numberChannel");
inChannel.send(new GenericMessage<String>("5"));
}
}
(3)
<?xml version="1.0" encoding="UTF-8"?>
<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"
xsi:schemaLocation="http://www.springframework.org/schema/integration
http://www.springframework.org/schem...ntegration.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<int:channel id="stringOrNumberChannel" datatype="java.lang.String,java.lang.Number" />
</beans>
(4) how does service activator work?? What is the difference between gateway and adapter???
thanks
-
Dec 22nd, 2011, 08:13 AM
#3
1. The reference manual is an excellent source of information you'll need
2. The github link for the samples has numerous samples which can help you understand things better.
3. Regarding the exception, what version of spring are you using?
4. While posting, post all you code between the [ CODE ] [/ CODE ] (without the spaces) tags
-
Dec 22nd, 2011, 10:47 PM
#4
Amol,
Answer to your point (3)
3. Regarding the exception, what version of spring are you using?
Jars used ->
spring-integration-core-2.1.0.RC1.jar
spring-integration-file-2.1.0.RC1.jar
commons-logging-1.0.4.jar
spring.jar - ver 3.x
Kindly let me know correct combination/versions of jars to be used.
Query -> How does integration between inbound and outbound channel happen? Is it using service activator? Apologies if my question is basic. My doubt we specify different channels for inbound / outbound but still message flow.
Thanks
-
Dec 22nd, 2011, 10:56 PM
#5
Amol please find stubs giving exception (nosuchmethod) with above jars
Please try from your side and let us know.
--------------------------------------------------
<code>
import org.springframework.context.support.AbstractApplic ationContext;
import org.springframework.context.support.ClassPathXmlAp plicationContext;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.message.GenericMes sage;
public class Simple {
public static void main(String[] args) {
AbstractApplicationContext context = null;
context = new ClassPathXmlApplicationContext("dd/simple.xml");
MessageChannel inChannel = (MessageChannel) context.getBean("stringOrNumberChannel");
inChannel.send(new GenericMessage<String>("5"));
}
}
</code>
--------------------------------------------------
--------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<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"
xsi:schemaLocation="http://www.springframework.org/schema/integration
http://www.springframework.org/schem...ntegration.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<int:channel id="stringOrNumberChannel" datatype="java.lang.String,java.lang.Number" />
</beans>
--------------------------------------------------
Thanks
-
Dec 22nd, 2011, 11:04 PM
#6
Looking at your exception I am not sure that your are using Spring 3.x. In fact the exception tells me that you are using Spring 2.5.x since version 3.0 of RootBeanDefinition definitely has a constructor that takes String. So you might be using the wrong version of Spring or you may have two versions on the classpath
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules