Announcement Announcement Module
Collapse
No announcement yet.
Swing accessing remote EJB's. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Swing accessing remote EJB's.

    Hi!

    I have a Swing client that should access remote SLSB's. On the server-side I've wired upp my business objects with there dao's and published the business objects using the SimpleRemoteStatelessSessionProxyFactoryBean with business interface pattern.

    But on the client-side, I'm I supposed to do the "usual" business delegate pattern using an InitialContext?

    Isn't there any magical Spring bean that I could define in my clientApplicationContext.xml that does the JNDI lookup of my remote SLSB from a fat client?

    Is creating a business delegate extending JndiTemplate a bad idea? By that way I could configure the delegate by the clientApplicationContext.xml with the right JNDI environment properties. Then I could create a common business delegate interface for non-JNDI and JNDI delegates and only switch the implementation class in the clientApplicationContext.xml.

    Give me your experience and thoughts please!

    Regards, Andreas Eriksson

  • #2
    The Spring proxies use JNDI lookup, so you should just need to set up your InitialContext properties correctly. Please refer to your server documentation for that.

    See http://static.springframework.org/sp...tml#ejb-access for examples. Remote access is pretty much the same as local access, using a different class.

    Comment


    • #3
      Originally posted by Rod Johnson
      The Spring proxies use JNDI lookup, so you should just need to set up your InitialContext properties correctly. Please refer to your server documentation for that.

      See http://static.springframework.org/sp...tml#ejb-access for examples. Remote access is pretty much the same as local access, using a different class.
      Ok, that's right! Making the SLSB accessible from JNDI in the application server is not the problem.

      The problem is; how do I, in the Swing client, get a reference to the SLSB? My Swing client is on another host than the application server.

      Comment


      • #4
        The Simple remote proxy should still work on the client side, so long as you have the requisite client JARs for your server, which you'd need anyway.

        Comment


        • #5
          Originally posted by Rod Johnson
          The Simple remote proxy should still work on the client side, so long as you have the requisite client JARs for your server, which you'd need anyway.
          Ok! I'll just look into it.

          Didn't understand how to configure the InitialContext in the Simple remote proxy. Soon I will (hopefully) :-)

          Thanks for your most appreciated help!

          Regards, Andreas Eriksson

          Comment


          • #6
            You can configure InitialContext using jndi.properties: that's probably simplest, and is J2EE standard.

            Comment


            • #7
              Rod,

              Can you give some examples in your document for remote EJB access? Which jar files should be in the classpath, example content for jndi.properties when using WebSphere? It is simple for you but for people to start with Spring without EJB experience, it is extremely helpful.

              Thanks

              Comment


              • #8
                That's highly app server specific stuff. Lookup your app server documentation for required client jars and properties, add spring.jar and that's it.

                Comment

                Working...
                X