• 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

weblogic applications classloader question and good practice?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I've got a question about weblogic 6.1.
having 2 different EJB applications packaged in jar files, both deployed to same server, same domain.
Can the 2 applications access each other class loader (and thus classes?) without altering server classpath?
My guess is no
I'm working on a project where there are two jar's deployed.
First application with couple EJBs and util classes. Does not provide any direct services to clients.
The second applications inherits from a bunch of classes in the first application and uses the services of the 2 EJBs it declares(logging and "wannabe-dynamic querying").
But the second jar does not contain any of the classes it inherits from.
It seems to me the only way it works right now is that they(previous developers) have put both application jars in the servers own classpath(declared in the server startup startupscript). Second reason is that second Application is also using weblogics "startup class" facility to load certain resources on startup( in-house developed timer service). Since the startup class is in the applications jar file, it seems the whole jar had to be on the classpath.
I haven't worked too much on EJB components, but from my experience with webapplications this seems like a really bad idea to me. Wouldn't it be better to include everything in one application Jar file, so it could be deployed everywhere?
Am I correct or am I just crazy? While thing seems like a hack to me.
Is this a common deployment approach on real life servers?
comments?
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the BEA/WebLogic forum...
 
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Henrik
Here is the appropriate weblogic documentation.
http://e-docs.bea.com/wls/docs61/programming/packaging.html

My guess is no


My guess is Yes.
I think that each ejb jar file is loaded within the same classloader. So there should be no difference if you package all ejb's in one jar file or have multiple ejb jar files.

Classloaders in Weblogic Server are hierarchical. When you start WebLogic Server, the Java system classloader is active and is the parent of all subsequent classloaders that WebLogic Server creates. When WebLogic Server deploys an application, it automatically creates two new classloaders: one for EJBs and one for Web applications. The EJB classloader is a child of the Java system classloader and the Web application classloader is a child of the EJB classloader.

 
Henrik Bentel
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The thing is the 2 jars represents 2 different applications, each with an entry in config.xml. So a.jar and b.jar is application a and b. Now there are only ejbs in these jars, so one classloader for application a and one for b. How can then application b access classes in application a.
That's why I though no.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic