You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Abraham Washington <ab...@yahoo.com> on 2008/08/29 02:24:01 UTC

invoking reference

hi all,  i have a webapp, that has a composite with a single reference (see below).  the binding.ws uri is up and working (i have a test case that invokes it).  in my OrganizationServiceImpl class, the organizationServiceClient is being injected (verified).  i print out the organizationServiceClient and it's a valid Proxy class.  but, the referenced service is never invoked.  no debug comes up from that service.  no error messages come up from jboss console, so, it's tough debugging.  i'm hoping someone has an idea on where i can start (since there's no errors, i'm confused on where to go).
here's my composite that has the reference:
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"targetNamespace="http://org.soa.services"xmlns:soa="http://org.soa.services"name="Organization-Service-Composite">The wsdl interface for the reference is derived from the information specified by 'uri'
--><!-- A component with an embedded reference definition connecting to an external webservice <component name="OrganizationServiceComponent"><implementation.java class="org.soa.services.OrganizationServiceImpl"/><reference name="organizationServiceClient" ><binding.ws uri="http://192.168.1.7:8087/organization-service-composite/OrganizationService"/></reference></component><!-- A component with a reference promoted as a composite reference --><component name="OrganizationComponent"><implementation.java class="org.soa.services.OrganizationServiceImpl"/></component><reference name="OrganizationServiceClient" promote="OrganizationComponent/organizationServiceClient"><interface.java interface="org.soa.services.OrganizationService" /><binding.ws uri="http://192.168.1.7:8087/organization-service-composite/OrganizationService"/></reference></
Here's my OrganizationServiceImpl class:@Service(OrganizationService.class)public
//@ReferenceOrganizationService String organizationName, SchemaInfo schemaInfo) {
System.
java.util.Collection<Organization> organizations = 
System.
organizations = 
System.
}
e.printStackTrace();
}
}
System.
}
System.
}
and the debug from jboss:
get the scaDomain...
14:38:02,147 INFO  [STDOUT]
get the org service...
14:38:02,176 INFO  [STDOUT]
organizationService -> [Proxy - org.apache.tuscany.sca.core.invocation.JDKInvocationHandler@36473fa1]
14:38:02,177 INFO  [STDOUT]
call findOrganizations...
14:38:02,220 INFO  [STDOUT] 1. Injected organizationServiceClient -> $Proxy63
14:38:02,223 INFO  [STDOUT]
findOrganizationByName ... [Proxy - org.apache.tuscany.sca.core.invocation.JDKInvocationHandler@797e0d93]
14:38:02,224 INFO  [STDOUT] organizationServiceClient -> $Proxy63
14:38:02,262 DEBUG [RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@publicCollection<Organization> findOrganizationByName(out.println("\n\nfindOrganizationByName ... "+ organizationServiceClient);null;try{out.println("organizationServiceClient -> "+ organizationServiceClient.getClass().getName());organizationServiceClient.findOrganizationByName(organizationName, schemaInfo);out.println("organizations -> "+ organizations);catch(Exception e) {returnorganizations;publicOrganizationService getOrganizationServiceClient() {out.println("OrganizationServiceImpl -> Got Injected organizationService");returnorganizationServiceClient;publicvoidsetOrganizationServiceClient(OrganizationService organizationServiceClient) {out.println("1. Injected organizationServiceClient -> "+ organizationServiceClient.getClass().getName()); this.organizationServiceClient=
 organizationServiceClient;organizationServiceClient;classOrganizationServiceImpl implementsOrganizationService {composite>


      

Re: invoking reference

Posted by Simon Laws <si...@googlemail.com>.
On Fri, Aug 29, 2008 at 1:24 AM, Abraham Washington <ab...@yahoo.com>wrote:

> hi all,  i have a webapp, that has a composite with a single reference (see
> below).  the binding.ws uri is up and working (i have a test case that
> invokes it).  in my OrganizationServiceImpl class, the
> organizationServiceClient is being injected (verified).  i print out the
> organizationServiceClient and it's a valid Proxy class.  but, the referenced
> service is never invoked.  no debug comes up from that service.  no error
> messages come up from jboss console, so, it's tough debugging.  i'm hoping
> someone has an idea on where i can start (since there's no errors, i'm
> confused on where to go).
>
> here's my composite that has the reference:
>
>
> <
> composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>
> targetNamespace="http://org.soa.services"
>
> xmlns:soa="http://org.soa.services"
>
> name="Organization-Service-Composite">
>
> <!-- A component with an embedded reference definition connecting to an
> external webservice
>
> The wsdl interface for the reference is derived from the information
> specified by 'uri'
>
> -->
>
> <component name="OrganizationServiceComponent">
>
> <implementation.java class="org.soa.services.OrganizationServiceImpl"/>
>
> <reference name="organizationServiceClient" >
>
> <binding.ws uri="
> http://192.168.1.7:8087/organization-service-composite/OrganizationService
> "/>
>
> </reference>
>
> </component>
>
> <!-- A component with a reference promoted as a composite reference -->
>
> <component name="OrganizationComponent">
>
> <implementation.java class="org.soa.services.OrganizationServiceImpl"/>
>
> </component>
>
> <reference name="OrganizationServiceClient" promote=
> "OrganizationComponent/organizationServiceClient">
>
> <interface.java interface="org.soa.services.OrganizationService" />
>
> <binding.ws uri="
> http://192.168.1.7:8087/organization-service-composite/OrganizationService
> "/>
>
> </reference>
>
> </
> composite>
>
>
>
> Here's my OrganizationServiceImpl class:
>
>
>
> @Service
> (OrganizationService.*class*)*
>
> public
> * *class* OrganizationServiceImpl *implements* OrganizationService {
>
>
>
> //@Reference
>
> OrganizationService
> organizationServiceClient;
>
>
>
> *public* Collection<Organization> findOrganizationByName(
>
> String organizationName, SchemaInfo schemaInfo) {
>
> System.
> *out*.println("\n\nfindOrganizationByName ... " +
> organizationServiceClient);
>
> java.util.Collection<Organization> organizations =
> *null*;
>
> *try* {
>
> System.
> *out*.println("organizationServiceClient -> " + organizationServiceClient.getClass().getName());
>
>
> organizations =
> organizationServiceClient.findOrganizationByName(organizationName,
> schemaInfo);
>
> System.
> *out*.println("organizations -> " + organizations);
>
> }
>
> *catch* (Exception e) {
>
> e.printStackTrace();
>
> }
>
> *return* organizations;
>
> }
>
> *public* OrganizationService getOrganizationServiceClient() {
>
> System.
> *out*.println("OrganizationServiceImpl -> Got Injected
> organizationService");
>
> *return* organizationServiceClient;
>
> }
>
> *public* *void* setOrganizationServiceClient(OrganizationService
> organizationServiceClient) {
>
> System.
> *out*.println("1. Injected organizationServiceClient -> " +
> organizationServiceClient.getClass().getName());
>
> *this*.organizationServiceClient = organizationServiceClient;
>
> }
>
>
>
> and the debug from jboss:
>
>
>
> get the scaDomain...
> 14:38:02,147 INFO  [STDOUT]
>
> get the org service...
> 14:38:02,176 INFO  [STDOUT]
> organizationService -> [Proxy -
> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler@36473fa1]
> 14:38:02,177 INFO  [STDOUT]
>
> call findOrganizations...
> 14:38:02,220 INFO  [STDOUT] 1. Injected organizationServiceClient ->
> $Proxy63
> 14:38:02,223 INFO  [STDOUT]
>
> findOrganizationByName ... [Proxy -
> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler@797e0d93]
> 14:38:02,224 INFO  [STDOUT] organizationServiceClient -> $Proxy63
> 14:38:02,262 DEBUG [RepositoryClassLoader] setRepository,
> repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@
>
>
>
>
Hi Abraham

In your composite you seem to be definition a reference withe binding.ws for
both OrganizationServiceClient and OrganizationServiceComponent. I would
have expected to see a <service/> defined for the
OrganizationServiceComponent in this kind of scenario. Am I missing
something?

Regards

Simon