[ 
http://issues.apache.org/jira/browse/DIGESTER-109?page=comments#action_12443997 
] 
            
Simon Kitching commented on DIGESTER-109:
-----------------------------------------

Good point Henri.

I had assumed that the NullPointerException Anna was reporting in 
FromXmlRuleSet was not from the actual line that was marked changed, but later 
on when dtdURL was being used or similar due to the resource only being 
locatable via the modified code - which is the sort of thing that odd J2EE 
configurations can experience. The second change just had me puzzled, but I was 
delaying comment until I had checked the implementation of 
Digester.getClassLoader().

However it does appear that Anna is experiencing getClass().getClassLoader() 
returning null; that explains both changes as Digester.getClassLoader would 
return null in that case.

But that behaviour, as you say, is very odd indeed. This only occurs AFAIK if 
Digester.class were being loaded via the bootstrap classloader, or by the 
System classloader in a 1.1 (or earlier) JVM (the distinction between 
bootclassloader and system classloader was only introduced in 1.2).

Loading a non-core library via the bootstrap classloader would be very weird 
indeed.

Anna, you aren't using Digester in some kind of embedded system or antique JVM 
are you?
And you're not putting commons-digester.jar into the install directory of your 
JVM for some reason?

If not, can you please look into why you are getting a null value from 
Digester.getClass().getClassLoader() because I can't see how it's possible...

Regards,
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