From ccunningham@example.org Mon Jun 01 03:10:00 2009 Return-Path: <ccunningham@example.org> Delivered-To: ccunningham@example.org Received: (qmail 92814 invoked from network); 1 Jun 2009 03:09:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Jun 2009 03:09:59 -0000 Received: (qmail 50594 invoked by uid 500); 1 Jun 2009 03:10:11 -0000 Delivered-To: ccunningham@example.org Received: (qmail 50514 invoked by uid 500); 1 Jun 2009 03:10:11 -0000 Mailing-List: contact ccunningham@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:ccunningham@example.org> List-Unsubscribe: <mailto:ccunningham@example.org> List-Post: <mailto:ccunningham@example.org> List-Id: <user.tuscany.apache.org> Reply-To: ccunningham@example.org Delivered-To: mailing list ccunningham@example.org Received: (qmail 50506 invoked by uid 99); 1 Jun 2009 03:10:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2009 03:10:11 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ccunningham@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-gx0-f178.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2009 03:10:00 +0000 Received: by gxk26 with SMTP id 26so348035gxk.20 for <ccunningham@example.org>; Sun, 31 May 2009 20:09:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=eftmBPQ6oTzyG3VRMZJe45JuG0uXMwFb96rJ+9plznM=; b=Ez8wh1HXicjYwcOkbykKi2mWEIkFqjikZnbiAI8ze++RxWo5dwnHrd/SbxtMydyoQB e0J3awGOjpx1giqudrVr2Lk8UGd6R5ut8tOIpTLeTipR83uAa1KlETq65AtlIfXoXdsc gT6e93J6NrvLPUWXDzb8++rAuyxXN8wKtIMC0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=gNhG9rDT1suyq0df4IWgwrpmMDvdsRaWCcJiGbKR7JCIqNVcsuVhCn8gKutj6aD7J7 Ww7TqCAPfZ3yfer6ejZ7rvM2bW7ECa9mvRpJ2ZAKeWvOaDVfNLZwoupHPCDsqCBjnzuh esQsN5EOavrVULgWbNbD0mD4X3S1+5Ybjo9VA= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id o1mr1476019ibd.7.1243825769943; Sun, 31 May 2009 20:09:29 -0700 (PDT) In-Reply-To: <ccunningham@example.org> References: <ccunningham@example.org> <ccunningham@example.org> <3BEDD8331D7147A39643CBF5AF079E31@rfengt61p> <ccunningham@example.org> <ccunningham@example.org> <91516E6053284722822CBAA40F593CC9@rfengt61p> <ccunningham@example.org> <ccunningham@example.org> <9CEFED377CB548C5A402AC0A9901000A@rfengt61p> <ccunningham@example.org> Date: Mon, 1 Jun 2009 00:09:28 -0300 Message-ID: <ccunningham@example.org> Subject: Re: WS bindings and SDO From: =?ISO-8859-1?Q?Sebasti=E1n_Groh?= <ccunningham@example.org> To: ccunningham@example.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hello, =A0=A0=A0=A0=A0=A0=A0=A0=A0 Thanks Ant Elder, your Apache Tuscany SCA Java= 1.5 released announce mail responded my last question on this list. Raymond, the problem was fixed in version tuscany 1.5. I didn't need comment the service promotion. I have had the same exception when I tried something like this: 0. public class BiochemicalCircleImpl implements BiochemicalCircle{ 1. 2. public Laboratory getLaboratory(String name) { 3. if (name.length() < 5) 4. return null; 5. Laboratory lab =3D EntityFactory.INSTANCE.createLaboratory(); 6. lab.setName("Main Laboratory"); 7. return lab; 8. } 9. } If condition was true in line 3, null was returned an the exception was: Exception in thread "main" java.lang.ClassCastException: org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl otherwhise, all works perfectly! My solution was, create a Laboratory object with properties setted in null and change invocation logic assuming that always will return a Laboratory object. Empty Laboratories were considered when any of its properties was null. Thanks Raymond, and all people who responded to my earlier concerns. Best Regards, Sebasti=E1n Groh 2009/5/30 Sebasti=E1n Groh <ccunningham@example.org> > > Hello, > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Raymond, thanks for your answer. I've chec= ked my mail late, I see that you can test my example without my source file= s. > At the moment, I commented the service promotion as you suggest, and I'm = trying to download the latest 1.5 code > but I can't found that. > > Someone here knows how to download that version? I was reading Continuum = and in version says "1.6-SNAPSHOT" . > > Have Tuscany SCA version 2.X implemented the same functionality that vers= ion 1.x? > > Raymond, will I found my errors fixed in version 2.X? > > Thanks, > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Sebasti=E1n Groh > > > > > On Sat, May 30, 2009 at 3:57 AM, Raymond Feng <ccunningham@example.org> wrote= : >> >> Hi, >> >> I just tried your test case (adding the classes/resources to the hellowo= rld-ws-sdo sample) with the latest 1.5 code. It works after I fixed an issu= e in the composite file: >> >> <?xml version=3D"1.0" encoding=3D"UTF-8"?> >> <sca:composite xmlns:federation=3D"http://eclipse.org/SCAExample1/src/re= sources/federation" >> =A0 xmlns:sca=3D"http://www.osoa.org/xmlns/sca/1.0" name=3D"clinicalLabo= ratory" >> =A0 targetNamespace=3D"http://eclipse.org/SCAExample1/src/resources/clin= icalLaboratory"> >> >> =A0 <sca:component name=3D"BiochemicalCircleComponent"> >> =A0 =A0 =A0 <sca:implementation.java class=3D"services.bcircle.Biochemic= alCircleImpl" /> >> =A0 =A0 =A0 <sca:service name=3D"BiochemicalCircle"> >> =A0 =A0 =A0 =A0 =A0 <sca:interface.java interface=3D"services.bcircle.Bi= ochemicalCircle" /> >> =A0 =A0 =A0 =A0 =A0 <sca:binding.ws uri=3D"http://localhost:8080/SCA1/My= ServiceComponent" /> >> =A0 =A0 =A0 </sca:service> >> =A0 </sca:component> >> =A0 <!-- >> =A0 <sca:service name=3D"BiochemicalCircle" promote=3D"BiochemicalCircle= Component/BiochemicalCircle" /> >> =A0 =A0--> >> </sca:composite> >> >> Please note the service promotion is commented out as it triggers an iss= ue in Tuscany where the service promotion has the same URI as the internal = binding.ws. >> >> Thanks, >> Raymond >> >> From: Sebasti=E1n Groh >> Sent: Friday, May 29, 2009 3:38 PM >> To: ccunningham@example.org >> Subject: Re: WS bindings and SDO >> >> >> Raymond, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0hello again, I follow your advice =A0" I = suggest that you open a JIRA and attach the test case there so that we can = debug.". I opened a JIRA (link). This is my first bug there. Can you tell m= e if I've posted enough information? >> Thanks, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0Sebasti=E1n Groh >> >> 2009/5/26 Sebasti=E1n Groh <ccunningham@example.org>: >>> >>> Hi Raymond, >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0thanks for your answer. I debug = my application and sca >>> source. >>> Next I will try to explain the invocation chain: >>> >>> When JDKInvocationHandler calls method invoke(InvocationChain chain, >>> Object[] args, RuntimeWire wire, EndpointReference source) >>> >>> line 288: Message resp =3D headInvoker.invoke(msg); // invocation occur= s >>> without errors >>> line 289: Object body =3D resp.getBody(); // Returns an >>> org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl object >>> >>> It seems that body was not instantiated with the correct class. >>> >>> >>> Cite: >>> =A0 =A0 =A0 =A0" I suggest that you open a JIRA and attach the test cas= e there so >>> that we can debug." >>> I'll try this, i never did that before. What I need to post there? >>> >>> For the moment I'll publish my problem here. >>> >>> My XSD file is: >>> <?xml version=3D"1.0" encoding=3D"UTF-8"?> >>> <schema xmlns=3D"http://www.w3.org/2001/XMLSchema" >>> >>> >>> targetNamespace=3D"http://eclipse.org/SCAExample1/src/resources/clinica= lLaboratory" >>> >>> >>> xmlns:tns=3D"http://eclipse.org/SCAExample1/src/resources/clinicalLabor= atory" >>> =A0 elementFormDefault=3D"qualified"> >>> =A0 <complexType name=3D"Practice"> >>> =A0 =A0 =A0 <sequence> >>> =A0 =A0 =A0 =A0 =A0 <element name=3D"name" type=3D"string" /> >>> =A0 =A0 =A0 </sequence> >>> =A0 </complexType> >>> =A0 <complexType name=3D"Laboratory"> >>> =A0 =A0 =A0 <sequence> >>> =A0 =A0 =A0 =A0 =A0 <element name=3D"name" type=3D"string" /> >>> =A0 =A0 =A0 =A0 =A0 <element name=3D"practices" type=3D"tns:Practice" >>> maxOccurs=3D"unbounded"/> >>> =A0 =A0 =A0 =A0</sequence> >>> =A0 </complexType> >>> </schema> >>> >>> Composite file: >>> <?xml version=3D"1.0" encoding=3D"UTF-8"?> >>> <sca:composite >>> xmlns:federation=3D"http://eclipse.org/SCAExample1/src/resources/federa= tion" >>> xmlns:sca=3D"http://www.osoa.org/xmlns/sca/1.0" >>> name=3D"clinicalLaboratory" >>> targetNamespace=3D"http://eclipse.org/SCAExample1/src/resources/clinica= lLaboratory"> >>> <sca:component name=3D"BiochemicalCircleComponent"> >>> =A0 <sca:implementation.java class=3D"services.bcircle.BiochemicalCircl= eImpl"/> >>> =A0 <sca:service name=3D"BiochemicalCircle"> >>> =A0 =A0<sca:interface.java interface=3D"services.bcircle.BiochemicalCir= cle"/> >>> =A0 =A0<sca:binding.ws uri=3D"http://localhost:8080/SCA1/MyServiceCompo= nent"/> >>> =A0 </sca:service> >>> =A0</sca:component> >>> =A0<sca:service name=3D"BiochemicalCircle" >>> promote=3D"BiochemicalCircleComponent/BiochemicalCircle"/> >>> </sca:composite> >>> >>> Interface file: >>> package services.bcircle; >>> import java.util.ArrayList; >>> import javax.xml.bind.annotation.XmlType; >>> import model.sdo.EntityFactory; >>> import org.apache.tuscany.sca.databinding.annotation.DataBinding; >>> import org.osoa.sca.annotations.Remotable; >>> >>> @Remotable >>> public interface BiochemicalCircle{ >>> =A0 =A0void setLaboratory(model.sdo.Laboratory lab); >>> =A0 =A0model.sdo.Laboratory getLaboratory(String name); >>> } >>> >>> Interface implementation: >>> >>> package services.bcircle; >>> import model.sdo.EntityFactory; >>> import model.sdo.Laboratory; >>> import org.osoa.sca.annotations.Service; >>> >>> >>> @Service(BiochemicalCircle.class) >>> public class BiochemicalCircleImpl implements BiochemicalCircle{ >>> =A0 public Laboratory getLaboratory(String name) { >>> =A0 =A0 =A0Laboratory lab =3D EntityFactory.INSTANCE.createLaboratory()= ; >>> =A0 =A0 =A0lab.setName("Main Laboratory"); >>> =A0 =A0 =A0return lab; >>> =A0 } >>> >>> =A0 public void setLaboratory(Laboratory lab) { >>> =A0 =A0 =A0//sad method >>> =A0 =A0 =A0System.out.println(lab.getName()); >>> =A0 } >>> } >>> >>> My Test class: >>> package test; >>> >>> import model.sdo.EntityFactory; >>> import model.sdo.Laboratory; >>> >>> import org.apache.tuscany.sca.host.embedded.SCADomain; >>> import services.bcircle.BiochemicalCircle; >>> import services.bcircle.BiochemicalCircleImpl; >>> >>> >>> public class Test { >>> >>> =A0 =A0/** >>> =A0 =A0 * @param args >>> =A0 =A0 */ >>> =A0 =A0public static void main(String[] args) { >>> =A0 =A0 =A0 =A0BiochemicalCircle biochemicalCircl =3D new BiochemicalCi= rcleImpl(); >>> =A0 =A0 =A0 =A0Laboratory lab2 =3D biochemicalCircl.getLaboratory("Lab2= "); //This >>> invocation without use SCA works ok. >>> >>> >>> =A0 =A0 =A0 =A0SCADomain scaDomain =3D >>> SCADomain.newInstance("resources/clinicalLaboratory.composite"); >>> =A0 =A0 =A0 =A0BiochemicalCircle biochemicalCircle =3D scaDomain.getSer= vice( >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0BiochemicalCircle.class, "BiochemicalCir= cleComponent"); >>> =A0 =A0 =A0 =A0Laboratory lab =3D EntityFactory.INSTANCE.createLaborato= ry(); >>> =A0 =A0 =A0 =A0lab.setName("lab2"); >>> =A0 =A0 =A0 =A0biochemicalCircle.setLaboratory(lab); // this invocation= works ok >>> too >>> >>> =A0 =A0 =A0 =A0lab =3D biochemicalCircle.getLaboratory("Lab2"); // here= I have an >>> exception posted below. >>> >>> =A0 =A0 =A0 =A0//here I wait a moment before close scaDomain >>> >>> =A0 =A0 =A0 =A0scaDomain.close(); >>> >>> } >>> >>> Exception: >>> Exception in thread "main" java.lang.ClassCastException: >>> org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl >>> =A0 =A0at $Proxy16.getLaboratory(Unknown Source) >>> =A0 =A0at test.Test.main(Test.java:28) >>> >>> Note: >>> EntityFactory and sdo objects where created using >>> org.apache.tuscany.sdo.generate.XSD2JavaGenerator. >>> >>> Please, tell me if something is wrong. >>> Regards, >>> >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Sebasti=E1n Groh >>> >>> >>> >>> >>> On Tue, May 26, 2009 at 12:30 PM, Raymond Feng <ccunningham@example.org> wr= ote: >>>> >>>> Did you check the response message from the WS? It might be the case t= hat >>>> XML payload is not conforming to the XSD which is used to generate the >>>> SDO. >>>> >>>> I suggest that you open a JIRA and attach the test case there so that = we >>>> can >>>> debug. >>>> >>>> Thanks, >>>> Raymond >>>> >>>> -------------------------------------------------- >>>> From: "Sebasti=E1n Groh" <ccunningham@example.org> >>>> Sent: Sunday, May 24, 2009 11:06 PM >>>> To: <ccunningham@example.org> >>>> Subject: Re: WS bindings and SDO >>>> >>>>> Hello, >>>>> >>>>> =A0 =A0 =A0 =A0Raymond I've posted my interface in my last mail, afte= r that >>>>> I did some tests. >>>>> When I send a SDO Object, all runs ok, but unfortunately for all SCA >>>>> users, return an SDO object is a problem even if HelperContext is >>>>> used. >>>>> >>>>> For example: >>>>> 1. =A0SCADomain scaDomain =3D >>>>> =A0 =A0 =A0 =A0 =A0 =A0 SCADomain.newInstance("clinicalLaboratory.com= posite"); >>>>> 2. =A0BiochemicalCircle service =3D >>>>> >>>>> >>>>> scaDomain.getService(BiochemicalCircle.class,"BiochemicalCircleCompon= ent"); >>>>> 3. Laboratory lab =3D EntityFactory.INSTANCE.createLaboratory(); >>>>> 4. lab.setName("lab2"); >>>>> 5. biochemicalCircle.setLaboratory(lab); >>>>> 6. Laboratory posibleLab =3D (Laboratory) service.getLaboratory("Lab2= "); >>>>> >>>>> Line 5 works ok, SDO Laboratory object was send and name property was >>>>> read ok on server side. >>>>> Line 6 fails, I'm having always the same error: >>>>> >>>>> =A0java.lang.ClassCastException: >>>>> =A0org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl >>>>> =A0at $Proxy18.getLaboratory(Unknown Source) >>>>> >>>>> Thanks, >>>>> Best Regards, >>>>> >>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Sebasti=E1n Groh >>>>> >>>>> >>>>> >>>>> 2009/5/22 Sebasti=E1n Groh <ccunningham@example.org>: >>>>>> >>>>>> Hello Raymond, >>>>>> >>>>>> My Interface is quite simple: >>>>>> >>>>>> package services.bcircle; >>>>>> >>>>>> import java.util.ArrayList; >>>>>> >>>>>> import org.osoa.sca.annotations.Remotable; >>>>>> >>>>>> @Remotable >>>>>> public interface BiochemicalCircle{ >>>>>> >>>>>> >>>>>> =A0 =A0 =A0ArrayList<String> getLaboratoriesNames(); >>>>>> >>>>>> =A0 =A0 =A0model.sdo.Laboratory getLaboratory(String name); >>>>>> >>>>>> } >>>>>> >>>>>> I think that my problem is related with SDO HelperContext but I'm >>>>>> confused. >>>>>> >>>>>> Thanks, >>>>>> =A0 =A0 =A0 =A0 =A0 =A0Sebasti=E1n >>>>>> >>>>>> >>>>>> On Fri, May 22, 2009 at 7:50 PM, Raymond Feng <ccunningham@example.org> >>>>>> wrote: >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> It seems that the SDO HelperContext is not correctly populated by >>>>>>> Tuscany >>>>>>> based on the introspection of the Java interface that references th= e >>>>>>> SDO >>>>>>> types. Can you post the BiochemicalCircle interface? >>>>>>> >>>>>>> Thanks, >>>>>>> Raymond >>>>>>> >>>>>>> -------------------------------------------------- >>>>>>> From: "Sebasti=E1n Groh" <ccunningham@example.org> >>>>>>> Sent: Friday, May 22, 2009 2:47 PM >>>>>>> To: <ccunningham@example.org> >>>>>>> Subject: Re: WS bindings and SDO >>>>>>> >>>>>>>> Hello Again, >>>>>>>> >>>>>>>> I'm getting the same error using ws binding. >>>>>>>> If I try: >>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0SCADomain scaDomain =3D >>>>>>>> SCADomain.newInstance("clinicalLaboratory.composite"); >>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0BiochemicalCircle service =3D >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> scaDomain.getService(BiochemicalCircle.class,"BiochemicalCircleCom= ponent"); >>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0Laboratory lab =3D (Laboratory) >>>>>>>> service.getLaboratory("Lab2"); >>>>>>>> >>>>>>>> I have the exception: >>>>>>>> =A0 =A0java.lang.ClassCastException: >>>>>>>> =A0 org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl >>>>>>>> =A0 at $Proxy18.getLaboratory(Unknown Source) >>>>>>>> >>>>>>>> but if I simple do: >>>>>>>> >>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 BiochemicalCircle biochemicalCircle =3D ne= w >>>>>>>> BiochemicalCircleImpl(); >>>>>>>> Laboratory lab2 =3D biochemicalCircle.getLaboratory("Lab2"); >>>>>>>> >>>>>>>> All runs ok. >>>>>>>> >>>>>>>> Invocation to BiochemicalCircle methods that not have SDO paramete= rs >>>>>>>> (or return them) works fine even if SCADomain is used. >>>>>>>> >>>>>>>> Any in this list, know what I should do for solve this problem? >>>>>>>> >>>>>>>> Thanks, >>>>>>>> =A0 =A0 =A0 =A0 =A0 Sebasti=E1n >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> 2009/5/21 Sebasti=E1n Groh <ccunningham@example.org>: >>>>>>>>> >>>>>>>>> Hello Kevin, Simon, >>>>>>>>> >>>>>>>>> cite: >>>>>>>>> =A0 =A0 =A0 =A0Is the XSD you generated the SDO from included in = your >>>>>>>>> contribution? >>>>>>>>> >>>>>>>>> Yes I'm including the XSD, but how and when should it be used? >>>>>>>>> I verified if wsdl generated have included schema types and there= are >>>>>>>>> ok. I thought that was enough if the wsdl have schemas included. = Is >>>>>>>>> this correct? >>>>>>>>> >>>>>>>>> Simon, you are rigth when you see AnyTypeDataObjectImpl instances= is >>>>>>>>> becouse "If the ServiceFactory is not registered, the data (from = the >>>>>>>>> inline schema of the WSDL) are then represented by >>>>>>>>> 'org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl' " >>>>>>>>> >>>>>>>>> What must I do? Use =A0commonj.sdo.helper.HelperContext or not? >>>>>>>>> >>>>>>>>> >>>>>>>>> Any user in this list have errors like that? >>>>>>>>> Thanks for yours answers, >>>>>>>>> Regards, >>>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 Sebasti=E1n >>>>>>>>> >>>>>>>>> On Thu, May 21, 2009 at 6:50 AM, kelvin goodson >>>>>>>>> <ccunningham@example.org> >>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>> I'm no expert on how SCA uses SDO, but I do understand the SDO s= ide >>>>>>>>>> of >>>>>>>>>> this, which may help you or someone else get to how to fix this >>>>>>>>>> within >>>>>>>>>> SCA. =A0The time that you see instances of AnyTypeDataObjectImpl >>>>>>>>>> appearing is when an SDO deserialization operation has no metada= ta >>>>>>>>>> within its operating context to describe an object it is trying = to >>>>>>>>>> deserialize, so it falls back on a very weak default model of da= ta >>>>>>>>>> embodied in the built-in AnyTypedataObject SDO class. >>>>>>>>>> >>>>>>>>>> Either the SCA infrastructure or you must arrange for the genera= ted >>>>>>>>>> SDO factory associated with your Laboratory class to be known to= the >>>>>>>>>> relevant instance of SDO's HelperContext class. My feeling is th= ere >>>>>>>>>> is >>>>>>>>>> most probably a way to influence SCA to do this for you, =A0but = I >>>>>>>>>> don't >>>>>>>>>> know how. =A0At the Tuscany SDO API level, the metadata registra= tion >>>>>>>>>> is >>>>>>>>>> done via the Factory's register(HelperContext scope) =A0method, = so you >>>>>>>>>> could watch for calls to that method on the factory impl. >>>>>>>>>> >>>>>>>>>> Kelvin. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> 2009/5/21 Simon Laws <ccunningham@example.org>: >>>>>>>>>>> >>>>>>>>>>> 2009/5/21 Sebasti=E1n Groh <ccunningham@example.org>: >>>>>>>>>>>> >>>>>>>>>>>> Hello, I'm trying to work with an SCA Composite that use ws >>>>>>>>>>>> binding. >>>>>>>>>>>> My component definition: >>>>>>>>>>>> =A0<sca:component name=3D"BiochemicalCircleComponent"> >>>>>>>>>>>> =A0<sca:implementation.java >>>>>>>>>>>> class=3D"services.bcircle.BiochemicalCircleImpl"/> >>>>>>>>>>>> =A0<sca:service name=3D"BiochemicalCircle"> >>>>>>>>>>>> =A0 =A0 <sca:interface.java >>>>>>>>>>>> interface=3D"services.bcircle.BiochemicalCircle"/> >>>>>>>>>>>> =A0 =A0 <sca:binding.ws >>>>>>>>>>>> uri=3D"http://localhost:8080/SCA1/MyServiceComponent"/> >>>>>>>>>>>> =A0</sca:service> >>>>>>>>>>>> =A0</sca:component> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> The service retrieve a SDO object (Laboratory) that I generate= d >>>>>>>>>>>> from >>>>>>>>>>>> XSD without problems. >>>>>>>>>>>> I deployed the project on Apache Tomcat/5.5.27 and I'm using t= his >>>>>>>>>>>> service from a jsp page as follows: >>>>>>>>>>>> >>>>>>>>>>>> (my includes) >>>>>>>>>>>> . >>>>>>>>>>>> . >>>>>>>>>>>> . >>>>>>>>>>>> <% SCADomain scaDomain =3D >>>>>>>>>>>> SCADomain.newInstance("clinicalLaboratory.composite"); >>>>>>>>>>>> =A0 =A0BiochemicalCircle service =3D >>>>>>>>>>>> scaDomain.getService(BiochemicalCircle.class, >>>>>>>>>>>> "BiochemicalCircleComponent"); >>>>>>>>>>>> >>>>>>>>>>>> =A0 =A0 Laboratory lab =3D (Laboratory) service.getLaboratory(= "Lab2"); >>>>>>>>>>>> . >>>>>>>>>>>> . =A0(more logic) >>>>>>>>>>>> . >>>>>>>>>>>> >>>>>>>>>>>> %> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> In line >>>>>>>>>>>> =A0 =A0 =A0 Laboratory lab =3D (Laboratory) >>>>>>>>>>>> service.getLaboratory("Lab2"); >>>>>>>>>>>> >>>>>>>>>>>> I have the exception: >>>>>>>>>>>> =A0 =A0 java.lang.ClassCastException: >>>>>>>>>>>> org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl >>>>>>>>>>>> =A0 =A0 at $Proxy18.getLaboratory(Unknown Source) >>>>>>>>>>>> >>>>>>>>>>>> I have also tried to use the class >>>>>>>>>>>> commonj.sdo.helper.HelperContext >>>>>>>>>>>> to >>>>>>>>>>>> set a scope for my SDOFactory but I'm having the same exceptio= n. >>>>>>>>>>>> >>>>>>>>>>>> Anyone in this list know to solve this error? >>>>>>>>>>>> Regards, >>>>>>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 Sebasti=E1n >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Hi Sebastien >>>>>>>>>>> >>>>>>>>>>> Is the XSD you generated the SDO from included in your >>>>>>>>>>> contribution? >>>>>>>>>>> I'm looking at the 1.x sample helloworld-ws-sdo-webapp and can'= t >>>>>>>>>>> actually see that the SDO types are specified explicitly but th= e >>>>>>>>>>> XSD >>>>>>>>>>> used to generate them is included. Any of the SDO experts out t= here >>>>>>>>>>> know how we should be describing the SDO context in SCA? >>>>>>>>>>> >>>>>>>>>>> Simon >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >>> >> > From ccunningham@example.org Mon Jun 01 08:42:39 2009 Return-Path: <ccunningham@example.org> Delivered-To: ccunningham@example.org Received: (qmail 3375 invoked from network); 1 Jun 2009 08:42:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Jun 2009 08:42:39 -0000 Received: (qmail 56128 invoked by uid 500); 1 Jun 2009 08:42:50 -0000 Delivered-To: ccunningham@example.org Received: (qmail 56055 invoked by uid 500); 1 Jun 2009 08:42:50 -0000 Mailing-List: contact ccunningham@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:ccunningham@example.org> List-Unsubscribe: <mailto:ccunningham@example.org> List-Post: <mailto:ccunningham@example.org> List-Id: <user.tuscany.apache.org> Reply-To: ccunningham@example.org Delivered-To: mailing list ccunningham@example.org Received: (qmail 56047 invoked by uid 99); 1 Jun 2009 08:42:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2009 08:42:50 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ccunningham@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-bw0-f226.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2009 08:42:40 +0000 Received: by bwz26 with SMTP id 26so6940897bwz.20 for <ccunningham@example.org>; Mon, 01 Jun 2009 01:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=UgHR2Si4+JloOMj1WfxbM9YZvIsxa7F8kWtr9LEtwrI=; b=YKDPb14CFc2ktP9c+9IcSI52nvZu2gqMxY25h3fXVlnXCbv0Fr8X3NZWApAqDtHw+d 0UG3VvkXxdUHCJkKQ8NUky3rRSjpLHFWS9A0AeFGVlGR28v4L9ysZg8CIFYCkZonZ9oH 75tJZabsuWM3D77SNwWdkz5K/m2CGvXIZfYSc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=uAlmFHJaDK4fkEHkKsaiLFQFWIgxikhPpcpztsO8FlBg5SJAHtGRDvu26mGzEryX91 q/RDp0TjF752j/hNAPZ/PEj04kz78pnyjcRGFG2zsr1dR/TpZfquIZAipD+2YsG4uRXd FtaTUcr4k/xzC7gYlA5LAFtwnvnpq7jA0rywk= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id k10mr5434545bkr.129.1243845736467; Mon, 01 Jun 2009 01:42:16 -0700 (PDT) In-Reply-To: <ccunningham@example.org> References: <ccunningham@example.org> <3BEDD8331D7147A39643CBF5AF079E31@rfengt61p> <ccunningham@example.org> <ccunningham@example.org> <91516E6053284722822CBAA40F593CC9@rfengt61p> <ccunningham@example.org> <ccunningham@example.org> <9CEFED377CB548C5A402AC0A9901000A@rfengt61p> <ccunningham@example.org> <ccunningham@example.org> Date: Mon, 1 Jun 2009 09:42:16 +0100 Message-ID: <ccunningham@example.org> Subject: Re: WS bindings and SDO From: kelvin goodson <ccunningham@example.org> To: ccunningham@example.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi Sebastien it's not clear to me whether you intend to use lines such as ... Laboratory lab =3D EntityFactory.INSTANCE.createLaboratory(); in your solution, or whether this is just a quick piece of demo code. If I understand this thread properly then I think you have solved your problem, however, I would just like to comment that the line ... Laboratory lab =3D EntityFactory.INSTANCE.createLaboratory(); is not the best way to create an SDO instance. Maybe tyhis is just a quick demo line of code, but using the generated Factory instances directly allows coding that might lead you to believe that you have a good working SDO environment when you might not have. As this thread has mentioned, the SDO runtime needs to have metadat 2009/6/1 Sebasti=E1n Groh <ccunningham@example.org>: > Hello, > =A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0Thanks Ant Elder, your Apache Tuscany SCA = Java 1.5 released > announce mail responded my last question on this list. > > =A0 =A0 =A0 =A0 =A0 Raymond, the problem was fixed in version tuscany 1.5= . I > didn't need comment the service promotion. > I have had the same exception when I tried something like this: > > 0. =A0public class BiochemicalCircleImpl implements BiochemicalCircle{ > 1. > 2. =A0 =A0 public Laboratory getLaboratory(String name) { > 3. =A0 =A0 =A0 =A0if (name.length() < 5) > 4. =A0 =A0 =A0 =A0 =A0 =A0 return null; > 5. =A0 =A0 =A0 =A0Laboratory lab =3D EntityFactory.INSTANCE.createLaborat= ory(); > 6. =A0 =A0 =A0 =A0lab.setName("Main Laboratory"); > 7. =A0 =A0 =A0 =A0return lab; > 8. =A0 =A0 } > 9. =A0} > > If condition was true in line 3, null was returned an the exception was: > Exception in thread "main" java.lang.ClassCastException: > org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl > > otherwhise, all works perfectly! > > My solution was, create a Laboratory object with properties setted in > null and change invocation logic assuming that always will return a > Laboratory object. Empty Laboratories were considered when any of its > properties was null. > > > Thanks Raymond, and all people who responded to my earlier concerns. > Best Regards, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Sebasti=E1n Groh > > > > 2009/5/30 Sebasti=E1n Groh <ccunningham@example.org> >> >> Hello, >> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Raymond, thanks for your answer. I've che= cked my mail late, I see that you can test my example without my source fil= es. >> At the moment, I commented the service promotion as you suggest, and I'm= trying to download the latest 1.5 code >> but I can't found that. >> >> Someone here knows how to download that version? I was reading Continuum= and in version says "1.6-SNAPSHOT" . >> >> Have Tuscany SCA version 2.X implemented the same functionality that ver= sion 1.x? >> >> Raymond, will I found my errors fixed in version 2.X? >> >> Thanks, >> >> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Sebasti=E1n Groh >> >> >> >> >> On Sat, May 30, 2009 at 3:57 AM, Raymond Feng <ccunningham@example.org> wrot= e: >>> >>> Hi, >>> >>> I just tried your test case (adding the classes/resources to the hellow= orld-ws-sdo sample) with the latest 1.5 code. It works after I fixed an iss= ue in the composite file: >>> >>> <?xml version=3D"1.0" encoding=3D"UTF-8"?> >>> <sca:composite xmlns:federation=3D"http://eclipse.org/SCAExample1/src/r= esources/federation" >>> =A0 xmlns:sca=3D"http://www.osoa.org/xmlns/sca/1.0" name=3D"clinicalLab= oratory" >>> =A0 targetNamespace=3D"http://eclipse.org/SCAExample1/src/resources/cli= nicalLaboratory"> >>> >>> =A0 <sca:component name=3D"BiochemicalCircleComponent"> >>> =A0 =A0 =A0 <sca:implementation.java class=3D"services.bcircle.Biochemi= calCircleImpl" /> >>> =A0 =A0 =A0 <sca:service name=3D"BiochemicalCircle"> >>> =A0 =A0 =A0 =A0 =A0 <sca:interface.java interface=3D"services.bcircle.B= iochemicalCircle" /> >>> =A0 =A0 =A0 =A0 =A0 <sca:binding.ws uri=3D"http://localhost:8080/SCA1/M= yServiceComponent" /> >>> =A0 =A0 =A0 </sca:service> >>> =A0 </sca:component> >>> =A0 <!-- >>> =A0 <sca:service name=3D"BiochemicalCircle" promote=3D"BiochemicalCircl= eComponent/BiochemicalCircle" /> >>> =A0 =A0--> >>> </sca:composite> >>> >>> Please note the service promotion is commented out as it triggers an is= sue in Tuscany where the service promotion has the same URI as the internal= binding.ws. >>> >>> Thanks, >>> Raymond >>> >>> From: Sebasti=E1n Groh >>> Sent: Friday, May 29, 2009 3:38 PM >>> To: ccunningham@example.org >>> Subject: Re: WS bindings and SDO >>> >>> >>> Raymond, >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0hello again, I follow your advice =A0" I= suggest that you open a JIRA and attach the test case there so that we can= debug.". I opened a JIRA (link). This is my first bug there. Can you tell = me if I've posted enough information? >>> Thanks, >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0Sebasti=E1n Groh >>> >>> 2009/5/26 Sebasti=E1n Groh <ccunningham@example.org>: >>>> >>>> Hi Raymond, >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0thanks for your answer. I debug= my application and sca >>>> source. >>>> Next I will try to explain the invocation chain: >>>> >>>> When JDKInvocationHandler calls method invoke(InvocationChain chain, >>>> Object[] args, RuntimeWire wire, EndpointReference source) >>>> >>>> line 288: Message resp =3D headInvoker.invoke(msg); // invocation occu= rs >>>> without errors >>>> line 289: Object body =3D resp.getBody(); // Returns an >>>> org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl object >>>> >>>> It seems that body was not instantiated with the correct class. >>>> >>>> >>>> Cite: >>>> =A0 =A0 =A0 =A0" I suggest that you open a JIRA and attach the test ca= se there so >>>> that we can debug." >>>> I'll try this, i never did that before. What I need to post there? >>>> >>>> For the moment I'll publish my problem here. >>>> >>>> My XSD file is: >>>> <?xml version=3D"1.0" encoding=3D"UTF-8"?> >>>> <schema xmlns=3D"http://www.w3.org/2001/XMLSchema" >>>> >>>> >>>> targetNamespace=3D"http://eclipse.org/SCAExample1/src/resources/clinic= alLaboratory" >>>> >>>> >>>> xmlns:tns=3D"http://eclipse.org/SCAExample1/src/resources/clinicalLabo= ratory" >>>> =A0 elementFormDefault=3D"qualified"> >>>> =A0 <complexType name=3D"Practice"> >>>> =A0 =A0 =A0 <sequence> >>>> =A0 =A0 =A0 =A0 =A0 <element name=3D"name" type=3D"string" /> >>>> =A0 =A0 =A0 </sequence> >>>> =A0 </complexType> >>>> =A0 <complexType name=3D"Laboratory"> >>>> =A0 =A0 =A0 <sequence> >>>> =A0 =A0 =A0 =A0 =A0 <element name=3D"name" type=3D"string" /> >>>> =A0 =A0 =A0 =A0 =A0 <element name=3D"practices" type=3D"tns:Practice" >>>> maxOccurs=3D"unbounded"/> >>>> =A0 =A0 =A0 =A0</sequence> >>>> =A0 </complexType> >>>> </schema> >>>> >>>> Composite file: >>>> <?xml version=3D"1.0" encoding=3D"UTF-8"?> >>>> <sca:composite >>>> xmlns:federation=3D"http://eclipse.org/SCAExample1/src/resources/feder= ation" >>>> xmlns:sca=3D"http://www.osoa.org/xmlns/sca/1.0" >>>> name=3D"clinicalLaboratory" >>>> targetNamespace=3D"http://eclipse.org/SCAExample1/src/resources/clinic= alLaboratory"> >>>> <sca:component name=3D"BiochemicalCircleComponent"> >>>> =A0 <sca:implementation.java class=3D"services.bcircle.BiochemicalCirc= leImpl"/> >>>> =A0 <sca:service name=3D"BiochemicalCircle"> >>>> =A0 =A0<sca:interface.java interface=3D"services.bcircle.BiochemicalCi= rcle"/> >>>> =A0 =A0<sca:binding.ws uri=3D"http://localhost:8080/SCA1/MyServiceComp= onent"/> >>>> =A0 </sca:service> >>>> =A0</sca:component> >>>> =A0<sca:service name=3D"BiochemicalCircle" >>>> promote=3D"BiochemicalCircleComponent/BiochemicalCircle"/> >>>> </sca:composite> >>>> >>>> Interface file: >>>> package services.bcircle; >>>> import java.util.ArrayList; >>>> import javax.xml.bind.annotation.XmlType; >>>> import model.sdo.EntityFactory; >>>> import org.apache.tuscany.sca.databinding.annotation.DataBinding; >>>> import org.osoa.sca.annotations.Remotable; >>>> >>>> @Remotable >>>> public interface BiochemicalCircle{ >>>> =A0 =A0void setLaboratory(model.sdo.Laboratory lab); >>>> =A0 =A0model.sdo.Laboratory getLaboratory(String name); >>>> } >>>> >>>> Interface implementation: >>>> >>>> package services.bcircle; >>>> import model.sdo.EntityFactory; >>>> import model.sdo.Laboratory; >>>> import org.osoa.sca.annotations.Service; >>>> >>>> >>>> @Service(BiochemicalCircle.class) >>>> public class BiochemicalCircleImpl implements BiochemicalCircle{ >>>> =A0 public Laboratory getLaboratory(String name) { >>>> =A0 =A0 =A0Laboratory lab =3D EntityFactory.INSTANCE.createLaboratory(= ); >>>> =A0 =A0 =A0lab.setName("Main Laboratory"); >>>> =A0 =A0 =A0return lab; >>>> =A0 } >>>> >>>> =A0 public void setLaboratory(Laboratory lab) { >>>> =A0 =A0 =A0//sad method >>>> =A0 =A0 =A0System.out.println(lab.getName()); >>>> =A0 } >>>> } >>>> >>>> My Test class: >>>> package test; >>>> >>>> import model.sdo.EntityFactory; >>>> import model.sdo.Laboratory; >>>> >>>> import org.apache.tuscany.sca.host.embedded.SCADomain; >>>> import services.bcircle.BiochemicalCircle; >>>> import services.bcircle.BiochemicalCircleImpl; >>>> >>>> >>>> public class Test { >>>> >>>> =A0 =A0/** >>>> =A0 =A0 * @param args >>>> =A0 =A0 */ >>>> =A0 =A0public static void main(String[] args) { >>>> =A0 =A0 =A0 =A0BiochemicalCircle biochemicalCircl =3D new BiochemicalC= ircleImpl(); >>>> =A0 =A0 =A0 =A0Laboratory lab2 =3D biochemicalCircl.getLaboratory("Lab= 2"); //This >>>> invocation without use SCA works ok. >>>> >>>> >>>> =A0 =A0 =A0 =A0SCADomain scaDomain =3D >>>> SCADomain.newInstance("resources/clinicalLaboratory.composite"); >>>> =A0 =A0 =A0 =A0BiochemicalCircle biochemicalCircle =3D scaDomain.getSe= rvice( >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0BiochemicalCircle.class, "BiochemicalCi= rcleComponent"); >>>> =A0 =A0 =A0 =A0Laboratory lab =3D EntityFactory.INSTANCE.createLaborat= ory(); >>>> =A0 =A0 =A0 =A0lab.setName("lab2"); >>>> =A0 =A0 =A0 =A0biochemicalCircle.setLaboratory(lab); // this invocatio= n works ok >>>> too >>>> >>>> =A0 =A0 =A0 =A0lab =3D biochemicalCircle.getLaboratory("Lab2"); // her= e I have an >>>> exception posted below. >>>> >>>> =A0 =A0 =A0 =A0//here I wait a moment before close scaDomain >>>> >>>> =A0 =A0 =A0 =A0scaDomain.close(); >>>> >>>> } >>>> >>>> Exception: >>>> Exception in thread "main" java.lang.ClassCastException: >>>> org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl >>>> =A0 =A0at $Proxy16.getLaboratory(Unknown Source) >>>> =A0 =A0at test.Test.main(Test.java:28) >>>> >>>> Note: >>>> EntityFactory and sdo objects where created using >>>> org.apache.tuscany.sdo.generate.XSD2JavaGenerator. >>>> >>>> Please, tell me if something is wrong. >>>> Regards, >>>> >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Sebasti=E1n Groh >>>> >>>> >>>> >>>> >>>> On Tue, May 26, 2009 at 12:30 PM, Raymond Feng <ccunningham@example.org> w= rote: >>>>> >>>>> Did you check the response message from the WS? It might be the case = that >>>>> XML payload is not conforming to the XSD which is used to generate th= e >>>>> SDO. >>>>> >>>>> I suggest that you open a JIRA and attach the test case there so that= we >>>>> can >>>>> debug. >>>>> >>>>> Thanks, >>>>> Raymond >>>>> >>>>> -------------------------------------------------- >>>>> From: "Sebasti=E1n Groh" <ccunningham@example.org> >>>>> Sent: Sunday, May 24, 2009 11:06 PM >>>>> To: <ccunningham@example.org> >>>>> Subject: Re: WS bindings and SDO >>>>> >>>>>> Hello, >>>>>> >>>>>> =A0 =A0 =A0 =A0Raymond I've posted my interface in my last mail, aft= er that >>>>>> I did some tests. >>>>>> When I send a SDO Object, all runs ok, but unfortunately for all SCA >>>>>> users, return an SDO object is a problem even if HelperContext is >>>>>> used. >>>>>> >>>>>> For example: >>>>>> 1. =A0SCADomain scaDomain =3D >>>>>> =A0 =A0 =A0 =A0 =A0 =A0 SCADomain.newInstance("clinicalLaboratory.co= mposite"); >>>>>> 2. =A0BiochemicalCircle service =3D >>>>>> >>>>>> >>>>>> scaDomain.getService(BiochemicalCircle.class,"BiochemicalCircleCompo= nent"); >>>>>> 3. Laboratory lab =3D EntityFactory.INSTANCE.createLaboratory(); >>>>>> 4. lab.setName("lab2"); >>>>>> 5. biochemicalCircle.setLaboratory(lab); >>>>>> 6. Laboratory posibleLab =3D (Laboratory) service.getLaboratory("Lab= 2"); >>>>>> >>>>>> Line 5 works ok, SDO Laboratory object was send and name property wa= s >>>>>> read ok on server side. >>>>>> Line 6 fails, I'm having always the same error: >>>>>> >>>>>> =A0java.lang.ClassCastException: >>>>>> =A0org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl >>>>>> =A0at $Proxy18.getLaboratory(Unknown Source) >>>>>> >>>>>> Thanks, >>>>>> Best Regards, >>>>>> >>>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Sebasti=E1n Groh >>>>>> >>>>>> >>>>>> >>>>>> 2009/5/22 Sebasti=E1n Groh <ccunningham@example.org>: >>>>>>> >>>>>>> Hello Raymond, >>>>>>> >>>>>>> My Interface is quite simple: >>>>>>> >>>>>>> package services.bcircle; >>>>>>> >>>>>>> import java.util.ArrayList; >>>>>>> >>>>>>> import org.osoa.sca.annotations.Remotable; >>>>>>> >>>>>>> @Remotable >>>>>>> public interface BiochemicalCircle{ >>>>>>> >>>>>>> >>>>>>> =A0 =A0 =A0ArrayList<String> getLaboratoriesNames(); >>>>>>> >>>>>>> =A0 =A0 =A0model.sdo.Laboratory getLaboratory(String name); >>>>>>> >>>>>>> } >>>>>>> >>>>>>> I think that my problem is related with SDO HelperContext but I'm >>>>>>> confused. >>>>>>> >>>>>>> Thanks, >>>>>>> =A0 =A0 =A0 =A0 =A0 =A0Sebasti=E1n >>>>>>> >>>>>>> >>>>>>> On Fri, May 22, 2009 at 7:50 PM, Raymond Feng <ccunningham@example.org> >>>>>>> wrote: >>>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> It seems that the SDO HelperContext is not correctly populated by >>>>>>>> Tuscany >>>>>>>> based on the introspection of the Java interface that references t= he >>>>>>>> SDO >>>>>>>> types. Can you post the BiochemicalCircle interface? >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Raymond >>>>>>>> >>>>>>>> -------------------------------------------------- >>>>>>>> From: "Sebasti=E1n Groh" <ccunningham@example.org> >>>>>>>> Sent: Friday, May 22, 2009 2:47 PM >>>>>>>> To: <ccunningham@example.org> >>>>>>>> Subject: Re: WS bindings and SDO >>>>>>>> >>>>>>>>> Hello Again, >>>>>>>>> >>>>>>>>> I'm getting the same error using ws binding. >>>>>>>>> If I try: >>>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0SCADomain scaDomain =3D >>>>>>>>> SCADomain.newInstance("clinicalLaboratory.composite"); >>>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0BiochemicalCircle service =3D >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> scaDomain.getService(BiochemicalCircle.class,"BiochemicalCircleCo= mponent"); >>>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0Laboratory lab =3D (Laboratory) >>>>>>>>> service.getLaboratory("Lab2"); >>>>>>>>> >>>>>>>>> I have the exception: >>>>>>>>> =A0 =A0java.lang.ClassCastException: >>>>>>>>> =A0 org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl >>>>>>>>> =A0 at $Proxy18.getLaboratory(Unknown Source) >>>>>>>>> >>>>>>>>> but if I simple do: >>>>>>>>> >>>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 BiochemicalCircle biochemicalCircle =3D n= ew >>>>>>>>> BiochemicalCircleImpl(); >>>>>>>>> Laboratory lab2 =3D biochemicalCircle.getLaboratory("Lab2"); >>>>>>>>> >>>>>>>>> All runs ok. >>>>>>>>> >>>>>>>>> Invocation to BiochemicalCircle methods that not have SDO paramet= ers >>>>>>>>> (or return them) works fine even if SCADomain is used. >>>>>>>>> >>>>>>>>> Any in this list, know what I should do for solve this problem? >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> =A0 =A0 =A0 =A0 =A0 Sebasti=E1n >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> 2009/5/21 Sebasti=E1n Groh <ccunningham@example.org>: >>>>>>>>>> >>>>>>>>>> Hello Kevin, Simon, >>>>>>>>>> >>>>>>>>>> cite: >>>>>>>>>> =A0 =A0 =A0 =A0Is the XSD you generated the SDO from included in= your >>>>>>>>>> contribution? >>>>>>>>>> >>>>>>>>>> Yes I'm including the XSD, but how and when should it be used? >>>>>>>>>> I verified if wsdl generated have included schema types and ther= e are >>>>>>>>>> ok. I thought that was enough if the wsdl have schemas included.= Is >>>>>>>>>> this correct? >>>>>>>>>> >>>>>>>>>> Simon, you are rigth when you see AnyTypeDataObjectImpl instance= s is >>>>>>>>>> becouse "If the ServiceFactory is not registered, the data (from= the >>>>>>>>>> inline schema of the WSDL) are then represented by >>>>>>>>>> 'org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl' " >>>>>>>>>> >>>>>>>>>> What must I do? Use =A0commonj.sdo.helper.HelperContext or not? >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Any user in this list have errors like that? >>>>>>>>>> Thanks for yours answers, >>>>>>>>>> Regards, >>>>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 Sebasti=E1n >>>>>>>>>> >>>>>>>>>> On Thu, May 21, 2009 at 6:50 AM, kelvin goodson >>>>>>>>>> <ccunningham@example.org> >>>>>>>>>> wrote: >>>>>>>>>>> >>>>>>>>>>> I'm no expert on how SCA uses SDO, but I do understand the SDO = side >>>>>>>>>>> of >>>>>>>>>>> this, which may help you or someone else get to how to fix this >>>>>>>>>>> within >>>>>>>>>>> SCA. =A0The time that you see instances of AnyTypeDataObjectImp= l >>>>>>>>>>> appearing is when an SDO deserialization operation has no metad= ata >>>>>>>>>>> within its operating context to describe an object it is trying= to >>>>>>>>>>> deserialize, so it falls back on a very weak default model of d= ata >>>>>>>>>>> embodied in the built-in AnyTypedataObject SDO class. >>>>>>>>>>> >>>>>>>>>>> Either the SCA infrastructure or you must arrange for the gener= ated >>>>>>>>>>> SDO factory associated with your Laboratory class to be known t= o the >>>>>>>>>>> relevant instance of SDO's HelperContext class. My feeling is t= here >>>>>>>>>>> is >>>>>>>>>>> most probably a way to influence SCA to do this for you, =A0but= I >>>>>>>>>>> don't >>>>>>>>>>> know how. =A0At the Tuscany SDO API level, the metadata registr= ation >>>>>>>>>>> is >>>>>>>>>>> done via the Factory's register(HelperContext scope) =A0method,= so you >>>>>>>>>>> could watch for calls to that method on the factory impl. >>>>>>>>>>> >>>>>>>>>>> Kelvin. >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> 2009/5/21 Simon Laws <ccunningham@example.org>: >>>>>>>>>>>> >>>>>>>>>>>> 2009/5/21 Sebasti=E1n Groh <ccunningham@example.org>: >>>>>>>>>>>>> >>>>>>>>>>>>> Hello, I'm trying to work with an SCA Composite that use ws >>>>>>>>>>>>> binding. >>>>>>>>>>>>> My component definition: >>>>>>>>>>>>> =A0<sca:component name=3D"BiochemicalCircleComponent"> >>>>>>>>>>>>> =A0<sca:implementation.java >>>>>>>>>>>>> class=3D"services.bcircle.BiochemicalCircleImpl"/> >>>>>>>>>>>>> =A0<sca:service name=3D"BiochemicalCircle"> >>>>>>>>>>>>> =A0 =A0 <sca:interface.java >>>>>>>>>>>>> interface=3D"services.bcircle.BiochemicalCircle"/> >>>>>>>>>>>>> =A0 =A0 <sca:binding.ws >>>>>>>>>>>>> uri=3D"http://localhost:8080/SCA1/MyServiceComponent"/> >>>>>>>>>>>>> =A0</sca:service> >>>>>>>>>>>>> =A0</sca:component> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> The service retrieve a SDO object (Laboratory) that I generat= ed >>>>>>>>>>>>> from >>>>>>>>>>>>> XSD without problems. >>>>>>>>>>>>> I deployed the project on Apache Tomcat/5.5.27 and I'm using = this >>>>>>>>>>>>> service from a jsp page as follows: >>>>>>>>>>>>> >>>>>>>>>>>>> (my includes) >>>>>>>>>>>>> . >>>>>>>>>>>>> . >>>>>>>>>>>>> . >>>>>>>>>>>>> <% SCADomain scaDomain =3D >>>>>>>>>>>>> SCADomain.newInstance("clinicalLaboratory.composite"); >>>>>>>>>>>>> =A0 =A0BiochemicalCircle service =3D >>>>>>>>>>>>> scaDomain.getService(BiochemicalCircle.class, >>>>>>>>>>>>> "BiochemicalCircleComponent"); >>>>>>>>>>>>> >>>>>>>>>>>>> =A0 =A0 Laboratory lab =3D (Laboratory) service.getLaboratory= ("Lab2"); >>>>>>>>>>>>> . >>>>>>>>>>>>> . =A0(more logic) >>>>>>>>>>>>> . >>>>>>>>>>>>> >>>>>>>>>>>>> %> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> In line >>>>>>>>>>>>> =A0 =A0 =A0 Laboratory lab =3D (Laboratory) >>>>>>>>>>>>> service.getLaboratory("Lab2"); >>>>>>>>>>>>> >>>>>>>>>>>>> I have the exception: >>>>>>>>>>>>> =A0 =A0 java.lang.ClassCastException: >>>>>>>>>>>>> org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl >>>>>>>>>>>>> =A0 =A0 at $Proxy18.getLaboratory(Unknown Source) >>>>>>>>>>>>> >>>>>>>>>>>>> I have also tried to use the class >>>>>>>>>>>>> commonj.sdo.helper.HelperContext >>>>>>>>>>>>> to >>>>>>>>>>>>> set a scope for my SDOFactory but I'm having the same excepti= on. >>>>>>>>>>>>> >>>>>>>>>>>>> Anyone in this list know to solve this error? >>>>>>>>>>>>> Regards, >>>>>>>>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 Sebasti=E1n >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> Hi Sebastien >>>>>>>>>>>> >>>>>>>>>>>> Is the XSD you generated the SDO from included in your >>>>>>>>>>>> contribution? >>>>>>>>>>>> I'm looking at the 1.x sample helloworld-ws-sdo-webapp and can= 't >>>>>>>>>>>> actually see that the SDO types are specified explicitly but t= he >>>>>>>>>>>> XSD >>>>>>>>>>>> used to generate them is included. Any of the SDO experts out = there >>>>>>>>>>>> know how we should be describing the SDO context in SCA? >>>>>>>>>>>> >>>>>>>>>>>> Simon >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>>> >>> >> > From ccunningham@example.org Mon Jun 01 10:20:40 2009 Return-Path: <ccunningham@example.org> Delivered-To: ccunningham@example.org Received: (qmail 39124 invoked from network); 1 Jun 2009 10:20:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Jun 2009 10:20:40 -0000 Received: (qmail 28526 invoked by uid 500); 1 Jun 2009 10:20:52 -0000 Delivered-To: ccunningham@example.org Received: (qmail 28458 invoked by uid 500); 1 Jun 2009 10:20:51 -0000 Mailing-List: contact ccunningham@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:ccunningham@example.org> List-Unsubscribe: <mailto:ccunningham@example.org> List-Post: <mailto:ccunningham@example.org> List-Id: <user.tuscany.apache.org> Reply-To: ccunningham@example.org Delivered-To: mailing list ccunningham@example.org Received: (qmail 28450 invoked by uid 99); 1 Jun 2009 10:20:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2009 10:20:51 +0000 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO cl-mailhost.FernUni-Hagen.de) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2009 10:20:39 +0000 Received: from server.dvt.fernuni-hagen.de ([83.161.120.155]) by cl-mailhost.FernUni-Hagen.de with esmtp (Exim 4.24) id 1MB4ct-0002mZ-6Y for ccunningham@example.org; Mon, 01 Jun 2009 12:20:19 +0200 Received: from localhost (localhost [83.161.120.155]) by server.dvt.fernuni-hagen.de (Postfix) with ESMTP id 08201774D8 for <ccunningham@example.org>; Mon, 1 Jun 2009 12:20:19 +0200 (CEST) Received: from server.dvt.fernuni-hagen.de ([83.161.120.155]) by localhost (server [83.161.120.155]) (amavisd-new, port 10024) with ESMTP id 11342-07 for <ccunningham@example.org>; Mon, 1 Jun 2009 12:20:14 +0200 (CEST) Received: from [83.161.120.155] (unknown [83.161.120.155]) by server.dvt.fernuni-hagen.de (Postfix) with ESMTP id 241AD774CB for <ccunningham@example.org>; Mon, 1 Jun 2009 12:20:14 +0200 (CEST) Message-ID: <ccunningham@example.org> Date: Mon, 01 Jun 2009 12:20:15 +0200 From: Peng Han <ccunningham@example.org> User-Agent: Thunderbird 83.161.120.155 (Windows/20090302) MIME-Version: 1.0 To: ccunningham@example.org Subject: Re: how to access another SCA Component in BPEL References: <ccunningham@example.org> <ccunningham@example.org> <ccunningham@example.org> <ccunningham@example.org> <ccunningham@example.org> In-Reply-To: <ccunningham@example.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: at LG-DVT eMail virus filter X-prewhitelist: your reply will pass through without greylisting X-Virus-Checked: Checked by ClamAV on apache.org Dear Resende: Thanks a lot for your prompt response. I changed the binding to jsoncrpc and get the following error: Exception in thread "main" org.osoa.sca.ServiceRuntimeException: java.lang.ClassCastException: org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLInterfaceImpl cannot be cast to ccunningham@example.org(SCADomain.java:220) at org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.java:63) at helloworld.BPELClient.main(BPELClient.java:47) Caused by: java.lang.ClassCastException: org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLInterfaceImpl cannot be cast to ccunningham@example.org(JSONRPCServiceBindingProvider.java:158) at org.apache.tuscany.sca.binding.jsonrpc.provider.JSONRPCServiceBindingProvider.start(JSONRPCServiceBindingProvider.java:91) at org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl$3.run(CompositeActivatorImpl.java:630) at java.security.AccessController.doPrivileged(Native Method) at org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl.start(CompositeActivatorImpl.java:628) at org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl.start(CompositeActivatorImpl.java:560) at org.apache.tuscany.sca.node.impl.NodeImpl.start(NodeImpl.java:668) at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.init(DefaultSCADomain.java:182) at org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.<init>(DefaultSCADomain.java:97) at org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:182) ... 2 more However, if I change the interface of BPEL component service from WS to Java as follows: <component name="BPELHelloWorldComponent"> <implementation.bpel process="hns:HelloWorld"/> <service name="helloPartnerLink"> <interface.java interface="org.apache.tuscany.implementation.bpel.example.helloworld.HelloPortType"/> <tuscany:binding.jsonrpc uri="http://localhost:8080/services"/> </service> </component> I will get a "null" return value. The code in javascript is as follows: //@Reference var mainRegReference = new Reference( "RegistrationReference" ); var mytext = "Hello again"; document.write(mytext); function getWeather() { var city = document.getElementById( "cityField" ).value; var country = document.getElementById( "countryField" ).value; var returnString = mainRegReference.hello("weather", displayWeather); } function displayWeather(weather){ document.write(weather); } Best Regards Peng > On Sat, May 30, 2009 at 12:35 PM, Peng Han <ccunningham@example.org> wrote: > >> Dear Resende: >> >> I tried to access the links you provided but it seems that it was broken. >> Would you please check it? >> >> > > https://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/itest/bpel/helloworld-reference/ > > >> Also I would like to ask whether it is possible to consume a service >> provided by a .bpel implemented component >> from a component implemented as widget and how. I tried to do it in the >> following composite but the program >> seems stuck when invoking the service. >> > > You should be able to do this, using json-rpc binding. > I responded to your other thread "Wiring a Widget Component and BPEL > Component" with more details on how to try to accomplish this, but > feel free to let me know if you are not making progress, and I can try > to get some examples available. > > >> Thanks a lot! >> >> the composite is as follows: >> >> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" >> >> xmlns:hns="http://tuscany.apache.org/implementation/bpel/example/helloworld" >> xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" name="helloworld" >> targetNamespace="http://bpel"> >> <component name="BPELHelloWorldComponent"> >> <implementation.bpel process="hns:HelloWorld" /> >> <service name="helloPartnerLink"> >> <interface.wsdl >> >> interface="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl#wsdl.interface(HelloPortType)" >> /> >> <binding.ws uri="http://localhost:8080/BPELHelloWorldComponent" /> >> </service> >> </component> >> <component name="RegistrationWidgetComponent"> >> <tuscany:implementation.widget location="Registration.html" /> >> <service name="Widget"> >> <tuscany:binding.http uri="http://localhost:8080/Registration" /> >> </service> >> <reference name="RegistrationReference"> >> <interface.wsdl >> >> interface="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl#wsdl.interface(HelloPortType)" >> /> >> <binding.ws uri="http://localhost:8080/BPELHelloWorldComponent" /> >> </reference> >> </component> >> <service name="RegistrationService" >> promote="RegistrationWidgetComponent/Widget" /> >> <wire source="RegistrationWidgetComponent/RegistrationReference" >> target="BPELHelloWorldComponent/helloPartnerLink" /> >> </composite> >> >> Best Regards >> >> P.Han >> >>> This is demonstrated in the following bpel-reference iTest [1]. In >>> this case, we have a grretings java component, and then a BPEL >>> component that have a reference to this service as described in the >>> composite below. >>> >>> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" >>> targetNamespace="http://bpel" >>> xmlns:hns="http://helloworld" >>> name="helloworld"> >>> >>> <component name="HelloWorldService"> >>> <implementation.bpel process="hns:HelloWorld"/> >>> <reference name="greetingsPartnerLink" >>> target="GreetingsServiceComponent"/> >>> </component> >>> >>> <component name="GreetingsServiceComponent"> >>> <implementation.java class="greetings.GreetingsServiceImpl" /> >>> <service name="GreetingsService"> >>> >>> <interface.wsdl >>> interface="http://greetings#wsdl.interface(Greetings)" /> >>> </service> >>> </component> >>> </composite> >>> >>> Please let me know if you have questions or any problems running the >>> sample test scenario. >>> >>> >>> [1] >>> https://svn.apache.org/repos/asf/tuscany/java/sca/itest/bpel/helloworld-reference/ >>> >>> >>> On Thu, Aug 28, 2008 at 8:21 PM, xuhongbo <ccunningham@example.org> wrote: >>> >>> >>>> Hi >>>> Now I am using the sca provided build in bpel engine, and want to >>>> invoke another sca-component in the bpel process; >>>> Though I could deploy the -java-implement sca component as >>>> web-service by ws binding,then access it in bpel by import a wsdl >>>> process. >>>> This way ask for all sca-java-componet deployed as web-service, and seems >>>> too trival for deployment. >>>> So does anyone know how to use a sca-reference in a BPEL implement >>>> component to access another sca component? Or some other mechanism can >>>> direct access sca-component? Typically sca component invoked by the bpel >>>> is >>>> always implement as Java Language. >>>> >>>> Thanks >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> >>> >> > > > > From ccunningham@example.org Mon Jun 01 11:48:57 2009 Return-Path: <ccunningham@example.org> Delivered-To: ccunningham@example.org Received: (qmail 64037 invoked from network); 1 Jun 2009 11:48:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Jun 2009 11:48:57 -0000 Received: (qmail 96956 invoked by uid 500); 1 Jun 2009 11:49:09 -0000 Delivered-To: ccunningham@example.org Received: (qmail 96866 invoked by uid 500); 1 Jun 2009 11:49:09 -0000 Mailing-List: contact ccunningham@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:ccunningham@example.org> List-Unsubscribe: <mailto:ccunningham@example.org> List-Post: <mailto:ccunningham@example.org> List-Id: <user.tuscany.apache.org> Reply-To: ccunningham@example.org Delivered-To: mailing list ccunningham@example.org Received: (qmail 96858 invoked by uid 99); 1 Jun 2009 11:49:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2009 11:49:09 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ccunningham@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO yw-out-1718.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2009 11:48:55 +0000 Received: by yw-out-1718.google.com with SMTP id 9so4059945ywk.38 for <ccunningham@example.org>; Mon, 01 Jun 2009 04:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=wlHBxjuoevsDNVtlxCBW1mL9GTIroNjhHoguZSyYiaE=; b=W6gLzxWcP0pQ1+5BOcyfXfD4zJ57+ervyzSW1/OXsF0C2B7MdD8Au1kWQzAUD9jv8C 5bC4orCMXtgdVGusyS4FBvzQv7a/aBZ2NL8ddtgDCn/QiJBkx10lfB9OyO8yPJBylN8T 5pATD6wHnwuaAy4LRo2VNrDLNDoz3RNDMrY0g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=tfLt1o6XXXhblXYVLVuvMRFc9fEJkmVFUul3eMGuvjeeZWfE+xd0cIS+9paRArqpSy eQbRzG9rwBTLGGwbYV0udm3aehGx0wv0qxJbfYVNZRBDOsyD3yJtvgy8Qw6OmTIRNIS4 tf/ZOQVPXKyHE254APaM+BCb4BmHeDhIqMVUE= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id w13mr1452338ibw.56.1243856913236; Mon, 01 Jun 2009 04:48:33 -0700 (PDT) In-Reply-To: <ccunningham@example.org> References: <ccunningham@example.org> <ccunningham@example.org> <ccunningham@example.org> <91516E6053284722822CBAA40F593CC9@rfengt61p> <ccunningham@example.org> <ccunningham@example.org> <9CEFED377CB548C5A402AC0A9901000A@rfengt61p> <ccunningham@example.org> <ccunningham@example.org> <ccunningham@example.org> Date: Mon, 1 Jun 2009 08:48:33 -0300 Message-ID: <ccunningham@example.org> Subject: Re: WS bindings and SDO From: =?ISO-8859-1?Q?Sebasti=E1n_Groh?= <ccunningham@example.org> To: ccunningham@example.org Content-Type: multipart/alternative; boundary=0003255753be77054f046b480122 X-Virus-Checked: Checked by ClamAV on apache.org --0003255753be77054f046b480122 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello Kelvin, I appreciate your mail (it seems to be incompleted) but I assume that I'm not using properly my SDO's instances. My code was a simplified test to expose in this list no= n expected errors, but I like good practices and therefore I would like fix m= y code. Could you mail your suggestion again please? Thanks! Sebasti=E1n On Mon, Jun 1, 2009 at 5:42 AM, kelvin goodson <ccunningham@example.org>wro= te: > Hi Sebastien > it's not clear to me whether you intend to use lines such as ... > > Laboratory lab =3D EntityFactory.INSTANCE.createLaboratory(); > > in your solution, or whether this is just a quick piece of demo code. > > If I understand this thread properly then I think you have solved your > problem, however, I would just like to comment that the line ... > > Laboratory lab =3D EntityFactory.INSTANCE.createLaboratory(); > > is not the best way to create an SDO instance. Maybe tyhis is just a > quick demo line of code, but using the generated Factory instances > directly allows coding that might lead you to believe that you have a > good working SDO environment when you might not have. > > As this thread has mentioned, the SDO runtime needs to have metadat > > > > 2009/6/1 Sebasti=E1n Groh <ccunningham@example.org>: > > Hello, > > Thanks Ant Elder, your Apache Tuscany SCA Java 1.5 released > > announce mail responded my last question on this list. > > > > Raymond, the problem was fixed in version tuscany 1.5. I > > didn't need comment the service promotion. > > I have had the same exception when I tried something like this: > > > > 0. public class BiochemicalCircleImpl implements BiochemicalCircle{ > > 1. > > 2. public Laboratory getLaboratory(String name) { > > 3. if (name.length() < 5) > > 4. return null; > > 5. Laboratory lab =3D EntityFactory.INSTANCE.createLaboratory(); > > 6. lab.setName("Main Laboratory"); > > 7. return lab; > > 8. } > > 9. } > > > > If condition was true in line 3, null was returned an the exception was= : > > Exception in thread "main" java.lang.ClassCastException: > > org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl > > > > otherwhise, all works perfectly! > > > > My solution was, create a Laboratory object with properties setted in > > null and change invocation logic assuming that always will return a > > Laboratory object. Empty Laboratories were considered when any of its > > properties was null. > > > > > > Thanks Raymond, and all people who responded to my earlier concerns. > > Best Regards, > > > > Sebasti=E1n Groh > > > > > > > > 2009/5/30 Sebasti=E1n Groh <ccunningham@example.org> > >> > >> Hello, > >> Raymond, thanks for your answer. I've checked my mail late,= I > see that you can test my example without my source files. > >> At the moment, I commented the service promotion as you suggest, and I= 'm > trying to download the latest 1.5 code > >> but I can't found that. > >> > >> Someone here knows how to download that version? I was reading Continu= um > and in version says "1.6-SNAPSHOT" . > >> > >> Have Tuscany SCA version 2.X implemented the same functionality that > version 1.x? > >> > >> Raymond, will I found my errors fixed in version 2.X? > >> > >> Thanks, > >> > >> Sebasti=E1n Groh > >> > >> > >> > >> > >> On Sat, May 30, 2009 at 3:57 AM, Raymond Feng <ccunningham@example.org> > wrote: > >>> > >>> Hi, > >>> > >>> I just tried your test case (adding the classes/resources to the > helloworld-ws-sdo sample) with the latest 1.5 code. It works after I fixe= d > an issue in the composite file: > >>> > >>> <?xml version=3D"1.0" encoding=3D"UTF-8"?> > >>> <sca:composite xmlns:federation=3D" > http://eclipse.org/SCAExample1/src/resources/federation" > >>> xmlns:sca=3D"http://www.osoa.org/xmlns/sca/1.0" > name=3D"clinicalLaboratory" > >>> targetNamespace=3D" > http://eclipse.org/SCAExample1/src/resources/clinicalLaboratory"> > >>> > >>> <sca:component name=3D"BiochemicalCircleComponent"> > >>> <sca:implementation.java > class=3D"services.bcircle.BiochemicalCircleImpl" /> > >>> <sca:service name=3D"BiochemicalCircle"> > >>> <sca:interface.java > interface=3D"services.bcircle.BiochemicalCircle" /> > >>> <sca:binding.ws uri=3D" > http://localhost:8080/SCA1/MyServiceComponent" /> > >>> </sca:service> > >>> </sca:component> > >>> <!-- > >>> <sca:service name=3D"BiochemicalCircle" > promote=3D"BiochemicalCircleComponent/BiochemicalCircle" /> > >>> --> > >>> </sca:composite> > >>> > >>> Please note the service promotion is commented out as it triggers an > issue in Tuscany where the service promotion has the same URI as the > internal binding.ws. > >>> > >>> Thanks, > >>> Raymond > >>> > >>> From: Sebasti=E1n Groh > >>> Sent: Friday, May 29, 2009 3:38 PM > >>> To: ccunningham@example.org > >>> Subject: Re: WS bindings and SDO > >>> > >>> > >>> Raymond, > >>> hello again, I follow your advice " I suggest that yo= u > open a JIRA and attach the test case there so that we can debug.". I open= ed > a JIRA (link). This is my first bug there. Can you tell me if I've posted > enough information? > >>> Thanks, > >>> Sebasti=E1n Groh > >>> > >>> 2009/5/26 Sebasti=E1n Groh <ccunningham@example.org>: > >>>> > >>>> Hi Raymond, > >>>> thanks for your answer. I debug my application an= d > sca > >>>> source. > >>>> Next I will try to explain the invocation chain: > >>>> > >>>> When JDKInvocationHandler calls method invoke(InvocationChain chain, > >>>> Object[] args, RuntimeWire wire, EndpointReference source) > >>>> > >>>> line 288: Message resp =3D headInvoker.invoke(msg); // invocation oc= curs > >>>> without errors > >>>> line 289: Object body =3D resp.getBody(); // Returns an > >>>> org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl object > >>>> > >>>> It seems that body was not instantiated with the correct class. > >>>> > >>>> > >>>> Cite: > >>>> " I suggest that you open a JIRA and attach the test case the= re > so > >>>> that we can debug." > >>>> I'll try this, i never did that before. What I need to post there? > >>>> > >>>> For the moment I'll publish my problem here. > >>>> > >>>> My XSD file is: > >>>> <?xml version=3D"1.0" encoding=3D"UTF-8"?> > >>>> <schema xmlns=3D"http://www.w3.org/2001/XMLSchema" > >>>> > >>>> > >>>> targetNamespace=3D" > http://eclipse.org/SCAExample1/src/resources/clinicalLaboratory" > >>>> > >>>> > >>>> xmlns:tns=3D" > http://eclipse.org/SCAExample1/src/resources/clinicalLaboratory" > >>>> elementFormDefault=3D"qualified"> > >>>> <complexType name=3D"Practice"> > >>>> <sequence> > >>>> <element name=3D"name" type=3D"string" /> > >>>> </sequence> > >>>> </complexType> > >>>> <complexType name=3D"Laboratory"> > >>>> <sequence> > >>>> <element name=3D"name" type=3D"string" /> > >>>> <element name=3D"practices" type=3D"tns:Practice" > >>>> maxOccurs=3D"unbounded"/> > >>>> </sequence> > >>>> </complexType> > >>>> </schema> > >>>> > >>>> Composite file: > >>>> <?xml version=3D"1.0" encoding=3D"UTF-8"?> > >>>> <sca:composite > >>>> xmlns:federation=3D" > http://eclipse.org/SCAExample1/src/resources/federation" > >>>> xmlns:sca=3D"http://www.osoa.org/xmlns/sca/1.0" > >>>> name=3D"clinicalLaboratory" > >>>> targetNamespace=3D" > http://eclipse.org/SCAExample1/src/resources/clinicalLaboratory"> > >>>> <sca:component name=3D"BiochemicalCircleComponent"> > >>>> <sca:implementation.java > class=3D"services.bcircle.BiochemicalCircleImpl"/> > >>>> <sca:service name=3D"BiochemicalCircle"> > >>>> <sca:interface.java > interface=3D"services.bcircle.BiochemicalCircle"/> > >>>> <sca:binding.ws uri=3D"http://localhost:8080/SCA1/MyServiceCompon= ent > "/> > >>>> </sca:service> > >>>> </sca:component> > >>>> <sca:service name=3D"BiochemicalCircle" > >>>> promote=3D"BiochemicalCircleComponent/BiochemicalCircle"/> > >>>> </sca:composite> > >>>> > >>>> Interface file: > >>>> package services.bcircle; > >>>> import java.util.ArrayList; > >>>> import javax.xml.bind.annotation.XmlType; > >>>> import model.sdo.EntityFactory; > >>>> import org.apache.tuscany.sca.databinding.annotation.DataBinding; > >>>> import org.osoa.sca.annotations.Remotable; > >>>> > >>>> @Remotable > >>>> public interface BiochemicalCircle{ > >>>> void setLaboratory(model.sdo.Laboratory lab); > >>>> model.sdo.Laboratory getLaboratory(String name); > >>>> } > >>>> > >>>> Interface implementation: > >>>> > >>>> package services.bcircle; > >>>> import model.sdo.EntityFactory; > >>>> import model.sdo.Laboratory; > >>>> import org.osoa.sca.annotations.Service; > >>>> > >>>> > >>>> @Service(BiochemicalCircle.class) > >>>> public class BiochemicalCircleImpl implements BiochemicalCircle{ > >>>> public Laboratory getLaboratory(String name) { > >>>> Laboratory lab =3D EntityFactory.INSTANCE.createLaboratory(); > >>>> lab.setName("Main Laboratory"); > >>>> return lab; > >>>> } > >>>> > >>>> public void setLaboratory(Laboratory lab) { > >>>> //sad method > >>>> System.out.println(lab.getName()); > >>>> } > >>>> } > >>>> >
{'source': 'Apache Software Foundation Public Mail Archives'}