[
https://issues.apache.org/jira/browse/TUSCANY-1341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505785
]
Simon Nash commented on TUSCANY-1341:
-------------------------------------
I have been looking at this and I have been making some progress. I decided to
take the simple-callback sample and create a new version of this called
simple-callback-ws that uses the Web Service binding.
For problem (1), it seems that the Web Service Binding spec needs to add
support for specifying the callback interface (PortType). I'll pursue this
with the spec authors. Meanwhile, I have created a patch to obtain and set the
callback interface based on a naming conention that the callback interface
PortType name must be <interfacename>Callback, where <interfacename> is the
name of the PortType for the regular interface.
For problem (2), I changed the signature of findCallbackOperation() to pass in
the contract instead of the wire.
I came across Problem (3) in my testing. This was caused by an error in the
SCDL. For methods with void return types, the WSDL must not specify a
wsdl:part within the wsdl:message for the method response. Alternatively, the
wsdl:output method response can be omitted from the wsdl:operation. Tuscany
should produce an error message for this, not a NPE.
I'm currently looking into problem (4). I think some fairly major changes are
needed in this area.
I also discovered another problem in my testing:
5) InterfaceContractMapperImpl.checkCompatibility() does not work for callback
interfaces. For the regular interface, there is a FIXME comment and workaround
code for remotable interfaces that only checks that the method names match
(because the code that does the full check is broken). This workaround code is
not present for the calllback interface, so the compatibility check is failing
for interfaces with callbacks. For now, I have copied the FIXME comment and
code to the callback interface path.
I'm planning to leave this JIRA open until the end-to-end path is working, and
raise other JIRAs for problems and fixes that I find along the way., starting
with the following:
add the simple-callback-ws sample
problem (1) and my patch for this
problem (5) and my patch for this
a description of problem (3)
I'm leaving problem (2) for now as I think there will be more major work needed
in this area that could eliminate the need for the findCallbackOperation()
method altogether.
> Callback over WS Binding is not functioning various issues
> ----------------------------------------------------------
>
> Key: TUSCANY-1341
> URL: https://issues.apache.org/jira/browse/TUSCANY-1341
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Misc Binding Extensions
> Affects Versions: Java-SCA-0.90
> Reporter: Lou Amodeo
>
> The callback function using WS bindings doesnt appear to be operation. So
> far I have :
> 1) WebServiceBindingProcessor.java
> - The resolve() method does not setup the callbackInterface on its
> InterfaceContract resulting in NPE.
> (i.e. interfaceContract.setCallbackInterface(wsdlCallbackInterface); )
> [6/11/07 13:33:02:220 EDT] 00000025 SystemOut O ... 87 more
> [6/11/07 13:33:02:220 EDT] 00000025 SystemOut O Caused by:
> java.lang.NullPointerException
> at
> org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl.map(InterfaceContractMapperImpl.java:246)
> at
> org.apache.tuscany.sca.core.runtime.CompositeActivatorImpl.createWires(CompositeActivatorImpl.java:337)
> at
> org.apache.tuscany.sca.core.runtime.CompositeActivatorImpl.createRuntimeWires(CompositeActivatorImpl.java:269)
> at
> org.apache.tuscany.sca.core.runtime.CompositeActivatorImpl.activate(CompositeActivatorImpl.java:580)
> at
> org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain$DomainCompositeHelper.addComposite(EmbeddedSCADomain.java:124)
> at
> com.ibm.ws.sca2.tuscany.util.TuscanyInterfaceImpl.startModule(TuscanyInterfaceImpl.java:223)
> at
> com.ibm.ws.soa.sca.admin.runtime.tuscany.SCATuscanyRuntimeHandlerImpl.startModule(SCATuscanyRuntimeHandlerImpl.java:82)
> at
> com.ibm.ws.soa.sca.admin.runtime.impl.SCARuntimeImpl.start(SCARuntimeImpl.java:366)
> at
> com.ibm.ws.soa.sca.admin.runtime.impl.SCARuntimeImpl.stateChanged(SCARuntimeImpl.java:286)
> at
> com.ibm.ws.runtime.component.ApplicationMgrImpl.stateChanged(ApplicationMgrImpl.java:1264)
> at
> com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectEvent(DeployedApplicationImpl.java:1112)
> at
> com.ibm.ws.runtime.component.DeployedModuleImpl.setState(DeployedModuleImpl.java:206)
> at
> com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:566)
> at
> com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:814)
> at
> com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:965)
> at
> com.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1495)
> at
> com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:3924)
> at
> com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:4001)
> at
> com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:245)
> at
> com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1500)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:615)
> at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:62)
> at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:615)
> at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:265)
> at
> javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1089)
> at
> javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:971)
> at
> com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:231)
> at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:238)
> at
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:833)
> at
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:802)
> at
> com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1080)
> at
> com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
> at
> com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:973)
> at
> com.ibm.ws.management.commands.AdminServiceCommands$InvokeCmd.execute(AdminServiceCommands.java:251)
> at
> com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:239)
> at
> com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction.execute(ApplicationDeploymentCollectionAction.java:536)
> at
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1486)
> at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:528)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:995)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
> at
> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
> at
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)
> at
> org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1070)
> at
> org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:273)
> at
> org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
> at
> org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:319)
> at
> com.ibm.isclite.container.controller.InformationController.processForwardConfig(InformationController.java:159)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1486)
> at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:528)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:995)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
> at
> com.ibm.ws.console.core.servlet.WSCUrlFilter.setUpCommandAssistence(WSCUrlFilter.java:792)
> at
> com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:363)
> at
> com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:229)
> at
> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
>
> If you set the callbackInterface above and proceeed you hit the following:
> 2) Axis2ReferenceBindingProvider.java
> - I dont think this requires a wire as this provider already knows abouts its
> InterfaceContract.
> wire is null resulting in a NPE
> private Operation findCallbackOperation(RuntimeWire wire) {
> /*
> InterfaceContract contract = wire.getTarget().getInterfaceContract();
> // TODO:
>
> // which
>
> // end? LAA Hack */
>
> InterfaceContract contract = this.getBindingInterfaceContract(); //
> LAA hack
> List callbackOperations =
> contract.getCallbackInterface().getOperations();
> if (callbackOperations.size() != 1) {
> throw new RuntimeException("Can only handle one callback
> operation");
> }
> Operation callbackOperation = (Operation)callbackOperations.get(0);
> return callbackOperation;
> }
> If you obtain contract directly using getBindingInterfaceContract() you
> proceed and get the following:
> 3) DataBindingRuntimeProcessor
> Caused by: java.lang.NullPointerException
> at
> org.apache.tuscany.core.databinding.wire.DataBindingRuntimeWireProcessor.isTransformationRequired(DataBindingRuntimeWireProcessor.java:51)
> at
> org.apache.tuscany.core.databinding.wire.DataBindingRuntimeWireProcessor.isTransformationRequired(DataBindingRuntimeWireProcessor.java:72)
> at
> org.apache.tuscany.core.databinding.wire.DataBindingRuntimeWireProcessor.isTransformationRequired(DataBindingRuntimeWireProcessor.java:99)
> at
> org.apache.tuscany.core.databinding.wire.DataBindingRuntimeWireProcessor.process(DataBindingRuntimeWireProcessor.java:116)
> at
> org.apache.tuscany.sca.core.invocation.ExtensibleWireProcessor.process(ExtensibleWireProcessor.java:40)
> at
> org.apache.tuscany.sca.core.runtime.CompositeActivatorImpl.createWires(CompositeActivatorImpl.java:348)
> at
> org.apache.tuscany.sca.core.runtime.CompositeActivatorImpl.createRuntimeWires(CompositeActivatorImpl.java:269)
> at
> org.apache.tuscany.sca.core.runtime.CompositeActivatorImpl.activate(CompositeActivatorImpl.java:580)
> ... 14 more
> [6/13/07 9:54:51:646 EDT] 00000018 SystemOut O at
> org.apache.tuscany.sca.core.runtime.CompositeActivatorImpl.activate(CompositeActivatorImpl.java:582)
> [6/13/07 9:54:51:646 EDT] 00000018 SystemOut O at
> org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain$DomainCompositeHelper.addComposite(EmbeddedSCADomain.java:124)
> [6/13/07 9:54:51:646 EDT] 00000018 SystemOut O at
> com.ibm.ws.sca2.tuscany.util.TuscanyInterfaceImpl.startModule(TuscanyInterfaceImpl.java:223)
> [6/13/07 9:54:51:646 EDT] 00000018 SystemOut O at
> com.ibm.ws.soa.sca.admin.runtime.tuscany.SCATuscanyRuntimeHandlerImpl.startModule(SCATuscanyRuntimeHandlerImpl.java:82)
> [6/13/07 9:54:51:646 EDT] 00000018 SystemOut O at
> com.ibm.ws.soa.sca.admin.runtime.impl.SCARuntimeImpl.start(SCARuntimeImpl.java:366)
> [6/13/07 9:54:51:646 EDT] 00000018 SystemOut O ... 10 more
> [6/13/07 9:54:51:646 EDT] 00000018 SystemOut O Caused by:
> java.lang.NullPointerException
> at
> org.apache.tuscany.core.databinding.wire.DataBindingRuntimeWireProcessor.isTransformationRequired(DataBindingRuntimeWireProcessor.java:51)
> at
> org.apache.tuscany.core.databinding.wire.DataBindingRuntimeWireProcessor.isTransformationRequired(DataBindingRuntimeWireProcessor.java:72)
> at
> org.apache.tuscany.core.databinding.wire.DataBindingRuntimeWireProcessor.isTransformationRequired(DataBindingRuntimeWireProcessor.java:99)
> at
> org.apache.tuscany.core.databinding.wire.DataBindingRuntimeWireProcessor.process(DataBindingRuntimeWireProcessor.java:116)
> at
> org.apache.tuscany.sca.core.invocation.ExtensibleWireProcessor.process(ExtensibleWireProcessor.java:40)
> at
> org.apache.tuscany.sca.core.runtime.CompositeActivatorImpl.createWires(CompositeActivatorImpl.java:348)
> at
> org.apache.tuscany.sca.core.runtime.CompositeActivatorImpl.createRuntimeWires(CompositeActivatorImpl.java:269)
> at
> org.apache.tuscany.sca.core.runtime.CompositeActivatorImpl.activate(CompositeActivatorImpl.java:580)
> at
> org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain$DomainCompositeHelper.addComposite(EmbeddedSCADomain.java:124)
>
> 4) I see this comment in Axis2CallbackInvocationHandler which is not being
> executed anyway:
> public Axis2CallbackInvocationHandler(MessageFactory messageFactory,
> RuntimeWire wire) {
> super(messageFactory, false);
> this.wire = wire;
> }
> public Object invoke(Operation operation, Object[] args, LinkedList<URI>
> callbackRoutingChain) throws Throwable {
> // Object targetAddress = callbackRoutingChain.removeFirst();
> // if (targetAddress == null) {
> // throw new AssertionError("Popped a null from address from
> stack");
> // }
> // //TODO optimize as this is slow in local invocations
> // Map<Operation, InvocationChain> sourceCallbackInvocationChains =
> // wire.getCallbackInvocationChains();
> // InvocationChain chain =
> sourceCallbackInvocationChains.get(operation);
> // chain.g
> // TargetInvoker invoker = chain.getTargetInvoker();
> // return invoke(chain, invoker, args, null, callbackRoutingChain,
> null);
> throw new UnsupportedOperationException("not yet implemented");
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]