• 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 Loader Issue

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using a class loader and in one instance, it works perfectly fine, and then in another instance I get a ClassNotFoundException when trying to load a class, particularly on the loadClass() method.

Here is the background information: I am developing a website using MyEclipse and it is being ran on a JRun server. The instance on when the class loader works correctly is when the class I am trying to load is in a separate jar folder that has been included in the web project's class path. The instance where it throws the ClassNotFoundException is when the class is in a package in the web project itself. Now, the class loader is in a separate jar folder from the project.

Why is the class loader throwing the exception when the class it is trying to load is in the webproject itself but not when it is in a separate jar? Shouldn't it be able to find it when it is in the webproject?
 
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
Hi Brett,

Since you haven't actually told us anything about how your ClassLoader finds and loads classes, anything is possible. You also haven't mentioned whether you're following the delegation model correctly. Describe the custom ClassLoader, and maybe we'll see what's wrong with it.
 
Stinging nettles are edible. But I really want to see you try to eat this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic