• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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: 24204
44
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.
 
I knew that guy would be trouble! Thanks tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic