You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Philippe Le Berre (JIRA)" <ji...@apache.org> on 2013/01/17 08:58:14 UTC
[jira] [Comment Edited] (AXIS2-5474) DefaultSchemaGenerator :
properly handle failure when a bean property has no getReadMethod()
[ https://issues.apache.org/jira/browse/AXIS2-5474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13555966#comment-13555966 ]
Philippe Le Berre edited comment on AXIS2-5474 at 1/17/13 7:57 AM:
-------------------------------------------------------------------
Attached file patch (diff -u)
was (Author: pleberre):
Patch (diff -u)
> DefaultSchemaGenerator : properly handle failure when a bean property has no getReadMethod()
> --------------------------------------------------------------------------------------------
>
> Key: AXIS2-5474
> URL: https://issues.apache.org/jira/browse/AXIS2-5474
> Project: Axis2
> Issue Type: Improvement
> Components: kernel
> Affects Versions: 1.6.2
> Reporter: Philippe Le Berre
> Priority: Trivial
> Labels: patch
> Attachments: patch.diff
>
>
> Deployment of service (aar file) might failed with :
> Caused by: org.apache.axis2.deployment.DeploymentException: The following error occurred during schema generation: null
> at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:396)
> ... 35 more
> Caused by: java.lang.NullPointerException
> at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.generateSchema(DefaultSchemaGenerator.java:606)
> at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.generateSchemaTypeforNameCommon(DefaultSchemaGenerator.java:1092)
> In which the getReadMethod() is returning null for a bean property, thus to make it more friendly and avoid anyone loosing time on such things :
> --- DefaultSchemaGenerator.java 2013-01-08 10:09:33.000000000 +0100
> +++ DefaultSchemaGenerator.java.new 2013-01-08 10:09:17.000000000 +0100
> @@ -603,6 +603,9 @@
> String propertyName = property.getName();
> if (!property.getName().equals("class") && (property.getPropertyType() != null)) {
> if ((beanExcludeInfo == null) || !beanExcludeInfo.isExcludedProperty(propertyName)) {
> + if (property.getReadMethod() == null) {
> + throw new Exception("Failed property ("+property.getName()+") has no getReadMethod() method in Class ("+javaType+")");
> + }
> Type genericFieldType = property.getReadMethod().getGenericReturnType();
> if(genericFieldType instanceof ParameterizedType){
> ParameterizedType aType = (ParameterizedType) genericFieldType;
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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