Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: spring within jboss container

  1. #1
    Join Date
    Feb 2012
    Posts
    101

    Default 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

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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?

  3. #3
    Join Date
    Feb 2012
    Posts
    101

    Default

    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

  4. #4
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    can you show your configuration and code that triggers NPE?

  5. #5
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Also, have you gone through our samples? There are quite a few container based samples there.

  6. #6
    Join Date
    Feb 2012
    Posts
    101

    Default

    Please point to the exact example for the container based samples.

  7. #7
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    '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

  8. #8
    Join Date
    Feb 2012
    Posts
    101

    Default

    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

  9. #9
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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.

  10. #10
    Join Date
    Feb 2012
    Posts
    101

    Default

    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
  •