Bug #18

ClassLoader for generated bytecode

Added by Anonymous over 9 years ago. Updated about 9 years ago.

Start date:
Due date:
% Done:


Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:


SourceForge user: mhkay

When Saxon-EE generates bytecode, it loads the generated classes using a custom ClassLoader whose parent ClassLoader is obtained using getClass().getClassLoader(). In some circumstances this parent ClassLoader can subsequently be invoked for loading resources such as extension functions referenced by the generated bytecode. In an environment with specialized class loading requirements, this may be inadequate, and it may be preferable to use the context class loader for the thread instead. A patch is being raised whose effect is to choose which ever of the following first produces a result:

(a) the user-defined ClassLoader registered with configuration.getDynamicLoader().setClassLoader()

(b) the result of Thread.currentThread().getContextClassLoader()

(c) the result of getClass().getClassLoader()

This is consistent with the strategy Saxon generally uses for dynamic loading of classes.


#1 Updated by Michael Kay over 9 years ago

  • Assignee set to O'Neil Delpratt

Although this patch seems to have worked well on the Java platform, it appears to have caused regression on .NET, where class loading is now failing in cases where the application uses the Saxon API to compile queries and stylesheets (it works fine when Saxon is run from the command line).

#2 Updated by O'Neil Delpratt over 9 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

The bug has now been fixed. We now rely on the sub-classes of the the platform class to create the classLoader object. Therefore the logic required for a Java and .NET platform is in place, respectively.

#3 Updated by Michael Kay about 9 years ago

  • Status changed from Resolved to Closed
  • Fixed in version set to

Please register to edit this issue

Also available in: Atom PDF