I am attempting to call the getContentStream() function in the FileNET/CMIS SOAP/web service. It takes 2 required parameters, a String for the repositoryID, and a String for the documentID. The rest of the parameters are optional. The method signature is this:
org.oasis_open.docs.ns.cmis.ws._200908.ObjectServicePort.getContentStream(
@WebParam(name=”repositoryId”, String arg0,
@WebParam(name=”objectId”, String arg1,
@WebParam(name=”streamId”, String arg2,
@WebParam(name=”offset”, BigInteger arg3,
@WebParam(name=”length”, BigInteger arg4,
@WebParam(name=”extension”, CmisExtensionType arg5) throws CmisException
In my Java code, I have this:
…
String guid = “”;
guid = request.getParameter(“guid”).trim();
//Connect to FileNET/CMIS Web Service:
GetObject objRequest = new GetObject();
ObjectService objService = new ObjectService();
ObjectServicePort objectServicePort = objService.getObjectServicePort();
((SOAPBinding)((BindingProvider) objectServicePort).getBinding()).setMTOMEnabled(true);
((BindingProvider) objectServicePort).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, “username”);
((BindingProvider) objectServicePort).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, “password”);
((BindingProvider) objectServicePort).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, “https://filenet.web.address.there/openfncmis/services11/ObjectService”);
// Call to getContentStream():
CmisContentStreamType cmisContentStreamType = objectServicePort.getContentStream(reposName, guid, “”, null, null, null);
…
When I run the code, it is failing with the following error in the console:
[10/7/21 13:52:28:724 EDT] 000000db webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[action]: org.oasis_open.docs.ns.cmis.ws._200908.CmisException: CIL1500: The service cannot be completed.
Explanation: This error can occur for the following reasons:
An error in the IBM CMIS application
An error on the repository Action: See the HTTP response or the application server SystemOut.log file for more information and to review the stack trace for the exception. By default, the SystemOut.log file is in the [WAS_profile_location]/logs/[server]/logs subdirectory of the application server installation directory.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:88) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57) at java.lang.reflect.Constructor.newInstance(Constructor.java:437) at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createServiceException(MethodMarshallerUtils.java:1331) at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.demarshalFaultResponse(MethodMarshallerUtils.java:1142) at org.apache.axis2.jaxws.marshaller.impl.alt.DocLitWrappedMethodMarshaller.demarshalFaultResponse(DocLitWrappedMethodMarshaller.java:680) at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.getFaultResponse(JAXWSProxyHandler.java:626) at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.createResponse(JAXWSProxyHandler.java:566) at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:432) at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:213) at com.sun.proxy.$Proxy208.getContentStream(Unknown Source) at gov.ohio.jfs.wotcweb.actions.DisplayFileNETDocuments.execute(DisplayFileNETDocuments.java:131) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1235) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478) at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:143) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:78) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:969) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1109) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4144) at com.ibm.ws.webcontainer.webapp.WebAppImpl.handleRequest(WebAppImpl.java:2208) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1030) at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:382) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:532) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:318) at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
The FileNET Error Log indicates this:
[10/7/21 10:18:37:541 EDT] 000000c1 DALP8Exceptio E com.ibm.ecm.cmis.dal.p8.DALP8ExceptionHandler handleException null
com.ibm.ecm.cmis.exceptions.CMISRuntimeException: CIL1500: The service cannot be completed.
Explanation: This error can occur for the following reasons:
An error in the IBM CMIS application
An error on the repository
Action: See the HTTP response or the application server SystemOut.log file for more information and to review the stack trace for the exception. By default, the SystemOut.log file is in the [WAS_profile_location]/logs/[server]/logs subdirectory of the application server installation directory. at com.ibm.ecm.cmis.dal.p8.DALP8Document.getContent(DALP8Document.java:633) at com.ibm.ecm.cmis.openserverfn.FnCmisService.getContentStream(FnCmisService.java:1562) at com.ibm.ecm.cmis.extensions.BasicPchListener.getContentStream(BasicPchListener.java:240)
at org.apache.chemistry.opencmis.server.support.wrapper.ConformanceCmisServiceWrapper.getContentStream(ConformanceCmisServiceWrapper.java:940) at org.apache.chemistry.opencmis.server.impl.webservices.ObjectService.getContentStream(ObjectService.java:403) at sun.reflect.GeneratedMethodAccessor205.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:508) at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:181) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:97) at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:232) at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:69) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:522) at java.util.concurrent.FutureTask.run(FutureTask.java:277) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$2.run(ServiceInvokerInterceptor.java:126) at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:131) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:252) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:298) at org.apache.chemistry.opencmis.server.impl.webservices.CmisWebServicesServlet.handleRequest(CmisWebServicesServlet.java:182) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:217) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:273) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1235) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478) at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:143) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:78) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:969) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1109) at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:82) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:963) at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:382) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:532) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:318) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:289) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:816) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1909)
Caused by: java.lang.NullPointerException at com.ibm.ecm.cmis.dal.p8.DALP8Document.getContent(DALP8Document.java:605) … 56 more
Now, I know the Document Repository ID and the GUID are both good, because when I query the FileNET repository using our SOAP_UI tool, I get a PDF document back. Can anyone tell me what I’m doing wrong in my Java code that I keep getting this error when I attempt to call the CMIS web service in my Java code?
Thanks in advance for your help!
Sincerely,
John M. Yount
Advertisement
Answer
I figured out the problem!
For the 3rd argument, I had ” “, when I should have had “null”.
Now it works!
j.