File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Why the stubs are only present in EJB module & not in Web Module? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Why the stubs are only present in EJB module & not in Web Module?" Watch "Why the stubs are only present in EJB module & not in Web Module?" New topic
Author

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

prasad kulkarni
Ranch Hand

Joined: Mar 19, 2006
Posts: 66
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.


scjp, scwcd
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
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.


42
Andreas Schaefer
Ranch Hand

Joined: Feb 13, 2006
Posts: 63
Just as a tip try using JBoss and you are never worrying about stubs anymore.

-Andy
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
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

Joined: Feb 13, 2006
Posts: 63
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why the stubs are only present in EJB module & not in Web Module?