• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

WSAD and Web Projects

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
Is it true that a web project cannot depend on another web project. I have two web projects, lets call it WebProjA and WebProjB. There is a servlet in my WebProjB which extends from another servlet in WebProjA. It compiles fine, but when I access the WebProjB's servlet it tells me that it cannot find the servlet in WebProjA. I am using WSAD and I am not able to figure this out.
Is it true that a web project cannot depend on another web project. Both web projects reside in the same EAR or are associated with the same EAR.
Please help!
Thanks
semplice
 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
This is a classloader problem. As far as I'm aware, each WAR will have a separate classloader and consequently be unable to load classes in another WAR - even if it is in the same application (EAR). The way around this is to create a jar of 'common' classes that all the EJBs and WARs in an application use. As long as your scope (module visibility of the application server)is set to 'Application' the other modules should be able to see all files in the common jar. We've used this approach to share common classes between the EJB modules and a single WAR module - though I suspect that its the same principal if there are multiple WARs.
Its probably worth investigating how WAS loads classes - look in the WAS 4.0 Handbook from RedBooks.
Also, there is a recent article here that may shed some light on it:
http://www.theserverside.com/resources/article.jsp?l=ClassLoading
I hope this helps.
Cheers,
Steve
[ May 29, 2002: Message edited by: Steve Granton ]
[ May 29, 2002: Message edited by: Steve Granton ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic