• 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

Class name clash

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i have 2 class files with the same name in 2 diff jar files.
Also the hierrachy is the same for both class files.
ie com/package/hello.class in jar1
and com/package/hello.clas in jar2

Now i have placed these 2 jar files in the lib dir of websphere.

Not sure at runtime, which class files will get instantiated.

Please let me know if you come across such a issue.

Thanks in advance.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's no way to tell which will be loaded first; it most likely depends on which jar file is opened first.

The whole point of using hierarchical package names is to help you avoid collisions; why has the same package name been used for two different projects?
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can either open your websphere admin console and seek for the path of your library jars
or you can manually modify from the below files
IBM\WebSphere\AppServers\profiles\AppSrv01\config\cells\DARONNode01Cell\nodes\DARONNode01\servers\server1\libraries.xml

again, it is impossible to load 2 same classes with the same package at the same time
so if you want to load jar1's hello.class, make sure the jar1 is set on the top of jar2 inside the xml file
 
Raja Sathci
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Daron,
In our environment the websphere's "libraries.xml" had only the IBM's jar file, couldnt find my application jar files listed.
Could you please let me know more about this "libraries.xml" file.

Regards,
Raja
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic