Announcement Announcement Module
Collapse
No announcement yet.
Beginner: How to call from war to ejb.jar Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Beginner: How to call from war to ejb.jar

    We are using JBoss and Spring 1.2.2.

    We currently have a war, ejb.jar and a sar archive.
    Each have it's own ApplicationContext.

    The sar has an XMBean
    The ejb.jar has an JMS MDB
    The war has some AXIS WebServices

    The MDB in the ejb.jar is thin and is delegating its omMessages to a Spring service (normal bean).

    My question is how do i call this SpringService bean within the ejb.jar from either my war or my sar ?

    We are currently using SpringRemoting with RMI but is this really the only way ?

    Another thing is that the MDB and thouse the Spring ApplicationContext isn't initialized until the first JMS message, therefor we are unable to call any SpringBeans within the ejb.jar until so.

    Please help a spring and j2ee beginner so he can get some sleep.

  • #2
    Re: Beginner: How to call from war to ejb.jar

    Originally posted by bugsy
    We are currently using SpringRemoting with RMI but is this really the only way ?
    Lord, no!

    Your quickest solution here is to package your sar, ejb, and war into an ear.

    If it is OK for the war and the sar to work with their own copy of the Spring Services, then you can just add the ejb context definition file to the list of files that comprise your war and sar application contexts, and you are done.

    If this is not OK (sar, ejb, and war need to operate on the same instance of your services), then you will probably want to use ContextSingletonBeanFactoryLocator to share the application context among all of your components.

    If you get pretty hardcore about Spring, you may eventually run into problems with ContextSingletonBeanFactoryLocator. The longer term solution here would be to convert your sar into POJOs deployed as JMX components, and to convert your ejb into message-driven POJOs. Now everything can be deployed into a war, and you can eliminate the ear, sar, and ejb. (If this is overkill for your needs, don't worry about it)

    Comment

    Working...
    X