• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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.
 
rubbery bacon. crispy tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic