Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1B0AD4CE9 for ; Fri, 17 Jun 2011 13:54:11 +0000 (UTC) Received: (qmail 32928 invoked by uid 500); 17 Jun 2011 13:54:10 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 32697 invoked by uid 500); 17 Jun 2011 13:54:10 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 32689 invoked by uid 99); 17 Jun 2011 13:54:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jun 2011 13:54:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jun 2011 13:54:08 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 3B79D41D68D for ; Fri, 17 Jun 2011 13:53:48 +0000 (UTC) Date: Fri, 17 Jun 2011 13:53:48 +0000 (UTC) From: "Jason Tholstrup (JIRA)" To: java-dev@axis.apache.org Message-ID: <1498027827.14992.1308318828240.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1743419845.316.1308002507668.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (AXIS2-5072) BeanUtil bombs on missing setter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AXIS2-5072?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1305= 1076#comment-13051076 ]=20 Jason Tholstrup commented on AXIS2-5072: ---------------------------------------- I'd ask that you reconsider opening this issue as I believe you are misinte= rpreting the JavaBeans specification. =20 The javabeans specification allows for properties to have only a read m= ethod or only a write method. In my case, I have a getter and setter pair = that require an additional parameter (this was not in the sample as I went = for simplicity). It is my expectation that since this does not constitute = a property (it does not meet javaBeans specs) that it would be ignored. In= the axis2-1.3 code this was the case. Other Apache projects follow this i= nterpretation as well. For example, BeanUtils (in commons-BeanUtils) would = simply skip this property if you were to copy one instance of Event to anot= her instance. Beans are allowed to expose methods which are not properties and read-o= nly and write-only are perfectly acceptable. From the javaBeans specificat= ion (http://www.oracle.com/technetwork/java/javase/documentation/spec-13600= 4.html)=20 Section 2.2 The three most important features of a Java Bean are the set of properties = it exposes, the set of methods it allows other components to call, and the = set of events it fires. Section 8.3.1 By default, we use design patterns to locate properties by looking for meth= ods of the form: public get(); public void set( a); If we discover a matching pair of =E2=80=9Cget=E2=80=9D and = =E2=80=9Cset=E2=80=9D methods that take and return the same t= ype, then we regard these methods as defining a read-write property whose n= ame will be =E2=80=9C=E2=80=9D. We will use the =E2=80=9Cget<= PropertyName>=E2=80=9D method to get the property value and the =E2=80=9Cse= t=E2=80=9D method to set the property value. The pair of meth= ods may be located either in the same class or one may be in a base class a= nd the other may be in a derived class. If we find only one of these methods, then we regard it as defining either = a read-only or a write- only property called =E2=80=9C=E2=80= =9D By default we assume that properties are neither bound nor constrained (see= Section 7). So a simple read-write property =E2=80=9Cfoo=E2=80=9D might be= represented by a pair of methods: public Wombat getFoo(); public void setFoo(Wombat w); Thanks, Jason > 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 > Assignee: Sagara Gunathunga=20 > Labels: adb, beanutil > Fix For: 1.7.0 > > > 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 tr= ace below). This "modifiedAttribute" property has a signature of isModifie= dAttribute(int index) and is not included in any wsdl yet this section stil= l 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 sett= er? To me the appropriate decision would seem to be to ignore anything tha= t 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 w= ould be appreciated.=20 > 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 'modifi= edAttribute' in bean class 'com.nicusa.db.tables.Item'is not readable. > java.lang.RuntimeException: org.apache.axis2.AxisFault: Property 'modifie= dAttribute' in bean class 'com.nicusa.db.tables.Item'is not readable. > =09at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(Be= anUtil.java:276) ~[axis2-adb-1.6.0.jar:1.6.0] > =09at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(Be= anUtil.java:129) ~[axis2-adb-1.6.0.jar:1.6.0] > =09at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.= java:72) ~[axis2-adb-1.6.0.jar:1.6.0] > =09at org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.pr= ocessProperties(ADBXMLStreamReaderImpl.java:994) ~[axis2-adb-1.6.0.jar:1.6.= 0] > =09at org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.ne= xt(ADBXMLStreamReaderImpl.java:850) ~[axis2-adb-1.6.0.jar:1.6.0] > =09at org.apache.axis2.util.StreamWrapper.next(StreamWrapper.java:71) ~[a= xis2-kernel-1.6.0.jar:1.6.0] > =09at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBui= lder.java:681) ~[axiom-api-1.2.11.jar:1.2.11] > =09at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.j= ava:214) ~[axiom-api-1.2.11.jar:1.2.11] > =09at org.apache.axiom.om.impl.llom.OMSerializableImpl.build(OMSerializab= leImpl.java:78) ~[axiom-impl-1.2.11.jar:1.2.11] > =09at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.jav= a:722) ~[axiom-impl-1.2.11.jar:1.2.11] > =09at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.ja= va:700) ~[axiom-impl-1.2.11.jar:1.2.11] > =09at org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:= 105) ~[axiom-impl-1.2.11.jar:1.2.11] > =09at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.= java:296) ~[axiom-impl-1.2.11.jar:1.2.11] > =09at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.= java:212) ~[axiom-impl-1.2.11.jar:1.2.11] > =09at org.apache.axis2.rpc.receivers.RPCUtil.processResponse(RPCUtil.java= :105) ~[axis2-adb-1.6.0.jar:1.6.0] > =09at org.apache.axis2.rpc.receivers.RPCUtil.processResponseAsDocLitWrapp= ed(RPCUtil.java:456) ~[axis2-adb-1.6.0.jar:1.6.0] > =09at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLog= ic(RPCMessageReceiver.java:153) ~[axis2-adb-1.6.0.jar:1.6.0] > =09at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusin= essLogic(AbstractInOutMessageReceiver.java:40) [axis2-kernel-1.6.0.jar:1.6.= 0] > =09at org.apache.axis2.receivers.AbstractMessageReceiver.receive(Abstract= MessageReceiver.java:110) [axis2-kernel-1.6.0.jar:1.6.0] > =09at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181) [ax= is2-kernel-1.6.0.jar:1.6.0] > =09at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostR= equest(HTTPTransportUtils.java:172) [axis2-transport-http-1.6.0.jar:na] > =09at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java= :146) [axis2-transport-http-1.6.0.jar:na] > =09at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) [servl= et-api.jar:na] > =09at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [servl= et-api.jar:na] > =09at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ap= plicationFilterChain.java:290) [catalina.jar:6.0.29] > =09at org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicatio= nFilterChain.java:206) [catalina.jar:6.0.29] > =09at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrappe= rValve.java:233) [catalina.jar:6.0.29] > =09at org.apache.catalina.core.StandardContextValve.invoke(StandardContex= tValve.java:191) [catalina.jar:6.0.29] > =09at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve= .java:127) [catalina.jar:6.0.29] > =09at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve= .java:102) [catalina.jar:6.0.29] > =09at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineV= alve.java:109) [catalina.jar:6.0.29] > =09at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.j= ava:298) [catalina.jar:6.0.29] > =09at org.apache.coyote.http11.Http11Processor.process(Http11Processor.ja= va:857) [tomcat-coyote.jar:6.0.29] > =09at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.pro= cess(Http11Protocol.java:588) [tomcat-coyote.jar:6.0.29] > =09at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:= 489) [tomcat-coyote.jar:6.0.29] > =09at java.lang.Thread.run(Thread.java:680) [na:1.6.0_24] > Caused by: org.apache.axis2.AxisFault: Property 'modifiedAttribute' in be= an class 'com.nicusa.db.tables.Item'is not readable. > =09at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(Be= anUtil.java:189) ~[axis2-adb-1.6.0.jar:1.6.0] > =09... 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