You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Ted Stevens <ts...@earthlink.net> on 2010/11/24 05:02:00 UTC

Newbie config stuff...

Not sure if this is the right place to post but here goes:

I've got a project and directory structure similar to the 'store' example - I've got just 1 client service class.. should be pretty simple. Problem is the javascript is unable to resolve the tuscany package in the html page, ie... 

myJavaClass myObject = new tuscany.sca.Reference(myService);      produces a javascript error


When I examine the console output there are a couple funny things that don't occur with the tuscany-sca-16/samples.. that I've got working:

Loading contribution file c:/MyDir/MyServices/bin/  - and thats it - whereas my other samples I've got working specify the full path of the jar file in the console output, and even though I have MyServices.jar in that directory. So I'm thinking maybe the contribution isn't being loading correctly and I've probably go something messed up about the directory structure ?

Further in the output there is - Warning: Reference not found for component MyServices 

(the MyServices.composite file contains the <reference name="myService" ....)    - further evidence that something is amiss...

Any help appreciated.

Thanks in advance,

Re: Newbie config stuff...

Posted by Simon Nash <na...@apache.org>.
Ted Stevens wrote:
> Are you running Eclipse ?
> 
I do have Eclipse installed but I ran your code outside of Eclipse.
I can't think of any reason why running it in Eclipse would make any
difference to the problem.

   Simon

> ----- Original Message ----- From: "Simon Nash" <na...@apache.org>
> To: <us...@tuscany.apache.org>
> Sent: Sunday, November 28, 2010 3:42 AM
> Subject: Re: Newbie config stuff...
> 
> 
>> After that, the only problem I found was a mismatch between the
>> service name in the composite file and the service name in the
>> Java code.  In the composite file the service is called TBFClient
>> but in the Java code it's called tbfClient (derived from the name
>> of the Java interface).  When I fixed this, everything seemed to
>> work OK.
>>
>>   Simon
>>
>>> ----- Original Message ----- From: "Simon Nash" <na...@apache.org>
>>> To: <us...@tuscany.apache.org>
>>> Sent: Thursday, November 25, 2010 12:50 PM
>>> Subject: Re: Newbie config stuff...
>>>
>>>
>>>> Ted Stevens wrote:
>>>>> <composite
>>>>>
>>>>>      xmlns="http://www.osoa.org/xmlns/sca/1.0"
>>>>>
>>>>>      xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
>>>>>
>>>>>      xmlns:s="http://MyServices"
>>>>>
>>>>>      targetNamespace="http://MyServices"
>>>>>
>>>>>      name="MyServices">
>>>>>
>>>>>
>>>>>
>>>>> <component name = "MyServices">
>>>>>
>>>>>      <t:implementation.widget location="uiservices/MyServices.html"/>
>>>>>
>>>>>      <service name = "Widget">
>>>>>
>>>>>            <t:binding.http uri="http://localhost:8080/MyServices"/>
>>>>>
>>>>>      </service>
>>>>>
>>>>>      <reference name = "myservices" target = "MyClient">
>>>>>
>>>>>            <t:binding.jsonrpc/>
>>>>>
>>>>>      </reference>
>>>>>
>>>>> </component>
>>>>>
>>>>>
>>>>>
>>>>> <component name = "MyClient">
>>>>>
>>>>>      <implementation.java class = "joe.myClientImpl"/>
>>>>>
>>>>>      <service name = "MyClient">
>>>>>
>>>>>            <t:binding.jsonrpc uri = "http://localhost:8080/MyClient"/>
>>>>>
>>>>>      </service>
>>>>>
>>>>> </component>
>>>>>
>>>>>
>>>>>
>>>>> </composite>
>>>>>
>>>>>
>>>> Your earlier post has some JavaScript code that uses myService as the
>>>> name of the reference.  This composite appears to use myservices as
>>>> the reference name.
>>>>
>>>> If this isn't the cause of the problem, can you create a zip of your
>>>> complete application and post it here?
>>>>
>>>>   Simon
>>>>>
>>>>> ----- Original Message ----- From: "Luciano Resende" 
>>>>> <lu...@gmail.com>
>>>>> To: <us...@tuscany.apache.org>
>>>>> Sent: Tuesday, November 23, 2010 8:20 PM
>>>>> Subject: Re: Newbie config stuff...
>>>>>
>>>>>
>>>>> On Tue, Nov 23, 2010 at 8:02 PM, Ted Stevens 
>>>>> <ts...@earthlink.net> wrote:
>>>>>> Not sure if this is the right place to post but here goes:
>>>>>>
>>>>>> I've got a project and directory structure similar to the 'store' 
>>>>>> example -
>>>>>> I've got just 1 client service class.. should be pretty simple. 
>>>>>> Problem is
>>>>>> the javascript is unable to resolve the tuscany package in the 
>>>>>> html page,
>>>>>> ie...
>>>>>>
>>>>>> myJavaClass myObject = new tuscany.sca.Reference(myService); 
>>>>>> produces a
>>>>>> javascript error
>>>>>>
>>>>>>
>>>>>
>>>>> In order to tuscany.sca.Reference to work, you need to have a
>>>>> component defined using implementation.widget. Do you have that ?
>>>>> Could you please post your composite here ?
>>>>>
>>>>
>>>>
>>
> 
> 
> 


Re: Newbie config stuff...

Posted by Ted Stevens <ts...@earthlink.net>.
Are you running Eclipse ?

----- Original Message ----- 
From: "Simon Nash" <na...@apache.org>
To: <us...@tuscany.apache.org>
Sent: Sunday, November 28, 2010 3:42 AM
Subject: Re: Newbie config stuff...


> After that, the only problem I found was a mismatch between the
> service name in the composite file and the service name in the
> Java code.  In the composite file the service is called TBFClient
> but in the Java code it's called tbfClient (derived from the name
> of the Java interface).  When I fixed this, everything seemed to
> work OK.
>
>   Simon
>
>> ----- Original Message ----- From: "Simon Nash" <na...@apache.org>
>> To: <us...@tuscany.apache.org>
>> Sent: Thursday, November 25, 2010 12:50 PM
>> Subject: Re: Newbie config stuff...
>>
>>
>>> Ted Stevens wrote:
>>>> <composite
>>>>
>>>>      xmlns="http://www.osoa.org/xmlns/sca/1.0"
>>>>
>>>>      xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
>>>>
>>>>      xmlns:s="http://MyServices"
>>>>
>>>>      targetNamespace="http://MyServices"
>>>>
>>>>      name="MyServices">
>>>>
>>>>
>>>>
>>>> <component name = "MyServices">
>>>>
>>>>      <t:implementation.widget location="uiservices/MyServices.html"/>
>>>>
>>>>      <service name = "Widget">
>>>>
>>>>            <t:binding.http uri="http://localhost:8080/MyServices"/>
>>>>
>>>>      </service>
>>>>
>>>>      <reference name = "myservices" target = "MyClient">
>>>>
>>>>            <t:binding.jsonrpc/>
>>>>
>>>>      </reference>
>>>>
>>>> </component>
>>>>
>>>>
>>>>
>>>> <component name = "MyClient">
>>>>
>>>>      <implementation.java class = "joe.myClientImpl"/>
>>>>
>>>>      <service name = "MyClient">
>>>>
>>>>            <t:binding.jsonrpc uri = "http://localhost:8080/MyClient"/>
>>>>
>>>>      </service>
>>>>
>>>> </component>
>>>>
>>>>
>>>>
>>>> </composite>
>>>>
>>>>
>>> Your earlier post has some JavaScript code that uses myService as the
>>> name of the reference.  This composite appears to use myservices as
>>> the reference name.
>>>
>>> If this isn't the cause of the problem, can you create a zip of your
>>> complete application and post it here?
>>>
>>>   Simon
>>>>
>>>> ----- Original Message ----- From: "Luciano Resende" 
>>>> <lu...@gmail.com>
>>>> To: <us...@tuscany.apache.org>
>>>> Sent: Tuesday, November 23, 2010 8:20 PM
>>>> Subject: Re: Newbie config stuff...
>>>>
>>>>
>>>> On Tue, Nov 23, 2010 at 8:02 PM, Ted Stevens 
>>>> <ts...@earthlink.net> wrote:
>>>>> Not sure if this is the right place to post but here goes:
>>>>>
>>>>> I've got a project and directory structure similar to the 'store' 
>>>>> example -
>>>>> I've got just 1 client service class.. should be pretty simple. 
>>>>> Problem is
>>>>> the javascript is unable to resolve the tuscany package in the html 
>>>>> page,
>>>>> ie...
>>>>>
>>>>> myJavaClass myObject = new tuscany.sca.Reference(myService); produces 
>>>>> a
>>>>> javascript error
>>>>>
>>>>>
>>>>
>>>> In order to tuscany.sca.Reference to work, you need to have a
>>>> component defined using implementation.widget. Do you have that ?
>>>> Could you please post your composite here ?
>>>>
>>>
>>>
> 


