Java geotoolkit的CSWClientDemo中的强制转换问题

Java geotoolkit的CSWClientDemo中的强制转换问题,java,Java,我试图测试geotoolkit的CSWClientDemo,但没有成功 这里有一个铸造问题: GetRecordsResponseType response = ((JAXBElement<GetRecordsResponseType>) um.unmarshal(is)).getValue(); (同时,我导入了org.apache.sis.xml.MarshallerPool而不是org.geotoolkit.xml.MarshallerPool。)您可能在响应中遇到了en

我试图测试geotoolkit的CSWClientDemo,但没有成功

这里有一个铸造问题:

  GetRecordsResponseType response = ((JAXBElement<GetRecordsResponseType>) um.unmarshal(is)).getValue();

(同时,我导入了org.apache.sis.xml.MarshallerPool而不是org.geotoolkit.xml.MarshallerPool。)

您可能在响应中遇到了en异常,而不是预期的
GetRecords
响应

因此,铸造失败

  • 检查您的CSW服务为什么会出现异常
  • 修复您的演示代码,从而考虑异常
Exception in thread "main" java.lang.ClassCastException: org.geotoolkit.ows.xml.v100.ExceptionReport cannot be cast to javax.xml.bind.JAXBElement
    at test.CSWClientDemo.main(CSWClientDemo.java:71)