Hi, Daniel.

Thank you for reporting the issue. We will be looking into this. Which level of Tuscany code are you using? We recently improved the fault/exception handling in the trunk code, can you give a try?

I would also appreciate if you can open a JIRA at http://issues.apache.org/jira/browse/TUSCANY and attach your testcase there.

For the A-->B-->C case, assuming A.ref2B --> B.service and B.ref2C --> C.service, you should be able to pass the ServiceReference of ref2C back to A as follows:

@Service(BService.class)
public class BServiceImpl {

@Reference
protected ServiceReference<CService> ref2C;

public ServiceReference<CService> myOp(...) {
   return ref2C;
}

Please find a complete example at: https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/callablereferences/

Thanks,
Raymond

--------------------------------------------------
From: <[EMAIL PROTECTED]>
Sent: Friday, February 29, 2008 9:18 AM
To: <tuscany-user@ws.apache.org>
Subject: Questions about Java Interfaces using binding.ws

Hi,

I have some Questions regarding Java Interfaces using binding.ws:

1)
I have the following Java Interface that works with binding.sca:

public interface Gamma
{
void start();
void doSomething();
void stop();
}

When I use binding.ws (I let Tuscany create the WSDL interfaces
automatically), I get the following exception (see below):
If I add a parameter (e.g. int x) to any of the methods or I replace any
return type void by a type (e.g. int) it works.
Does WSDL not allow services without any In/Out parameters ?

java.lang.reflect.UndeclaredThrowableException
at $Proxy12.getRef(Unknown Source)
at services.AlphaImpl.run(AlphaImpl.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementation
Invoker.invoke(JavaImplementationInvoker.java:105)
at
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invo
ke(PassByValueInterceptor.java:88)
at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKIn
vocationHandler.java:249)
at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKIn
vocationHandler.java:146)
at $Proxy11.run(Unknown Source)
at launch.Launch.main(Launch.java:14)
Caused by: org.apache.tuscany.sca.interfacedef.util.FaultException: An
unknown message label has been encountered: In
at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2
BindingInvoker.java:80)
at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationIntercept
or.invoke(DataTransformationInterceptor.java:74)
at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKIn
vocationHandler.java:249)
at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKIn
vocationHandler.java:146)
... 12 more


2)
If I rename mtehod start() to init() I get the following exception (see
below). The method is NOT marked with @Init, it's just the name of the
method.

Exception in thread "main" org.osoa.sca.ServiceRuntimeException:
org.osoa.sca.ServiceRuntimeException:
org.apache.tuscany.sca.core.assembly.ActivationException:
java.lang.NullPointerException
at
org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADoma
in.java:264)
at
org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.jav
a:69)
at launch.Launch.main(Launch.java:10)
Caused by: org.osoa.sca.ServiceRuntimeException:
org.apache.tuscany.sca.core.assembly.ActivationException:
java.lang.NullPointerException
at
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(Defaul
tSCADomain.java:183)
at
org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADoma
in.java:230)
... 2 more
Caused by: org.apache.tuscany.sca.core.assembly.ActivationException:
java.lang.NullPointerException
at
org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl.activate(Com
positeActivatorImpl.java:756)
at
org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(Defaul
tSCADomain.java:181)
... 3 more
Caused by: java.lang.NullPointerException
at
org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLOperationIntrospectorI
mpl.getOperation(WSDLOperationIntrospectorImpl.java:206)
at
org.apache.tuscany.sca.interfacedef.wsdl.java2wsdl.Java2WSDLHelper.creat
eWSDLInterfaceContract(Java2WSDLHelper.java:153)
at
org.apache.tuscany.sca.binding.ws.axis2.Axis2ReferenceBindingProvider.<i
nit>(Axis2ReferenceBindingProvider.java:51)
at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingProviderFactory.crea
teReferenceBindingProvider(Axis2BindingProviderFactory.java:53)
at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingProviderFactory.crea
teReferenceBindingProvider(Axis2BindingProviderFactory.java:40)
at
org.apache.tuscany.sca.provider.DefaultProviderFactoryExtensionPoint$Laz
yBindingProviderFactory.createReferenceBindingProvider(DefaultProviderFa
ctoryExtensionPoint.java:190)
at
org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl.addReference
BindingProvider(CompositeActivatorImpl.java:176)
at
org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl.activate(Com
positeActivatorImpl.java:133)
at
org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl.activate(Com
positeActivatorImpl.java:752)
... 4 more


3)
Imagine the following services:
A -> B -> C, where A uses B via binding.ws and B uses C via binding.sca.
Is it possible that B returns a refference to C back to A ?
Are there any limitations regarding distribution? Does this only work if
all services are in one composite, or in different composites in the
same container?


Bye,
Daniel


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to