XFire
  1. XFire
  2. XFIRE-509

XFireFault exception: "No write method for property"

    Details

    • Type: Bug Bug
    • Status: In Progress In Progress
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1
    • Fix Version/s: 1.2.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP Professional; version 2002; service pack2, Jvm 1.5, Dell Pentium 4; 1GB Ram
    • Number of attachments :
      4

      Description

      1. Given this XML Schema:

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
      elementFormDefault="qualified"><xs:element name="persons">
      <xs:complexType>
      <xs:sequence>
      <xs:element name="person" maxOccurs="unbounded">
      <xs:complexType>
      <xs:sequence>
      <xs:element name="full_name" type="xs:string"/>
      <xs:element name="child_name" type="xs:string"
      minOccurs="0" maxOccurs="5"/>
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      </xs:sequence>
      </xs:complexType>
      </xs:element></xs:schema>

      • I generated this Schema to java classes.. And I use the Persons class as my service's parameter. Please see attachements.

      2. Snippet from my Client Code to call a Service Method.

      Service serviceModel = new ObjectServiceFactory().create(SOAPport.class) ;
      XFire xfire = XFireFactory.newInstance().getXFire();
      XFireProxyFactory factory = new XFireProxyFactory(xfire);
      String serviceUrl = "http://localhost:8080/xfire/services/Provisioning";

      SOAPport client = (SOAPport) factory.create(serviceModel, serviceUrl);
      try

      { EntityFactory ef = new EntityFactory() ; // Create entities Persons pers = ef.createPersons() ; Person per = ef.createPersonsPerson() ; // Set Values on Person Entity per.getChildName().add("Mayette") ; per.getChildName().add("Lito") ; per.setFullName("Christian Nuesa") ; // Add a person to Persons Object pers.getPerson().add(per) ; // Call service pers = client.addPersons(pers) ; }

      3. When I call my Service I get this exception.

      Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: No write method for property

      {http://entity.dataprovisioningserver.getgamma.com}

      childName in class com.getgamma.dataprovisioningserver.entity.Persons$Person
      org.codehaus.xfire.fault.XFireFault: No write method for property

      {http://entity.dataprovisioningserver.getgamma.com}

      childName in class com.getgamma.dataprovisioningserver.entity.Persons$Person
      at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java:31)
      at org.codehaus.xfire.fault.SoapFaultSerializer.readMessage(SoapFaultSerializer.java:28)
      at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHeadersHandler.java:108)
      at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java:67)
      at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:98)
      at org.codehaus.xfire.client.Client.onReceive(Client.java:450)
      at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:182)
      at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:67)
      at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
      at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:98)
      at org.codehaus.xfire.client.Client.invoke(Client.java:360)
      at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
      at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
      at $Proxy10.addPersons(Unknown Source)
      at test.sample.client.provisioning.aegis.CProvisioning.callService3(CProvisioning.java:148)
      at test.sample.client.provisioning.aegis.CProvisioning.main(CProvisioning.java:185)

      • I get this exception using the default binding, aegis. And if I change that to JaxB2 binding I do not get this exception but when I receive the object from the server, the datas I set from the client is gone! I get nulls on my fields.
      • I checked and I think the problem lies on ArrayList. Whenever I take this out, I do not get an exception.

        Activity

        Hide
        Stefan Ivanov added a comment -

        Have the same problem. Dan could you comment it.

        Show
        Stefan Ivanov added a comment - Have the same problem. Dan could you comment it.
        Hide
        CYW added a comment -

        Not sure if this has been taken care of in 1.2.2, but I believe I just ran into the same issue. I concur with Christian Nuesa's observation that the problem is somehow related to ArrayList.

        In my situation, the error occured when processing GeometrySection$SegmentIDs which has an ArrayList.

        I am jaxb2 binding. See detailed log below:

        org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireF
        ault: No write method for property

        {http://data.webservice.gcmtravel.com}

        segmentIDsElement in class com.gcmtravel.webser
        vice.data.GeometrySection$SegmentIDs
        org.codehaus.xfire.fault.XFireFault: No write method for property

        {http://data.webservice.gcmtravel.com}

        segmentIDsElemen
        t in class com.gcmtravel.webservice.data.GeometrySection$SegmentIDs
        at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java:31)

        Show
        CYW added a comment - Not sure if this has been taken care of in 1.2.2, but I believe I just ran into the same issue. I concur with Christian Nuesa's observation that the problem is somehow related to ArrayList. In my situation, the error occured when processing GeometrySection$SegmentIDs which has an ArrayList. I am jaxb2 binding. See detailed log below: org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireF ault: No write method for property {http://data.webservice.gcmtravel.com} segmentIDsElement in class com.gcmtravel.webser vice.data.GeometrySection$SegmentIDs org.codehaus.xfire.fault.XFireFault: No write method for property {http://data.webservice.gcmtravel.com} segmentIDsElemen t in class com.gcmtravel.webservice.data.GeometrySection$SegmentIDs at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java:31)
        Hide
        Dan Diephouse added a comment -

        OK - CYW said this seems to be a problem when you have an ArrayList as opposed to a List. Will check into this.

        Show
        Dan Diephouse added a comment - OK - CYW said this seems to be a problem when you have an ArrayList as opposed to a List. Will check into this.
        Hide
        baba added a comment -

        Hello all,
        Is there a workaround for this bug without having to change the initial schema?
        Currently I manually insert a set-Method into the concerned classes to get it work.
        Is there a way to let xfire do this per command ot something else?

        Thanks for help in advance!

        Show
        baba added a comment - Hello all, Is there a workaround for this bug without having to change the initial schema? Currently I manually insert a set-Method into the concerned classes to get it work. Is there a way to let xfire do this per command ot something else? Thanks for help in advance!
        Hide
        Christopher Wolfe added a comment -

        Is there an ETA on a fix or work-around?
        Thanks,
        Chris

        Show
        Christopher Wolfe added a comment - Is there an ETA on a fix or work-around? Thanks, Chris
        Hide
        Dan Diephouse added a comment -

        Christian, CYW, others: I'm looking into this issue and it looks like you're trying to use the Aegis binding to serializer jaxb beans.

        For instance on this line in the original description:

        Service serviceModel = new ObjectServiceFactory().create(SOAPport.class) ;

        that should be:

        Service serviceModel = new JaxbServiceFactory().create(SOAPport.class) ;

        Same goes for others who commented and mentioned they were using JAXB. If you aren't using JAXB, make sure you have both a getter and a setter. If you think you're still having issues, please email the mailing list with your complete configuration. Thanks

        Show
        Dan Diephouse added a comment - Christian, CYW, others: I'm looking into this issue and it looks like you're trying to use the Aegis binding to serializer jaxb beans. For instance on this line in the original description: Service serviceModel = new ObjectServiceFactory().create(SOAPport.class) ; that should be: Service serviceModel = new JaxbServiceFactory().create(SOAPport.class) ; Same goes for others who commented and mentioned they were using JAXB. If you aren't using JAXB, make sure you have both a getter and a setter. If you think you're still having issues, please email the mailing list with your complete configuration. Thanks
        Hide
        Dan Diephouse added a comment -

        Reopening at the request of users...

        Show
        Dan Diephouse added a comment - Reopening at the request of users...
        Hide
        Karl Palsson added a comment -

        A sample wsdl, a sample ant file that will build a stub from the wsdl, and the source code generated.

        I've left out the contents of the "lib" dir, it just contained the jars from the 1.2.2 distro

        Show
        Karl Palsson added a comment - A sample wsdl, a sample ant file that will build a stub from the wsdl, and the source code generated. I've left out the contents of the "lib" dir, it just contained the jars from the 1.2.2 distro
        Hide
        Dan Diephouse added a comment -

        Scheduling for 1.2.4

        Show
        Dan Diephouse added a comment - Scheduling for 1.2.4
        Hide
        Dan Diephouse added a comment -

        OK, I still can't reproduce this issue - even with the attached wsdl. Here is my client code:

        XfireContractFirstClient service = new XfireContractFirstClient();

        XfireContractFirst client = service.getXfireContractFirstSOAP("http://localhost:8081/XfireContractFirst");

        InputMessageUnbounded unbounded = new InputMessageUnbounded();
        unbounded.getItem().add("foo");
        assertEquals("foo", client.doSomethingBroken(unbounded));

        And my server code:

        JaxbServiceFactory asf = new JaxbServiceFactory();
        service = asf.create(CustomXfireContractFirstImpl.class, null,
        new File("src/wsdl/xfire-509.wsdl").toURL(), null);

        getServiceRegistry().register(service);

        XFireHttpServer server = new XFireHttpServer();
        server.start();

        Everything invokes fine.

        Looking at your webservices.xml though I think I see the issue. IIRC (and I'm not sure that I do), the Jsr181HandlerMapping isn't going to work out of the box with JAXB. It just loops through your beans, sees if it has a @WebService annotation, then exposes it using the AnnotationServiceFactory.

        Instead of doing:

        <property name="typeMappingRegistry">
        <ref bean="xfire.typeMappingRegistry" />
        </property>

        You might want to try:

        <property name="typeMappingRegistry">
        <bean class="org.codehaus.xfire.jaxb2.JaxbTypeRegistry"/>
        </property>

        Let me know if that helps.

        Show
        Dan Diephouse added a comment - OK, I still can't reproduce this issue - even with the attached wsdl. Here is my client code: XfireContractFirstClient service = new XfireContractFirstClient(); XfireContractFirst client = service.getXfireContractFirstSOAP("http://localhost:8081/XfireContractFirst"); InputMessageUnbounded unbounded = new InputMessageUnbounded(); unbounded.getItem().add("foo"); assertEquals("foo", client.doSomethingBroken(unbounded)); And my server code: JaxbServiceFactory asf = new JaxbServiceFactory(); service = asf.create(CustomXfireContractFirstImpl.class, null, new File("src/wsdl/xfire-509.wsdl").toURL(), null); getServiceRegistry().register(service); XFireHttpServer server = new XFireHttpServer(); server.start(); Everything invokes fine. Looking at your webservices.xml though I think I see the issue. IIRC (and I'm not sure that I do), the Jsr181HandlerMapping isn't going to work out of the box with JAXB. It just loops through your beans, sees if it has a @WebService annotation, then exposes it using the AnnotationServiceFactory. Instead of doing: <property name="typeMappingRegistry"> <ref bean="xfire.typeMappingRegistry" /> </property> You might want to try: <property name="typeMappingRegistry"> <bean class="org.codehaus.xfire.jaxb2.JaxbTypeRegistry"/> </property> Let me know if that helps.
        Hide
        Karl Palsson added a comment -

        Not so much luck I'm afraid. Now the wsdl generated at run time doesn't include the full schema, here's the complete schema generated:

        <wsdl:types>
        <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://www.industria.com/services/troubleticketing/mailer">
        <xsd:element name="MailAnyStringRequest" type="tns:MailAnyStringRequest" />
        <xsd:element name="MailAnyStringResponse" type="tns:MailAnyStringResponse" />
        <xsd:element name="MailAnyStringFault" type="tns:MailAnyStringFault" />
        </xsd:schema>
        </wsdl:types>

        Without the types, no clients can connect to it. On the bright side, it hasn't made up any of it's own namespaces.

        Show
        Karl Palsson added a comment - Not so much luck I'm afraid. Now the wsdl generated at run time doesn't include the full schema, here's the complete schema generated: <wsdl:types> <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://www.industria.com/services/troubleticketing/mailer"> <xsd:element name="MailAnyStringRequest" type="tns:MailAnyStringRequest" /> <xsd:element name="MailAnyStringResponse" type="tns:MailAnyStringResponse" /> <xsd:element name="MailAnyStringFault" type="tns:MailAnyStringFault" /> </xsd:schema> </wsdl:types> Without the types, no clients can connect to it. On the bright side, it hasn't made up any of it's own namespaces.
        Hide
        Dan Diephouse added a comment -

        Are you using XFire 1.2.3? There was a bug in 1.2.2 which did this.

        Show
        Dan Diephouse added a comment - Are you using XFire 1.2.3? There was a bug in 1.2.2 which did this.
        Hide
        Karl Palsson added a comment -

        I was using 1.2.2, I've just dropped in the 1.2.3-all jar, deleting the old 1.2.2 jar, and rebuilt, but it's the same thing. Should there be any other steps in upgrading?

        I've also tried regenerating the server stub with the 1.2.3-all jar instead of the 1.2.2 jar, but that doesn't make any difference. (And a diff in both folders doesn't show any real differences in the generated source (Just a couple of differences in the order of methods in the files)

        Show
        Karl Palsson added a comment - I was using 1.2.2, I've just dropped in the 1.2.3-all jar, deleting the old 1.2.2 jar, and rebuilt, but it's the same thing. Should there be any other steps in upgrading? I've also tried regenerating the server stub with the 1.2.3-all jar instead of the 1.2.2 jar, but that doesn't make any difference. (And a diff in both folders doesn't show any real differences in the generated source (Just a couple of differences in the order of methods in the files)
        Hide
        Dan Diephouse added a comment -

        Which method of service deployment are you using? I see both a services.xml and spring files in the sample.

        Show
        Dan Diephouse added a comment - Which method of service deployment are you using? I see both a services.xml and spring files in the sample.
        Hide
        Ashley McConnell added a comment -

        Is there any workaround for this at all if I want to sent a list of objects?

        Show
        Ashley McConnell added a comment - Is there any workaround for this at all if I want to sent a list of objects?
        Hide
        Dan Diephouse added a comment -

        Ashley - can you paste your configuration? I still haven't seen any situations where this isn't a configuration problem of some sort.

        Show
        Dan Diephouse added a comment - Ashley - can you paste your configuration? I still haven't seen any situations where this isn't a configuration problem of some sort.
        Hide
        Karl Palsson added a comment -

        We junked our configs and started from scratch again, and got it working, but only by going back to the plain single services.xml.

        Some more examples of the config setup would be nice

        Show
        Karl Palsson added a comment - We junked our configs and started from scratch again, and got it working, but only by going back to the plain single services.xml. Some more examples of the config setup would be nice
        Hide
        Ashley McConnell added a comment -

        We fixed this by adding the JaxbServiceFactory into services.xml like so: -

        <beans>
        <service xmlns="http://xfire.codehaus.org/config/1.0">
        <name>Test</name>
        <namespace>http://localhost:8080/bam/services/TestDemo</namespace>
        <serviceClass>com.blah.MyServiceClass</serviceClass>
        <serviceFactory>org.codehaus.xfire.jaxb2.JaxbServiceFactory </serviceFactory>
        </service>
        </beans>

        I hope this helps somebody!

        Show
        Ashley McConnell added a comment - We fixed this by adding the JaxbServiceFactory into services.xml like so: - <beans> <service xmlns="http://xfire.codehaus.org/config/1.0"> <name>Test</name> <namespace> http://localhost:8080/bam/services/TestDemo </namespace> <serviceClass>com.blah.MyServiceClass</serviceClass> <serviceFactory>org.codehaus.xfire.jaxb2.JaxbServiceFactory </serviceFactory> </service> </beans> I hope this helps somebody!
        Hide
        Luis Fernando Planella Gonzalez added a comment -

        For me, this was happening on Aegis binding when I had a read-only property (no setter method).
        I added a no-op setter method and it works now...

        Show
        Luis Fernando Planella Gonzalez added a comment - For me, this was happening on Aegis binding when I had a read-only property (no setter method). I added a no-op setter method and it works now...
        Hide
        manjunath added a comment -

        Hi All,

        I am facing the same kind of problem (org.codehaus.xfire.fault.XFireFault: No write method for property ).

        I am using the XFire 1.2.1 and was using the ObjectServiceFactory. After going through comments above, i changed it to JaxbServiceFactory. Then it started asking for the annotations(since my service class does not have any annotations). I added web services annotations to my service class. But unfortunately, this also did not solve my issue. The service class which i am using is a interface; and when i am trying to access the service with the above implemenation; it gives the following error:

        org.codehaus.xfire.annotations.AnnotationException: Service class cannot be abstract: com.pinkroccade.jfoundation.calculation.releases.ReleaseManager
        at org.codehaus.xfire.annotations.AnnotationServiceFactory.assertValidImplementationClass(AnnotationServiceFactory.java:278)
        at org.codehaus.xfire.annotations.AnnotationServiceFactory.create(AnnotationServiceFactory.java:172)

        If i make my implementation class as service class it might work(i tried that also; but there is some other problem). But as of now i dont want to do it that way. Is there any ways by which i can fix this problem ????

        By using xfire-1.2.3, will it solve the issue ?????

        Show
        manjunath added a comment - Hi All, I am facing the same kind of problem (org.codehaus.xfire.fault.XFireFault: No write method for property ). I am using the XFire 1.2.1 and was using the ObjectServiceFactory. After going through comments above, i changed it to JaxbServiceFactory. Then it started asking for the annotations(since my service class does not have any annotations). I added web services annotations to my service class. But unfortunately, this also did not solve my issue. The service class which i am using is a interface; and when i am trying to access the service with the above implemenation; it gives the following error: org.codehaus.xfire.annotations.AnnotationException: Service class cannot be abstract: com.pinkroccade.jfoundation.calculation.releases.ReleaseManager at org.codehaus.xfire.annotations.AnnotationServiceFactory.assertValidImplementationClass(AnnotationServiceFactory.java:278) at org.codehaus.xfire.annotations.AnnotationServiceFactory.create(AnnotationServiceFactory.java:172) If i make my implementation class as service class it might work(i tried that also; but there is some other problem). But as of now i dont want to do it that way. Is there any ways by which i can fix this problem ???? By using xfire-1.2.3, will it solve the issue ?????
        Hide
        manjunath added a comment -

        And whats this "no-op setter method". May i hav esome more information on this.

        Show
        manjunath added a comment - And whats this "no-op setter method". May i hav esome more information on this.

          People

          • Assignee:
            Dan Diephouse
            Reporter:
            Christian Nuesa
          • Votes:
            12 Vote for this issue
            Watchers:
            14 Start watching this issue

            Dates

            • Created:
              Updated: