[ http://issues.apache.org/jira/browse/DIGESTER-109?page=all ]

Simon Kitching updated DIGESTER-109:
------------------------------------

    Summary: FromXmlRuleSet  and  SetNextRule  classloader issue  (was: 
FromXmlRuleSet  and  SetNextRule  classes not working in Unix enviroment)

Hi Anna,

Thanks very much for reporting this issue.

I expect this isn't a "unix" issue specifically; I use Digester extensively on 
AIX and Linux and don't have this problem. In addition, I've not seen any 
classloader behaviour differences between unix and windows; anything like that 
would be a great surprise as Java is cross-platform. I've therefore edited the 
title of this bugreport.

It's obviously a real problem, but is more likely triggered by the way your 
classloader environment is structured, eg running in a J2EE container when 
"parent-first" classloading is selected, and Digester is deployed in a shared 
dir of the container or something similar.

Unfortunately, I'm concerned that your posted patch could break other users 
that have their J2EE container classloading set up in other ways; deciding what 
the correct change to make is will be tricky.

By the way, the xmlrules module you're using has very little support; I'm the 
only regular Digester maintainer and I don't use it. If you can change to using 
the Digester API directly I can commit a fix for this quicker than for an 
xmlrules problem. However I will try to come up with a patch for you to test. 
Getting a fix into trunk will definitely need your help, as obviously I can't 
duplicate this bug on my local machine.

Of course there's nothing wrong with you continuing to use your customised 
Digester version that works for you. 

Cheers,

Simon

> FromXmlRuleSet  and  SetNextRule  classloader issue
> ---------------------------------------------------
>
>                 Key: DIGESTER-109
>                 URL: http://issues.apache.org/jira/browse/DIGESTER-109
>             Project: Commons Digester
>          Issue Type: Bug
>            Reporter: Anna Komaristaia
>
> When I start the application in Unix, there are 2 classes cause the problem:
> 1)  The NullPointerException in "FromXmlRuleSet  " class in the method 
> "addRuleInstances(Digester, String)";
> 2)  The NullPointerException in "SetNextRule" class in the method "end()";
> Temporary solution
> ---------------------------
>  I recompiled the commons-digester jar with the next changes and it's working 
> fine in PC and Unix: 
> Changes in the "FromXmlRuleSet  " class 
>       
> 1)  public static final String DIGESTER_DTD_PATH = "digester-rules.dtd";
> 2)  in the method "addRuleInstances"  
>           the line 
>          URL dtdURL = 
> getClass().getClassLoader().getResource(DIGESTER_DTD_PATH);
>         
>          changed by
>         
>          URL dtdURL = this.getClass().getResource(DIGESTER_DTD_PATH); 
> Changes In the "SetNextRule" class 
>         the line
>                  paramTypes[0] = digester.getClassLoader().loadClass( 
> paramType);
>        changed by
>               if( digester.getClassLoader() == null )
>                     paramTypes[0] = Class.forName(paramType);
>               else
>                     paramTypes[0] = digester.getClassLoader().loadClass( 
> paramType);
> Thanks, 
> //Anna 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://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