Re: Newbie config stuff...

Posted by Simon Nash <na...@apache.org>.
Ted Stevens wrote:
> Attached.
 >
I had to rename a few things from "wcm" to "tbf" to get this code
to compile and run.

After that, the only problem I found was a mismatch between the
service name in the composite file and the service name in the
Java code.  In the composite file the service is called TBFClient
but in the Java code it's called tbfClient (derived from the name
of the Java interface).  When I fixed this, everything seemed to
work OK.

   Simon

> ----- Original Message ----- From: "Simon Nash" <na...@apache.org>
> To: <us...@tuscany.apache.org>
> Sent: Thursday, November 25, 2010 12:50 PM
> Subject: Re: Newbie config stuff...
> 
> 
>> Ted Stevens wrote:
>>> <composite
>>>
>>>      xmlns="http://www.osoa.org/xmlns/sca/1.0"
>>>
>>>      xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
>>>
>>>      xmlns:s="http://MyServices"
>>>
>>>      targetNamespace="http://MyServices"
>>>
>>>      name="MyServices">
>>>
>>>
>>>
>>> <component name = "MyServices">
>>>
>>>      <t:implementation.widget location="uiservices/MyServices.html"/>
>>>
>>>      <service name = "Widget">
>>>
>>>            <t:binding.http uri="http://localhost:8080/MyServices"/>
>>>
>>>      </service>
>>>
>>>      <reference name = "myservices" target = "MyClient">
>>>
>>>            <t:binding.jsonrpc/>
>>>
>>>      </reference>
>>>
>>> </component>
>>>
>>>
>>>
>>> <component name = "MyClient">
>>>
>>>      <implementation.java class = "joe.myClientImpl"/>
>>>
>>>      <service name = "MyClient">
>>>
>>>            <t:binding.jsonrpc uri = "http://localhost:8080/MyClient"/>
>>>
>>>      </service>
>>>
>>> </component>
>>>
>>>
>>>
>>> </composite>
>>>
>>>
>> Your earlier post has some JavaScript code that uses myService as the
>> name of the reference.  This composite appears to use myservices as
>> the reference name.
>>
>> If this isn't the cause of the problem, can you create a zip of your
>> complete application and post it here?
>>
>>   Simon
>>>
>>> ----- Original Message ----- From: "Luciano Resende" 
>>> <lu...@gmail.com>
>>> To: <us...@tuscany.apache.org>
>>> Sent: Tuesday, November 23, 2010 8:20 PM
>>> Subject: Re: Newbie config stuff...
>>>
>>>
>>> On Tue, Nov 23, 2010 at 8:02 PM, Ted Stevens 
>>> <ts...@earthlink.net> wrote:
>>>> Not sure if this is the right place to post but here goes:
>>>>
>>>> I've got a project and directory structure similar to the 'store' 
>>>> example -
>>>> I've got just 1 client service class.. should be pretty simple. 
>>>> Problem is
>>>> the javascript is unable to resolve the tuscany package in the html 
>>>> page,
>>>> ie...
>>>>
>>>> myJavaClass myObject = new tuscany.sca.Reference(myService); produces a
>>>> javascript error
>>>>
>>>>
>>>
>>> In order to tuscany.sca.Reference to work, you need to have a
>>> component defined using implementation.widget. Do you have that ?
>>> Could you please post your composite here ?
>>>
>>
>>


Re: Newbie config stuff...

Posted by Ted Stevens <ts...@earthlink.net>.
Attached.
----- Original Message ----- 
From: "Simon Nash" <na...@apache.org>
To: <us...@tuscany.apache.org>
Sent: Thursday, November 25, 2010 12:50 PM
Subject: Re: Newbie config stuff...


> Ted Stevens wrote:
>> <composite
>>
>>      xmlns="http://www.osoa.org/xmlns/sca/1.0"
>>
>>      xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
>>
>>      xmlns:s="http://MyServices"
>>
>>      targetNamespace="http://MyServices"
>>
>>      name="MyServices">
>>
>>
>>
>> <component name = "MyServices">
>>
>>      <t:implementation.widget location="uiservices/MyServices.html"/>
>>
>>      <service name = "Widget">
>>
>>            <t:binding.http uri="http://localhost:8080/MyServices"/>
>>
>>      </service>
>>
>>      <reference name = "myservices" target = "MyClient">
>>
>>            <t:binding.jsonrpc/>
>>
>>      </reference>
>>
>> </component>
>>
>>
>>
>> <component name = "MyClient">
>>
>>      <implementation.java class = "joe.myClientImpl"/>
>>
>>      <service name = "MyClient">
>>
>>            <t:binding.jsonrpc uri = "http://localhost:8080/MyClient"/>
>>
>>      </service>
>>
>> </component>
>>
>>
>>
>> </composite>
>>
>>
> Your earlier post has some JavaScript code that uses myService as the
> name of the reference.  This composite appears to use myservices as
> the reference name.
>
> If this isn't the cause of the problem, can you create a zip of your
> complete application and post it here?
>
>   Simon
>>
>> ----- Original Message ----- From: "Luciano Resende" 
>> <lu...@gmail.com>
>> To: <us...@tuscany.apache.org>
>> Sent: Tuesday, November 23, 2010 8:20 PM
>> Subject: Re: Newbie config stuff...
>>
>>
>> On Tue, Nov 23, 2010 at 8:02 PM, Ted Stevens <ts...@earthlink.net> 
>> wrote:
>>> Not sure if this is the right place to post but here goes:
>>>
>>> I've got a project and directory structure similar to the 'store' 
>>> example -
>>> I've got just 1 client service class.. should be pretty simple. Problem 
>>> is
>>> the javascript is unable to resolve the tuscany package in the html 
>>> page,
>>> ie...
>>>
>>> myJavaClass myObject = new tuscany.sca.Reference(myService); produces a
>>> javascript error
>>>
>>>
>>
>> In order to tuscany.sca.Reference to work, you need to have a
>> component defined using implementation.widget. Do you have that ?
>> Could you please post your composite here ?
>>
>
> 

Re: Newbie config stuff...

Posted by Simon Nash <na...@apache.org>.
Ted Stevens wrote:
> <composite
> 
>      xmlns="http://www.osoa.org/xmlns/sca/1.0"
> 
>      xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
> 
>      xmlns:s="http://MyServices"
> 
>      targetNamespace="http://MyServices"
> 
>      name="MyServices">
> 
> 
> 
> <component name = "MyServices">
> 
>      <t:implementation.widget location="uiservices/MyServices.html"/>
> 
>      <service name = "Widget">
> 
>            <t:binding.http uri="http://localhost:8080/MyServices"/>
> 
>      </service>
> 
>      <reference name = "myservices" target = "MyClient">
> 
>            <t:binding.jsonrpc/>
> 
>      </reference>
> 
> </component>
> 
> 
> 
> <component name = "MyClient">
> 
>      <implementation.java class = "joe.myClientImpl"/>
> 
>      <service name = "MyClient">
> 
>            <t:binding.jsonrpc uri = "http://localhost:8080/MyClient"/>
> 
>      </service>
> 
> </component>
> 
> 
> 
> </composite>
> 
> 
Your earlier post has some JavaScript code that uses myService as the
name of the reference.  This composite appears to use myservices as
the reference name.

If this isn't the cause of the problem, can you create a zip of your
complete application and post it here?

   Simon
> 
> ----- Original Message ----- From: "Luciano Resende" <lu...@gmail.com>
> To: <us...@tuscany.apache.org>
> Sent: Tuesday, November 23, 2010 8:20 PM
> Subject: Re: Newbie config stuff...
> 
> 
> On Tue, Nov 23, 2010 at 8:02 PM, Ted Stevens <ts...@earthlink.net> 
> wrote:
>> Not sure if this is the right place to post but here goes:
>>
>> I've got a project and directory structure similar to the 'store' 
>> example -
>> I've got just 1 client service class.. should be pretty simple. 
>> Problem is
>> the javascript is unable to resolve the tuscany package in the html page,
>> ie...
>>
>> myJavaClass myObject = new tuscany.sca.Reference(myService); produces a
>> javascript error
>>
>>
> 
> In order to tuscany.sca.Reference to work, you need to have a
> component defined using implementation.widget. Do you have that ?
> Could you please post your composite here ?
> 


Re: Newbie config stuff...

Posted by Ted Stevens <ts...@earthlink.net>.
<composite

      xmlns="http://www.osoa.org/xmlns/sca/1.0"

      xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"

      xmlns:s="http://MyServices"

      targetNamespace="http://MyServices"

      name="MyServices">



<component name = "MyServices">

      <t:implementation.widget location="uiservices/MyServices.html"/>

      <service name = "Widget">

            <t:binding.http uri="http://localhost:8080/MyServices"/>

      </service>

      <reference name = "myservices" target = "MyClient">

            <t:binding.jsonrpc/>

      </reference>

</component>



<component name = "MyClient">

      <implementation.java class = "joe.myClientImpl"/>

      <service name = "MyClient">

            <t:binding.jsonrpc uri = "http://localhost:8080/MyClient"/>

      </service>

</component>



</composite>



----- Original Message ----- 
From: "Luciano Resende" <lu...@gmail.com>
To: <us...@tuscany.apache.org>
Sent: Tuesday, November 23, 2010 8:20 PM
Subject: Re: Newbie config stuff...


On Tue, Nov 23, 2010 at 8:02 PM, Ted Stevens <ts...@earthlink.net> 
wrote:
> Not sure if this is the right place to post but here goes:
>
> I've got a project and directory structure similar to the 'store' 
> example -
> I've got just 1 client service class.. should be pretty simple. Problem is
> the javascript is unable to resolve the tuscany package in the html page,
> ie...
>
> myJavaClass myObject = new tuscany.sca.Reference(myService); produces a
> javascript error
>
>

In order to tuscany.sca.Reference to work, you need to have a
component defined using implementation.widget. Do you have that ?
Could you please post your composite here ?

-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/


Re: Newbie config stuff...

Posted by Luciano Resende <lu...@gmail.com>.
On Tue, Nov 23, 2010 at 8:02 PM, Ted Stevens <ts...@earthlink.net> wrote:
> Not sure if this is the right place to post but here goes:
>
> I've got a project and directory structure similar to the 'store' example -
> I've got just 1 client service class.. should be pretty simple. Problem is
> the javascript is unable to resolve the tuscany package in the html page,
> ie...
>
> myJavaClass myObject = new tuscany.sca.Reference(myService);      produces a
> javascript error
>
>

In order to tuscany.sca.Reference to work, you need to have a
component defined using implementation.widget. Do you have that ?
Could you please post your composite here ?

-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/