如果我想从 Guvnor 获取已部署的 Excel 文件,谁能建议正确的类类型作为参数传递给 Guvnor REST API?
> WebClient client = WebClient.create("http://localhost:8080/");
> client.header("Authorization", authorizationHeader);
> client.path("jboss-brms/rest/packages/PR/assets/ARule/binary").accept("application/octet-stream").get(FileInputStream.class);
上面的代码给了我:
*javax.ws.rs.client.ClientException: .Problem with reading response message, class : class java.io.FileInputStream, ContentType : application/octet-stream. 在 org.apache.cxf.jaxrs.client.AbstractClient.reportMessageHandlerProblem(AbstractClient.java:744)
...
引起:java.lang.ClassCastException at java.lang.Class.cast(Class.java:2990) at org.apache.cxf.jaxrs.provider.BinaryDataProvider.readFrom(BinaryDataProvider.java:67) at org.apache.cxf .jaxrs.utils.JAXRSUtils.readFromMessageBodyReader(JAXRSUtils.java:1288) 在 org.apache.cxf.jaxrs.client.AbstractClient.readBody(AbstractClient.java:506)*
我正在使用 Apache CXF2.7.6 和 jdk1.6.0_37