-
May 9th, 2012, 06:02 AM
#1
spring within jboss container
Hi,
I have some doubts with spring integrated in jboss.
There are many application context xml files.
I'm using @Inject to inject a bean.
Now if my xml has spring integration modules like "ftp -channel addapter" , there is no bean but I have to resolve the channels in the adapters.
For this purpose I need the application contxt and I think I should be using BeanFactoryChannelResolver to pass the application context and then use the channel resolver.
How do I get the application context.
Any help is appreciated.
Thanks
-
May 9th, 2012, 06:09 AM
#2
Every namespace-based component (e.g., channel, adapter, filter etc.) is a bean. So if it has an ID you can inject it anywhere you want as any other bean.
When you say many application context do you actually mean cross-application context communication (e.g., many different WARs) or many application context configuration files?
-
May 9th, 2012, 06:22 AM
#3
one war file but many application context files.
So for SFTpSessionFactory I used @inject sftpsessionfactory and for sftp channel id I used
@Inject MessageChannel <ChannelName> but for the channel name I get null pointer exception
Thanks
-
May 9th, 2012, 06:24 AM
#4
can you show your configuration and code that triggers NPE?
-
May 9th, 2012, 06:25 AM
#5
Also, have you gone through our samples? There are quite a few container based samples there.
-
May 9th, 2012, 07:02 AM
#6
Please point to the exact example for the container based samples.
-
May 9th, 2012, 07:05 AM
#7
'http', 'ws-inbound' etc. Just go through README files and see what the instructions are and any sample that requires a server is what you are looking for
-
May 9th, 2012, 07:25 AM
#8
I saw the http example and I'm using the spring beans to configure the context.xml but in the test demo you seem to be using the ClassPathApplicationConext to get the bean.Please provide pointerss to see how the bean can be injected and how the channels are resolved.
Thanks
-
May 9th, 2012, 07:28 AM
#9
Please read the README file which gives you all the details you need. The demos like HTTP and others alike consists of two parts - server and client to interact with server component. The server part is what's being deployed to JBoss, Websphere, Tomcat or any other Java application server and the client is what talks to the server.
-
May 9th, 2012, 08:37 AM
#10
Please correct me if I'm wrong.
I wasn't able to get to the correct sample.I need to get the reference of the sftp namespace and then get the channel id.i wasnt able to get this information from the samples.
Thanks
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