Calling JDBC Adapter Service from CAF Portlet -> Error

Hi,

I created a JDBC Adapter Service which basically selects values from a database table. Those values should then be displayed in a table in a CAF portlet.
However when calling this service, I get the following exception:


java.rmi.UnmarshalException: java.io.IOException: no argument constructor is missing. java.lang.NullPointerException
at electric.soap.wsdl.SOAPOperation.readResponse(SOAPOperation.java:457)
at electric.soap.java.reference.JavaToSOAP.invoke(JavaToSOAP.java:259)
at electric.soap.java.reference.JavaToSOAP.invoke(JavaToSOAP.java:165)
at electric.proxy.handler.Proxy.invoke(Proxy.java:126)
at $Proxy86.selectProduct(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.webmethods.caf.wsclient.proxy.impl.WSClientDynamicProxy.invokeMethod(WSClientDynamicProxy.java:112)
at com.webmethods.caf.wsclient.proxy.impl.WSClientDynamicProxy.invoke(WSClientDynamicProxy.java:166)
at $Proxy85.selectProduct(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.webmethods.caf.faces.data.object.ObjectMethodContentProvider.refresh(ObjectMethodContentProvider.java:366)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
at com.webmethods.caf.faces.application.CAFMethodBinding.invoke(CAFMethodBinding.java:65)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:387)
at com.webmethods.caf.faces.component.ViewRoot.broadcastEvents(ViewRoot.java:227)
at com.webmethods.caf.faces.component.ViewRoot.processApplication(ViewRoot.java:120)
at com.webmethods.caf.faces.portlet.PortletLifecycle$InvokeApplicationPhase.execute(PortletLifecycle.java:723)
at com.webmethods.caf.faces.portlet.PortletLifecycle.phase(PortletLifecycle.java:261)
at com.webmethods.caf.faces.portlet.PortletLifecycle.execute(PortletLifecycle.java:151)
at com.webmethods.caf.faces.portlet.FacesPortlet.processAction(FacesPortlet.java:300)
at com.webmethods.portal.framework.portletcontainer.impl.PortletApplicationHandler.process(PortletApplicationHandler.java:480)
at com.webmethods.portal.framework.portletcontainer.servlet.PortletServlet.service(PortletServlet.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.dispatch(PortletContainer.java:219)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.process(PortletContainer.java:130)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.processPortletAction(PortletContainer.java:108)
at com.webmethods.portal.framework.portlet.beans.rest.RestfulPCAHandler.handle(RestfulPCAHandler.java:194)
at com.webmethods.portal.framework.dispatch.DispatchManager.handle(DispatchManager.java:438)
at com.webmethods.portal.framework.dispatch.DispatchManager.handleDispatch(DispatchManager.java:369)
at com.webmethods.portal.framework.impl.PortalServlet.service(PortalServlet.java:272)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.webmethods.portal.framework.impl.NTLMFilter.doFilter(NTLMFilter.java:50)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.webmethods.caf.faces.servlet.GZIPFilter.doFilter(GZIPFilter.java:42)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)

Now I don’t know how to solve this. All the underlying classes were generated and I did nothing on the code.

Could it be that there were corrupt classes created?
Or could this maybe be an authentication issue?

Thanks in advance
Oliver

The solution for this is:

DON’T create the Web Service Connector directly on the service (by Right-click on service → CAF → Generate Web Service Connector…)
This functionality is deprecated and only there to support older CAF projects.

The suggested way is to generate a Web Service Descriptor first (Right-click on service → Generate Provider WSD) and then drag this WSD directly into the Portlet’s Canvas. Doing so, all the necessary Java Proxy classes + the Web Service Connector will be created properly. This is not the case in the first scenario.

Anyway, it is kind of strange, that

  • a deprecated function is not marked as such
  • a deprecated function simply does not work (normally it does work, but is no longer supported and maybe will stop working in future versions)
  • there are several possible ways to do something, but only one of them will work

Greetings
Oliver

Strangely I get a different experience:

  • Dragging the IS service from Package Navigator view to the Bindings view OR using the CAF->Generate Web Service Connector… creates a WS object on the Bindings view which I can then use with no errors

  • Using the “Generate Provider WSD” from the Package Navigator view dragging to the Bindings or layout view or using the CAF->Generate Web Service Connector… creates a WS object looking exactly the previous one but upon execution (“Refresh” button) I get a HTTP error response.

The same action is executed on both cases (I am publishing a document to the broker and can see it appearing) but using the generated Provider WSD gives me the error on the screen.

The difference is also remarkable on SOAP monitor: there is a response on the first case.

Checking the generated java code does not yield more information as there isn’t significant difference between the code on both occasions.

Using 8.2 SP1 with Glue 8.0 Fix 2 build 3

Have a nice weekend.

Just to add I found the generated .wsdl and they are quite different.

The wsdl generated on the IS refers xmlns:soapjms and xmlns:soap12 which the Designer generated wsdl does not.

Could this mean the Designer creates a wsdl pre-8.2 compatible?
I had set the IS WSD as non pre-8.2 compatible.

Also the “good” wsdl specifies an output which the “bad” IS-generated wsdl does not (which is correct, the service does not return any output).

But the test with “good” wsdl does receive a response and the test with the “bad” wsdl does not - so behaviour is correct but we still get an error on the MwMS interface!

…serendipity moment…

All of this looked too suspicious to me, so I went to make a change: edit the IS WSDL (the “bad” guy) and make it pre-8.2 compatible; refresh the WS connector on the Bindings; execute.

BINGO! No error…

A service request is definitively in order…
If this is not a bug, then the java proxy generator is not importing the correct library (which would be a bug too…).