Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wcs2:post-xml-req5 fails with InvocationTargetException (post/xml) #55

Closed
lgoltz opened this issue Jan 22, 2018 · 10 comments · Fixed by #98
Closed

wcs2:post-xml-req5 fails with InvocationTargetException (post/xml) #55

lgoltz opened this issue Jan 22, 2018 · 10 comments · Fixed by #98
Assignees
Labels
Milestone

Comments

@lgoltz
Copy link
Contributor

lgoltz commented Jan 22, 2018

Setup

SUT: TODO
Selected CCs: all, except WCS WPS 2.0 (Processing)
Tested locally with docker environment

  • ETS WCS 2. 0 1.13-SNAPSHOT
  • TEAM Engine 5.2-SNAPSHOT

Testfailure

"Error in call to extension function {public org.w3c.dom.NodeList com.occamlab.te.TECore.request(org.w3c.dom.Document,java.lang.String) throws java.lang.Throwable}: Exception in extension function java.lang.reflect.InvocationTargetException"

  • Service returns a multipart response. ETS fails with the following failure (error_log.txt):
Caused by: java.lang.RuntimeException: Failed to parse resource from https://ogc.webgistesting.net/server/services/Mynetcdf/ImageServer/WCSServer 
 Failed to parse input: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream
        at com.occamlab.te.parsers.XMLValidatingParser.parse(XMLValidatingParser.java:222)
        ... 83 more

Proposal

  • Further investigations required
@lgoltz lgoltz self-assigned this Feb 22, 2018
@lgoltz lgoltz modified the milestone: 1.13 Feb 27, 2018
@lgoltz
Copy link
Contributor Author

lgoltz commented Feb 27, 2018

The failure occurs cause the GetCoverage Response is tried to be parsed as XML but the respone is a multipart.
The service http://moon.planetserver.eu:8084/rasdaman/ows?service=WCS&request=GetCapabilities&acceptversions=2.0.1 returns XML (gmlcov:RectifiedGridCoverage). It must be checked if the behaviour of the service is correct.

@keshavnangare
Copy link

@lgoltz

Service is not available to reproduce this behavior. Could you please provide any other service which will reproduce the same behavior?

@dstenger dstenger assigned dstenger and lgoltz and unassigned keshavnangare Jan 16, 2019
@dstenger dstenger assigned keshavnangare and unassigned dstenger and lgoltz Mar 27, 2019
@keshavnangare
Copy link

keshavnangare commented Mar 28, 2019

@lgoltz @dstenger

I have tested the Zikang's service and test gets failed with the same error.

Lyn, you are right the service response is multipart so the XMLValidatingparser is failed to parse the multipart data because it expecting the only XML.

Request d2814e456_1:
   Method: post
   URL: http://34.207.148.210:6080/arcgis/services/netcdf2/ImageServer/WCSServer
   Body: 
<wcs:GetCoverage xmlns:ctl="http://www.occamlab.com/ctl"
                 xmlns:ctlp="http://www.occamlab.com/te/parsers"
                 xmlns:gen="java:com.occamlab.te.Generator"
                 xmlns:gml="http://www.opengis.net/gml/3.2"
                 xmlns:ows="http://www.opengis.net/ows/2.0"
                 xmlns:saxon="http://saxon.sf.net/"
                 xmlns:sch="http://purl.oclc.org/dsdl/schematron"
                 xmlns:te="http://www.occamlab.com/te"
                 xmlns:tec="java:com.occamlab.te.TECore"
                 xmlns:tems="java:com.occamlab.te.web.MonitorServlet"
                 xmlns:wcs="http://www.opengis.net/wcs/2.0"
                 xmlns:wcs2="http://www.opengis.net/wcs/2.0"
                 xmlns:xlink="http://www.w3.org/1999/xlink"
                 xmlns:xs="http://www.w3.org/2001/XMLSchema"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 service="WCS"
                 version="2.0.1"
                 xsi:schemaLocation="http://www.opengis.net/wcs/2.0 ../../wcsAll.xsd">
   <wcs:CoverageId>netcdf2</wcs:CoverageId>
</wcs:GetCoverage>

@dstenger dstenger assigned dstenger and lgoltz and unassigned keshavnangare Apr 3, 2019
@dstenger
Copy link
Contributor

I don't see a reason why multipart should be forbidden.

Thus, there must either a precondition be defined for test suite or multipart support must be enabled.

@lgoltz
Copy link
Contributor Author

lgoltz commented Apr 24, 2019

@keshav-nangare: Can you check if multipart support can be enabled in the test suite?

@ghobona
Copy link
Contributor

ghobona commented Jul 14, 2020

@keshav-nangare

If it's a .tif image then you could use Java's ImageIO class to check whether it is an image.

For example, the sample code below returns the width and height of an image if the file is an image. If the file is not an image, then an Exception is thrown.

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;

public class NewClass {
    public static void main(String[] args) {
        try {
            BufferedImage bi = ImageIO.read(new File("/Users/ogccite/Downloads/myimage.tif"));
             System.out.println("Check "+bi.getHeight()+ " "+ bi.getWidth());            
        } catch (IOException ex) {
            Logger.getLogger(NewClass.class.getName()).log(Level.SEVERE, null, ex);
        }
    }    
}

@ghobona
Copy link
Contributor

ghobona commented Jul 15, 2020

@keshav-nangare @ghobona discussed on 2020-07-15.

This issue is related to opengeospatial/ets-wcs11#41 because of the multipart aspect.

They may have the same solution.

@keshavnangare
Copy link

Discussed on 22-07-2020 with @dstenger and @ghobona

Proposed solution:

Add validation for a response with following content-type:

"image/*" OR "application/x-hdf5"

If the response has above content-type then test should pass otherwise fail

@keshavnangare
Copy link

Fixed with #98 PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants