[ 
https://issues.apache.org/jira/browse/BETWIXT-57?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463858
 ] 

Simon Kitching commented on BETWIXT-57:
---------------------------------------

Robert, I see that the new useContextClassLoader attribute defaults to false.

In Digester it defaults to false, but that is mainly because this feature was 
added after Digester was already widely used and at a 1.x release. Changing the 
existing behaviour would therefore not be acceptable.

Perhaps for Betwixt it should default to true instead? Or is it too late 
already to change existing behaviour?

Either way, it would be nice if the javadoc indicated what the default 
behaviour is...

> Class loader problem in JBoss version 4.0.4GA
> ---------------------------------------------
>
>                 Key: BETWIXT-57
>                 URL: https://issues.apache.org/jira/browse/BETWIXT-57
>             Project: Commons Betwixt
>          Issue Type: Bug
>         Environment: JBoss application server version 4.0.4GA. Probably 
> affects most versions of JBoss
>            Reporter: Surjit Sen
>            Priority: Critical
>
> When using betwixt in a JBoss application, "Class not found" exceptions get 
> thrown when Class.forName methods are called in classes 
> org.apache.commons.betwixt.digester.ElementRule and 
> org.apache.commons.betwixt.digester.ClassRule. Specifically the Class.forName 
> method uses the system class loader to load classes and in JBoss the 
> classpath normally does not contain the application jar files. The fix is 
> very simple. The Class.forName method calls in both the classes were replaced 
> with the following code lines in ElementRule and similar changes were made in 
> ClassRule as well. This fix ensures that the appropriate class loader is used 
> for loading classes and is similar to the fix made in log4j.
>                 ClassLoader loader = 
> Thread.currentThread().getContextClassLoader();
>                 if (loader == null) {
>                       loader = 
> Class.forName(implementationClass).getClassLoader();
>                     //Class clazz = Class.forName(implementationClass);
>                 }
>                 Class clazz = loader.loadClass(implementationClass);
>                 descriptor.setImplementationClass(clazz);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to