axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Tholstrup (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AXIS2-5072) BeanUtil bombs on missing setter
Date Thu, 16 Jun 2011 22:37:47 GMT

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

Jason Tholstrup commented on AXIS2-5072:
----------------------------------------

Sure.  Take the pojo example in the sample dir.  Go to the Entry.java file at /samples/pojo/src/sample/addressbook/entry.

Now change the get postalCode method

from

    public String getPostalCode() {
        return postalCode;
    }

to


    public String getPostalCode(int ohCrap) {
        return postalCode;
    } 


Now build and deploy the service.  If you look at the wsdl you'll note that postalCode was
not put into the entry definition which is what I would expect to see since there is no parameterless
getter.

Add an entry with whatever client (I'm using soap ui) and lets say you use the name "hi".
 

Request 1 addEntry
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.addressbook.sample"
xmlns:xsd="http://entry.addressbook.sample/xsd">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:addEntry>
         <!--Optional:-->
         <ser:args0>
            <!--Optional:-->
            <xsd:city>kc</xsd:city>
            <!--Optional:-->
            <xsd:name>hi</xsd:name>
            <!--Optional:-->
            <xsd:state>mo</xsd:state>
            <!--Optional:-->
            <xsd:street>that one</xsd:street>
         </ser:args0>
      </ser:addEntry>
   </soapenv:Body>
</soapenv:Envelope>

Returns ok (no return payload).

Now go and retrieve that entry by passing in the name "hi" to the findEntry method on the
service.

Request 2 findEntry
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.addressbook.sample">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:findEntry>
         <!--Optional:-->
         <ser:args0>hi</ser:args0>
      </ser:findEntry>
   </soapenv:Body>
</soapenv:Envelope>

Response to findEntry
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Server</faultcode>
         <faultstring>org.apache.axis2.AxisFault: Property 'postalCode' in bean class
'sample.addressbook.entry.Entry'is not readable.</faultstring>
         <detail/>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>


> BeanUtil bombs on missing setter
> --------------------------------
>
>                 Key: AXIS2-5072
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5072
>             Project: Axis2
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.6.0
>         Environment: OSX
>            Reporter: Jason Tholstrup
>              Labels: adb, beanutil
>
> First off, thanks for all your work on axis.
> I am currently upgrading from Axis2 1.3 to version 1.6  and I've run into an issue. 
BeanUtil bombs out on a missing setter property that is not in my WSDL when building response
objects on my server side code (see stack trace below).  This "modifiedAttribute" property
has a signature of isModifiedAttribute(int index) and is not included in any wsdl yet this
section still throws an error.  Is there a reason elsewhere in the code where it makes sense
to throw an exception if a property does not have a getter and a setter?  To me the appropriate
decision would seem to be to ignore anything that did not have both.  This seems to be the
decision that my 1.3 version of the code went with since I wasn't seeing this issue before.
 Any thoughts would be appreciated. 
> Thanks,
> Jason Tholstrup
> 14:24:32.129 ERROR [http-8080-8]  o.a.a.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic
line:210 - org.apache.axis2.AxisFault: Property 'modifiedAttribute' in bean class 'com.nicusa.db.tables.Item'is
not readable.
> java.lang.RuntimeException: org.apache.axis2.AxisFault: Property 'modifiedAttribute'
in bean class 'com.nicusa.db.tables.Item'is not readable.
> 	at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(BeanUtil.java:276)
~[axis2-adb-1.6.0.jar:1.6.0]
> 	at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(BeanUtil.java:129)
~[axis2-adb-1.6.0.jar:1.6.0]
> 	at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:72) ~[axis2-adb-1.6.0.jar:1.6.0]
> 	at org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.processProperties(ADBXMLStreamReaderImpl.java:994)
~[axis2-adb-1.6.0.jar:1.6.0]
> 	at org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.next(ADBXMLStreamReaderImpl.java:850)
~[axis2-adb-1.6.0.jar:1.6.0]
> 	at org.apache.axis2.util.StreamWrapper.next(StreamWrapper.java:71) ~[axis2-kernel-1.6.0.jar:1.6.0]
> 	at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
~[axiom-api-1.2.11.jar:1.2.11]
> 	at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214) ~[axiom-api-1.2.11.jar:1.2.11]
> 	at org.apache.axiom.om.impl.llom.OMSerializableImpl.build(OMSerializableImpl.java:78)
~[axiom-impl-1.2.11.jar:1.2.11]
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:722) ~[axiom-impl-1.2.11.jar:1.2.11]
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:700) ~[axiom-impl-1.2.11.jar:1.2.11]
> 	at org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:105) ~[axiom-impl-1.2.11.jar:1.2.11]
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:296) ~[axiom-impl-1.2.11.jar:1.2.11]
> 	at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:212) ~[axiom-impl-1.2.11.jar:1.2.11]
> 	at org.apache.axis2.rpc.receivers.RPCUtil.processResponse(RPCUtil.java:105) ~[axis2-adb-1.6.0.jar:1.6.0]
> 	at org.apache.axis2.rpc.receivers.RPCUtil.processResponseAsDocLitWrapped(RPCUtil.java:456)
~[axis2-adb-1.6.0.jar:1.6.0]
> 	at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:153)
~[axis2-adb-1.6.0.jar:1.6.0]
> 	at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
[axis2-kernel-1.6.0.jar:1.6.0]
> 	at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
[axis2-kernel-1.6.0.jar:1.6.0]
> 	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181) [axis2-kernel-1.6.0.jar:1.6.0]
> 	at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
[axis2-transport-http-1.6.0.jar:na]
> 	at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146) [axis2-transport-http-1.6.0.jar:na]
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) [servlet-api.jar:na]
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [servlet-api.jar:na]
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
[catalina.jar:6.0.29]
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
[catalina.jar:6.0.29]
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
[catalina.jar:6.0.29]
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
[catalina.jar:6.0.29]
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [catalina.jar:6.0.29]
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [catalina.jar:6.0.29]
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[catalina.jar:6.0.29]
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) [catalina.jar:6.0.29]
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) [tomcat-coyote.jar:6.0.29]
> 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
[tomcat-coyote.jar:6.0.29]
> 	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) [tomcat-coyote.jar:6.0.29]
> 	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_24]
> Caused by: org.apache.axis2.AxisFault: Property 'modifiedAttribute' in bean class 'com.nicusa.db.tables.Item'is
not readable.
> 	at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(BeanUtil.java:189)
~[axis2-adb-1.6.0.jar:1.6.0]
> 	... 35 common frames omitted

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