You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Douglas Leite <do...@gmail.com> on 2008/08/21 22:06:38 UTC
Issues: Java Script and SCA
I have some issues with using Java Script and SCA. After look some examples,
I have noticed the usage of this structure:
#SCDL:
<composite>
<component name="Calendar">
<t:implementation.widget location="uiservices/calendar.html"/>
<service name="Widget">
<t:binding.http uri="/calendar"/>
</service>
<reference name="calendarRef" target="CalendarComponent">
<t:binding.jsonrpc/>
</reference>
</component>
<component name="CalendarComponent">
<implementation.java class="package.Class"/>
<service name="CalendarService">
<t:binding.jsonrpc/>
</service>
</component>
</composite>
#Java Script
<script type="text/javascript" src="calendar.js"></script>
<script language="JavaScript">
//@Reference
var calendarRef = new Reference("calendarRef");
function init() {
try {
calendarRef.someMethod();
}
catch(e){
alert(e);
}
}
</script>
However, if I execute this, I get a "TypeError: calendarRef is undefined".
Am I missing something?
Thanks
--
Douglas Siqueira Leite
Computer Science Master's degree student of University of Campinas
(Unicamp), Brazil
Re: Issues: Java Script and SCA
Posted by Douglas Leite <do...@gmail.com>.
The code is available on my sandbox: http://
svn.apache.org/repos/asf/tuscany/sandbox/dougsleite
On Sun, Aug 31, 2008 at 3:36 PM, <lu...@gmail.com> wrote:
> Could you please make your code available, them me or others can help
> more easier. If this is a sample, just add it to trunk, even if it's a
> work in progress.
>
> On 8/29/08, Douglas Leite <do...@gmail.com> wrote:
> > Thanks Luciano for the advices. I have resolved part of the problem. Now,
> I
> > am getting the following warnings:
> > *
> > Aug 29, 2008 11:57:23 AM
> >
> org.apache.tuscany.sca.assembly.builder.impl.ComponentConfigurationBuilderImpl
> > WARNING: Service not found for component service: Component =
> > CalendarComponent Service = CalendarService
> > Aug 29, 2008 11:57:23 AM
> >
> org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingURIBuilderImpl
> > WARNING: Service not found for component service: Component =
> > CalendarComponent Service = CalendarService
> > Aug 29, 2008 11:57:23 AM
> > org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl activate
> > WARNING: Skipping component service not defined in the component type:
> > CalendarComponent#CalendarService*
> >
> > Any idea?
> >
> > On Thu, Aug 21, 2008 at 5:19 PM, Luciano Resende
> > <lu...@gmail.com>wrote:
> >
> >> On a high level look, it looks right, so some things to check :
> >>
> >> - When you start the application, are you seeing any warnings on
> >> the console ? Usually a missing dependencies will cause your binding
> >> or implementation not to be recognizable by the runtime and it then
> >> display some warnings like :
> >>
> >> Element
> >> {http://www.osoa.org/xmlns/sca/1.0}implementation.java<http://www.osoa.org/xmlns/sca/1.0%7Dimplementation.java>
> <http://www.osoa.org/xmlns/sca/1.0%7Dimplementation.java>
> >> cannot be processed.
> >>
> >> - Another thing is to check if you have your interfaces annotated
> >> as remotable (@Remotable)
> >>
> >>
> >> If you do see warnings, maybe it's a good idea to look at them or
> >> provide them so I can take a look.
> >>
> >> If this does not help, please provide a patch attached to a JIRA and I
> >> can take a look at it.
> >>
> >> On Thu, Aug 21, 2008 at 1:06 PM, Douglas Leite <do...@gmail.com>
> >> wrote:
> >> > I have some issues with using Java Script and SCA. After look some
> >> examples,
> >> > I have noticed the usage of this structure:
> >> >
> >> > #SCDL:
> >> >
> >> > <composite>
> >> >
> >> > <component name="Calendar">
> >> > <t:implementation.widget location="uiservices/calendar.html"/>
> >> > <service name="Widget">
> >> > <t:binding.http uri="/calendar"/>
> >> > </service>
> >> > <reference name="calendarRef" target="CalendarComponent">
> >> > <t:binding.jsonrpc/>
> >> > </reference>
> >> > </component>
> >> >
> >> > <component name="CalendarComponent">
> >> > <implementation.java class="package.Class"/>
> >> > <service name="CalendarService">
> >> > <t:binding.jsonrpc/>
> >> > </service>
> >> > </component>
> >> >
> >> > </composite>
> >> >
> >> > #Java Script
> >> >
> >> > <script type="text/javascript" src="calendar.js"></script>
> >> >
> >> > <script language="JavaScript">
> >> >
> >> >
> >> > //@Reference
> >> > var calendarRef = new Reference("calendarRef");
> >> >
> >> > function init() {
> >> >
> >> > try {
> >> > calendarRef.someMethod();
> >> >
> >> > }
> >> > catch(e){
> >> > alert(e);
> >> > }
> >> > }
> >> >
> >> > </script>
> >> >
> >> > However, if I execute this, I get a "TypeError: calendarRef is
> >> undefined".
> >> >
> >> > Am I missing something?
> >> >
> >> > Thanks
> >> >
> >> > --
> >> > Douglas Siqueira Leite
> >> > Computer Science Master's degree student of University of Campinas
> >> > (Unicamp), Brazil
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> Luciano Resende
> >> Apache Tuscany Committer
> >> http://people.apache.org/~lresende<http://people.apache.org/%7Elresende><
> http://people.apache.org/%7Elresende>
> >> http://lresende.blogspot.com/
> >>
> >
> >
> >
> > --
> > Douglas Siqueira Leite
> > Computer Science Master's degree student of University of Campinas
> > (Unicamp), Brazil
> >
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende <http://people.apache.org/%7Elresende>
> http://lresende.blogspot.com/
>
--
Douglas Siqueira Leite
Computer Science Master's degree student of University of Campinas
(Unicamp), Brazil
Re: Issues: Java Script and SCA
Posted by lu...@gmail.com.
Could you please make your code available, them me or others can help
more easier. If this is a sample, just add it to trunk, even if it's a
work in progress.
On 8/29/08, Douglas Leite <do...@gmail.com> wrote:
> Thanks Luciano for the advices. I have resolved part of the problem. Now, I
> am getting the following warnings:
> *
> Aug 29, 2008 11:57:23 AM
> org.apache.tuscany.sca.assembly.builder.impl.ComponentConfigurationBuilderImpl
> WARNING: Service not found for component service: Component =
> CalendarComponent Service = CalendarService
> Aug 29, 2008 11:57:23 AM
> org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingURIBuilderImpl
> WARNING: Service not found for component service: Component =
> CalendarComponent Service = CalendarService
> Aug 29, 2008 11:57:23 AM
> org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl activate
> WARNING: Skipping component service not defined in the component type:
> CalendarComponent#CalendarService*
>
> Any idea?
>
> On Thu, Aug 21, 2008 at 5:19 PM, Luciano Resende
> <lu...@gmail.com>wrote:
>
>> On a high level look, it looks right, so some things to check :
>>
>> - When you start the application, are you seeing any warnings on
>> the console ? Usually a missing dependencies will cause your binding
>> or implementation not to be recognizable by the runtime and it then
>> display some warnings like :
>>
>> Element
>> {http://www.osoa.org/xmlns/sca/1.0}implementation.java<http://www.osoa.org/xmlns/sca/1.0%7Dimplementation.java>
>> cannot be processed.
>>
>> - Another thing is to check if you have your interfaces annotated
>> as remotable (@Remotable)
>>
>>
>> If you do see warnings, maybe it's a good idea to look at them or
>> provide them so I can take a look.
>>
>> If this does not help, please provide a patch attached to a JIRA and I
>> can take a look at it.
>>
>> On Thu, Aug 21, 2008 at 1:06 PM, Douglas Leite <do...@gmail.com>
>> wrote:
>> > I have some issues with using Java Script and SCA. After look some
>> examples,
>> > I have noticed the usage of this structure:
>> >
>> > #SCDL:
>> >
>> > <composite>
>> >
>> > <component name="Calendar">
>> > <t:implementation.widget location="uiservices/calendar.html"/>
>> > <service name="Widget">
>> > <t:binding.http uri="/calendar"/>
>> > </service>
>> > <reference name="calendarRef" target="CalendarComponent">
>> > <t:binding.jsonrpc/>
>> > </reference>
>> > </component>
>> >
>> > <component name="CalendarComponent">
>> > <implementation.java class="package.Class"/>
>> > <service name="CalendarService">
>> > <t:binding.jsonrpc/>
>> > </service>
>> > </component>
>> >
>> > </composite>
>> >
>> > #Java Script
>> >
>> > <script type="text/javascript" src="calendar.js"></script>
>> >
>> > <script language="JavaScript">
>> >
>> >
>> > //@Reference
>> > var calendarRef = new Reference("calendarRef");
>> >
>> > function init() {
>> >
>> > try {
>> > calendarRef.someMethod();
>> >
>> > }
>> > catch(e){
>> > alert(e);
>> > }
>> > }
>> >
>> > </script>
>> >
>> > However, if I execute this, I get a "TypeError: calendarRef is
>> undefined".
>> >
>> > Am I missing something?
>> >
>> > Thanks
>> >
>> > --
>> > Douglas Siqueira Leite
>> > Computer Science Master's degree student of University of Campinas
>> > (Unicamp), Brazil
>> >
>> >
>>
>>
>>
>> --
>> Luciano Resende
>> Apache Tuscany Committer
>> http://people.apache.org/~lresende <http://people.apache.org/%7Elresende>
>> http://lresende.blogspot.com/
>>
>
>
>
> --
> Douglas Siqueira Leite
> Computer Science Master's degree student of University of Campinas
> (Unicamp), Brazil
>
--
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/
Re: Issues: Java Script and SCA
Posted by Douglas Leite <do...@gmail.com>.
Thanks Luciano for the advices. I have resolved part of the problem. Now, I
am getting the following warnings:
*
Aug 29, 2008 11:57:23 AM
org.apache.tuscany.sca.assembly.builder.impl.ComponentConfigurationBuilderImpl
WARNING: Service not found for component service: Component =
CalendarComponent Service = CalendarService
Aug 29, 2008 11:57:23 AM
org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingURIBuilderImpl
WARNING: Service not found for component service: Component =
CalendarComponent Service = CalendarService
Aug 29, 2008 11:57:23 AM
org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl activate
WARNING: Skipping component service not defined in the component type:
CalendarComponent#CalendarService*
Any idea?
On Thu, Aug 21, 2008 at 5:19 PM, Luciano Resende <lu...@gmail.com>wrote:
> On a high level look, it looks right, so some things to check :
>
> - When you start the application, are you seeing any warnings on
> the console ? Usually a missing dependencies will cause your binding
> or implementation not to be recognizable by the runtime and it then
> display some warnings like :
>
> Element {http://www.osoa.org/xmlns/sca/1.0}implementation.java<http://www.osoa.org/xmlns/sca/1.0%7Dimplementation.java>
> cannot be processed.
>
> - Another thing is to check if you have your interfaces annotated
> as remotable (@Remotable)
>
>
> If you do see warnings, maybe it's a good idea to look at them or
> provide them so I can take a look.
>
> If this does not help, please provide a patch attached to a JIRA and I
> can take a look at it.
>
> On Thu, Aug 21, 2008 at 1:06 PM, Douglas Leite <do...@gmail.com>
> wrote:
> > I have some issues with using Java Script and SCA. After look some
> examples,
> > I have noticed the usage of this structure:
> >
> > #SCDL:
> >
> > <composite>
> >
> > <component name="Calendar">
> > <t:implementation.widget location="uiservices/calendar.html"/>
> > <service name="Widget">
> > <t:binding.http uri="/calendar"/>
> > </service>
> > <reference name="calendarRef" target="CalendarComponent">
> > <t:binding.jsonrpc/>
> > </reference>
> > </component>
> >
> > <component name="CalendarComponent">
> > <implementation.java class="package.Class"/>
> > <service name="CalendarService">
> > <t:binding.jsonrpc/>
> > </service>
> > </component>
> >
> > </composite>
> >
> > #Java Script
> >
> > <script type="text/javascript" src="calendar.js"></script>
> >
> > <script language="JavaScript">
> >
> >
> > //@Reference
> > var calendarRef = new Reference("calendarRef");
> >
> > function init() {
> >
> > try {
> > calendarRef.someMethod();
> >
> > }
> > catch(e){
> > alert(e);
> > }
> > }
> >
> > </script>
> >
> > However, if I execute this, I get a "TypeError: calendarRef is
> undefined".
> >
> > Am I missing something?
> >
> > Thanks
> >
> > --
> > Douglas Siqueira Leite
> > Computer Science Master's degree student of University of Campinas
> > (Unicamp), Brazil
> >
> >
>
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende <http://people.apache.org/%7Elresende>
> http://lresende.blogspot.com/
>
--
Douglas Siqueira Leite
Computer Science Master's degree student of University of Campinas
(Unicamp), Brazil
Re: Issues: Java Script and SCA
Posted by Luciano Resende <lu...@gmail.com>.
On a high level look, it looks right, so some things to check :
- When you start the application, are you seeing any warnings on
the console ? Usually a missing dependencies will cause your binding
or implementation not to be recognizable by the runtime and it then
display some warnings like :
Element {http://www.osoa.org/xmlns/sca/1.0}implementation.java
cannot be processed.
- Another thing is to check if you have your interfaces annotated
as remotable (@Remotable)
If you do see warnings, maybe it's a good idea to look at them or
provide them so I can take a look.
If this does not help, please provide a patch attached to a JIRA and I
can take a look at it.
On Thu, Aug 21, 2008 at 1:06 PM, Douglas Leite <do...@gmail.com> wrote:
> I have some issues with using Java Script and SCA. After look some examples,
> I have noticed the usage of this structure:
>
> #SCDL:
>
> <composite>
>
> <component name="Calendar">
> <t:implementation.widget location="uiservices/calendar.html"/>
> <service name="Widget">
> <t:binding.http uri="/calendar"/>
> </service>
> <reference name="calendarRef" target="CalendarComponent">
> <t:binding.jsonrpc/>
> </reference>
> </component>
>
> <component name="CalendarComponent">
> <implementation.java class="package.Class"/>
> <service name="CalendarService">
> <t:binding.jsonrpc/>
> </service>
> </component>
>
> </composite>
>
> #Java Script
>
> <script type="text/javascript" src="calendar.js"></script>
>
> <script language="JavaScript">
>
>
> //@Reference
> var calendarRef = new Reference("calendarRef");
>
> function init() {
>
> try {
> calendarRef.someMethod();
>
> }
> catch(e){
> alert(e);
> }
> }
>
> </script>
>
> However, if I execute this, I get a "TypeError: calendarRef is undefined".
>
> Am I missing something?
>
> Thanks
>
> --
> Douglas Siqueira Leite
> Computer Science Master's degree student of University of Campinas
> (Unicamp), Brazil
>
>
--
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/