Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why the stubs are only present in EJB module & not in Web Module?

 
prasad kulkarni
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have read out that the stubs are pesent at client as well as server side. I have a j2ee project with 1 one web module & one EJB module. When I depolyed the EJB's the stubs are generated only in EJB moduls package & not in the web modules packages. Why this is so ? If my Web module is acting as client to the EJB module, the stubs should be present in the Web module packages also.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's your responsibility.
You were deploying the EJB module into the server, there's no way the deploytool will know which applications will need to receive the stubs.

So you will have to manually add the stubs to your web project.

How else could it work? That web module could well be deployed a year or more later to a webserver halfway around the world that doesn't even exist yet.
 
Andreas Schaefer
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just as a tip try using JBoss and you are never worrying about stubs anymore.

-Andy
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wrong tip.
You should always learn to do things by the standard rather than learning some serverspecific trickery.

Prevent vendor lockin, don't get sucked into relying on one specific tool.
 
Andreas Schaefer
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not quite sure what Jeroen means with standard because there is no standard. It strucks me that there is a need to use any custom stubs when there is a proven way to deal without using proxies. Stubs are not only a pain because they need to bundled with the client but quite often they are not made available until the application is deployed (see Sun's app server).

I agree with Jeroen that one should learn the basics which here means that when you deserialize objects that you need to make no only the interfaces available but also the implementing class(es).

-Andy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic