Jump to content
Changes to the Jaspersoft community edition download ×

NoClassDefFoundError: JRClassLoader PATCH.


Recommended Posts

By: Andrew Matthews - namxat

NoClassDefFoundError: JRClassLoader PATCH.

2003-06-17 07:09

Hello. I have a (tentative) solution to the whole JRClassLoader/NoClassDefFoundError issue. I changed the following code in JRClassLoader's getInstance method from this:

 

public static JRClassLoader getInstance()

{

ClassLoader classLoader = JRClassLoader.class.getClassLoader();

return new JRClassLoader(classLoader);

}

 

to this:

 

public static JRClassLoader getInstance()

{

ClassLoader classLoader = ClassLoader.getSystemClassLoader();

return new JRClassLoader(classLoader);

}

 

Notice I pass the system classloader to JRClassLoader's constructor. Please note that this fix, as one of its side-effects, may break some dynamic class loading/reloading functionality that JRClassLoader was intended to provide, so use it at your own risk.

 

Here is the text of the diff I created:

 

*** ../JRClassLoader.java Fri Mar 21 20:28:22 2003

--- ./dori/jasper/engine/util/JRClassLoader.java Tue Jun 17 07:53:30 2003

***************

*** 99,103 ****

public static JRClassLoader getInstance()

{

! ClassLoader classLoader = JRClassLoader.class.getClassLoader();

return new JRClassLoader(classLoader);

}

--- 99,103 ----

public static JRClassLoader getInstance()

{

! ClassLoader classLoader = ClassLoader.getSystemClassLoader();

return new JRClassLoader(classLoader);

}

 

 

 

 

 

 

By: Teodor Danciu - teodord

RE: NoClassDefFoundError: JRClassLoader PATCH.

2003-07-07 12:55

 

Hi,

 

This class loading issue si fixed now in the new 0.5.0 version.

 

Thank you,

Teodor

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...