axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AXIS2-4993) Throw JAXBException if the built JAXBContext from classes are not valid
Date Fri, 01 Apr 2011 03:24:05 GMT

    [ https://issues.apache.org/jira/browse/AXIS2-4993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014383#comment-13014383
] 

Ivan commented on AXIS2-4993:
-----------------------------

I tried to read more Axis2 codes, and find that it might be required to consider more about
throwing exception.
The problem I think that Axis2 has different expected value for JAXBUtils.getJAXBContext method.
e.g. In the JAXWSProxyHandler, it expects getJAXBContext method return null or throw an exception
or a valid value, with that, it could decide which classloader should be in good shape. While
in other codes, e.g. MethodMarshallerFactory.isContextPathConstruction, it always expected
there is an value to be returned. So I am thinking whether some extra rules could be aded
in the classloader choosing steps, e.g. Check whether all the context packages could be found
if both SEI classloader and context classloader could be used to build a JAXBContext. Will
attach a new patch later.

> Throw JAXBException if the built JAXBContext from classes are not valid
> -----------------------------------------------------------------------
>
>                 Key: AXIS2-4993
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4993
>             Project: Axis2
>          Issue Type: Bug
>          Components: jaxws
>    Affects Versions: 1.6.0
>            Reporter: Ivan
>         Attachments: AXIS2-4993.patch
>
>
> In the class JAXWSProxyHandler, there is some logic for choosing classloader of SEI and
context classloader. Currently, it would try to build the JAXBContext with both classloaders,
and compare them with a set of rules, But I found that JAXBUtils.getJAXBContext method would
not return null in most scenarios even if it is not suitable, and context classloader did
not have enough chance to win.
>     In the JAXBUtils,getJAXBContext, it would first try to build the JAXBContext with
context path style, then checked whether the built JAXBContext contains expected reference
classes. If not, it will turn to build the JAXBContext with class array style, but the logic
for this style is so careful, it would not throw exception as I could see it will try to find
a best successful set. Also, JAXBUtils does not check the built JAXBContext contains expected
reference classes at this time. Should it also do some checking and throw JAXBException if
required ?  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message