Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

I thought EJB was supposed to loosely couple with Client?  RSS feed

 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why when i run a client application (taking from Richard Monson-Haefel's book and using JBoss), do I have to include a whole ton of JBoss jars in my client's classpath? This makes EJB useless!
For example, I can't instantiate a JNDI Initial context without "org.jnp.interface.NamingContextFactory" being in my classpath! What?! I thought it could download that dynamically. And I don't have any JBoss stuff in my classpath, so that shouldn't cause problems. Anyone know what I'm doing wrong?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you need to include some "interfacing" classes in the client too. But this doesn't really differ from any other remote method call approach - you always need the stub/skeleton/interface unless you're dealing with a self-written protocol reading/writing socket streams.
I am not aware of which .jar files should you include at your client.
 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I know I need to include interfaces to my client and whatnot. But why do they need JBoss's JNDI classes and Logging classes (and 22 other jars)? Shouldn't all that be dynamically downloaded from a codebase? I have to manually give my clients a whole number of jars for whatever SERVER I'm using? That's nuts! What if I have 50 clients? 300? I have to deliver 24 JBoss-specific jars to every one of them?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. You only get dynamic downloading with Applets... Applications are meant to be self-contained...
Kyle
 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kyle! Actually, you get it in Jini as well - which is a distributed component architecture. In jini, you set the codebase for your classes, and then the Java classloaders will load it from there (usually an http server, but you're not restricted to that). It does not introduce anything new to do this either, this capability has been in java for years. Too bad they didn't do this with EJBs. Think of how great it would be to only have to deliver your bean interfaces and the rest (i.e. server specific code) is downloaded by the classloader.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup. I had forgotten about Jini. It contained that and a lot of other good ideas that never caught on...
Kyle
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Robert,
Maybe the HTML interface could be a good alternative.
Then EJB stuff remains on the server, while the client (browser) invokes the remote objects thru a simple interface. And you do not need to update manually your 300 clients.
 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bill -
That only works for human clients. What about partner companies that need to be a part of the process, or use my processing backend to complete their transactions? They should be able to hook their systems up to mine no problem. However, with the current way of doing things, if I ever do change from JBoss to something else (or even versions of JBoss) they may have to update a whole bunch of jars they'll need for EVERY server they have connecting. Ridiculous.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No -- that's what you use SOAP for. It doesn't require a gazillion JAR files -- just a client that speaks SOAP/HTTP. It also works with Mickeysoft clients/partners, which EJB has no hope of doing...
Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!