uDIG
  1. uDIG
  2. UDIG-1745

WFS Transaction Failure with GeoTools 2.7

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: UDIG 1.2.1
    • Fix Version/s: UDIG 1.2.1
    • Component/s: webservices
    • Labels:
      None

      Description

      Walkthrough 2 is unable to edit GeoServer WFS-T as reported on email:

      java.io.IOException: srsName required for MultiPoint
                      at org.geotools.xml.gml.GMLComplexTypes.encode(GMLComplexTypes.java:361)
                      at org.geotools.xml.gml.GMLComplexTypes.encode(GMLComplexTypes.java:150)
                      at org.geotools.xml.gml.GMLComplexTypes$AbstractGeometryType.encode(GMLComplexTypes.java:976)
                      at org.geotools.xml.wfs.WFSTransactionComplexTypes$PropertyType.encode(WFSTransactionComplexTypes.java:1460)
                      at org.geotools.xml.wfs.WFSTransactionComplexTypes$UpdateElementType.encode(WFSTransactionComplexTypes.java:1078)
                      at org.geotools.xml.wfs.WFSTransactionComplexTypes$TransactionType.encode(WFSTransactionComplexTypes.java:311)
                      at org.geotools.xml.DocumentWriter.writeFragment(DocumentWriter.java:316)
                      at org.geotools.xml.DocumentWriter.writeDocument(DocumentWriter.java:214)
                      at org.geotools.data.wfs.v1_0_0.WFSTransactionState.commitPost(WFSTransactionState.java:291)
                      at org.geotools.data.wfs.v1_0_0.WFSTransactionState.commit(WFSTransactionState.java:152)
                      at org.geotools.data.DefaultTransaction.commit(DefaultTransaction.java:182)
                      at net.refractions.udig.project.internal.impl.UDIGTransaction.commitInternal(UDIGTransaction.java:49)
      

      Looking at the GeoTools code in question:

              AttributesImpl ai = new AttributesImpl();
      
              // 	no GID
              if (g.getUserData() != null) {
                  ai.addAttribute("", "srsName", "", "anyURI",
                      g.getUserData().toString());
              } else {
                  if (g.getSRID() != 0) {
                      // deprecated version
                      ai.addAttribute("", "srsName", "", "anyURI", "" + g.getSRID());
                  } else {
                  	throw new IOException("srsName required for MultiPoint "+(e==null?"":e.getName()));
                  }
              }
      

      So the assumption here is we need to fill in an srsName or SRID value prior to submitting to the WFS? I think this is a consequence of one of the AppSchema encoding changes a while back on GeoTools.

        Activity

        Hide
        Jody Garnett added a comment -
        Updated SetGeometryCommand to set the srsName if required prior to handing it over to WFS. We will need to test creating a new feature as well.
        Show
        Jody Garnett added a comment - Updated SetGeometryCommand to set the srsName if required prior to handing it over to WFS. We will need to test creating a new feature as well.
        Hide
        Jody Garnett added a comment -
        Walkthrough 2 works again; not the most clean fix (which would be at the geotools level)
        Show
        Jody Garnett added a comment - Walkthrough 2 works again; not the most clean fix (which would be at the geotools level)

          People

          • Assignee:
            Patrick Jessup
            Reporter:
            Jody Garnett
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: