SAAJ API throws a misleading exception when looking for a factory implementation
--------------------------------------------------------------------------------

                 Key: AXIS2-2289
                 URL: https://issues.apache.org/jira/browse/AXIS2-2289
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
            Reporter: Jarek Gawor


I was trying to use Axis2 SAAJ API with Sun's SAAJ implementation. So I created 
the appropriate META-INF/services/ files accessible from the classloader (with 
bogus classnames for testing). However, during factory lookup I always got an 
exception that Axis2 provider could not be loaded. After debugging the 
javax/xml/soap/FactoryFinder.java class a bit it appears that my custom factory 
class was found and attempted to be loaded in line 120 of the file. However, 
the newInstance() method is called within a bigger try { .. } catch {} 
statement and therefore any exception thrown by the newInstance() method is 
ignored (and then the code in line 126 gets executed and the misleading 
exception is raised). It's misleading in the sense that I specified overwrite 
(via META-INF/services/* files) and it's being used but the code is still 
trying to load Axis2 provider. So I think it would be nice to at least display 
a warning when an overwrite is used but the class cannot be loaded or maybe the 
FactoryFinder should just throw the exception when it fails to load the class 
specified in the META-INF/services/* file.



  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to