You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Vamsavardhana Reddy <c1...@gmail.com> on 2007/07/23 14:18:38 UTC

Is there a problem in EmbeddedSCADomain.activateDomain() ?

Hi,

I have the following piece of code to add contribution to an
EmbeddedSCADomain:

<snip>
                EmbeddedSCADomain eScaDomain = new
EmbeddedSCADomain(classLoader, domainUri);
                ModelResolverImpl modelResolver = new
ModelResolverImpl(classLoader);
                Contribution contribution =
eScaDomain.getContributionService().contribute(contributionURI, new
URL(contributionRoot), modelResolver, false);
                for (DeployedArtifact artifact : contribution.getArtifacts())
{
                    if (artifact.getModel() instanceof Composite) {
                        eScaDomain.getDomainCompositeHelper
().addComposite((Composite)artifact.getModel());
                    }
                }
                eScaDomain.getDomainCompositeHelper().activateDomain();
</snip>

Service lookup is fine.  But, service invocation is throwing a
NullPointerException.  Upon debugging I notice that the references inside
the composite are not wired.  If I add a call
compositeActivator.start(domainComposite)
inside EmbeddedSCADomain.activateDomain() method , I am getting my code to
run as expected.  I am wondering if there is a problem in
EmbeddedSCADomain.activateDomain() method.

Thanks and regards,
Vamsi

Re: Is there a problem in EmbeddedSCADomain.activateDomain() ?

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
Hi Luciano,

If I call DomainCompositeHelper.startComponent() on each of the components
from the first contribution after deploying the second, (that is after Step
6 from below), it results in an Exception which I ignore and continue.  But
towards the end I have services from both contributions running
successfully.  I am not able to figure an explanation.

Thanks and regards,
Vamsi


On 7/24/07, Vamsavardhana Reddy <c1...@gmail.com> wrote:
>
> Hi Luciano,
>
> I have created TUSCANY-1477 for the issue.
>
> Here is another situation I am running into.
> Step 0: Create an EmbeddedSCADomain.
> Step 1: Add contribution from contribution1.jar (which provides say
> "Service1") to EmbeddedSCADomain from Step 0.
> Step 2: Call EmbeddedSCADomain.DomainCompositeHelper.activateDomain()
> Step 3: Call EmbeddedSCADomain.DomainCompositeHelper.startComponent() on
> all componets from contribution1.jar.
> Step 4: Add contribution from contribution2.jar (which provides say
> "Service2") to EmbeddedSCADomain from Step 0.
> Step 5: Call EmbeddedSCADomain.DomainCompositeHelper.activateDomain()
> Step 6: Call EmbeddedSCADomain.DomainCompositeHelper.startComponent() on
> all componets from contribution2.jar.
>
> After Step 3, I am able to run Service1 successfully.  At Step 5, I get a
> message like the following:
> "Composite assembly problem: Service not found for component service:
> CalculatorServiceComponent/$promoted$.CalculatorService"
>
> After Step 6, Service1 no longer runs, where as Service2 runs
> successfully.
>
> Am I doing anything wrong in using EmbeddedSCADomain?  Can additional
> contribution be added to an EmbeddedSCADomain after it has been activated
> without disrupting the existing services?
>
> contribution1.jar and contribution2.jar are similar except that I add a
> "2" to each component name and the composite name.
>
> Thanks and regards,
> Vamsi
>
> On 7/24/07, Luciano Resende <lu...@gmail.com> wrote:
> >
> > Yes, you are right, could you please create a JIRA. If you are
> > comfortable, it would be great if you could also help on the fix by
> > producing a patch, otherwise I'll investigate the issue.
> >
> > On 7/23/07, Vamsavardhana Reddy <c1vamsi1c@gmail.com > wrote:
> > > Hi Luciano,
> > >
> > > Thank you for your reply.  It was very helpful.
> > >
> > > I am seeing another problem and this is with removing components and
> > > composites from EmbeddedSCADomain.  I have called
> > > eScaDomain.getDomainCompositeHelper().stopComponent(
> > > eScaDomain.getDomainCompositeHelper().getComponent(component.getName
> > ()))
> > > with all the component names in my composite and then
> > > eScaDomain.getDomainCompositeHelper ().removeComposite().  I am
> > noticing that
> > > the components are not getting removed from
> > > EmbeddedSCADomain.domainComposite.
> > > EmbeddedSCADomain.DomainCompositeHelper.removeComposite() is calling
> > > compositeActivator.deactivate().  But
> > CompositeActivatorImpl.deactivate() is
> > > empty.  Is there any other method to remove the components and
> > composite
> > > added to EmbeddedSCADomain?  Your input will be very helpful.  Thank
> > you for
> > > your time.
> > >
> > > Best regards,
> > > Vamsi
> > >
> > > On 7/23/07, Luciano Resende <lu...@gmail.com> wrote:
> > > >
> > > > When using EmbeddedSCADomain, this is the expected behavior,
> > activate
> > > > would include in the domain, and then you would need to start/stop
> > > > specific components. See the following as an example [1]
> > > >
> > > > [1]
> > > >
> > https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/contribution-import-export/test-import-composite/src/test/java/helloworld/HelloWorldServerTestCase.java
> > > >
> > > > On 7/23/07, Vamsavardhana Reddy < c1vamsi1c@gmail.com> wrote:
> > > > > Hi,
> > > > >
> > > > > I have the following piece of code to add contribution to an
> > > > > EmbeddedSCADomain:
> > > > >
> > > > > <snip>
> > > > >                 EmbeddedSCADomain eScaDomain = new
> > > > > EmbeddedSCADomain(classLoader, domainUri);
> > > > >                 ModelResolverImpl modelResolver = new
> > > > > ModelResolverImpl(classLoader);
> > > > >                 Contribution contribution =
> > > > > eScaDomain.getContributionService().contribute(contributionURI,
> > new
> > > > > URL(contributionRoot), modelResolver, false);
> > > > >                 for (DeployedArtifact artifact :
> > > > contribution.getArtifacts())
> > > > > {
> > > > >                     if (artifact.getModel() instanceof Composite)
> > {
> > > > >                         eScaDomain.getDomainCompositeHelper
> > > > > ().addComposite((Composite)artifact.getModel());
> > > > >                     }
> > > > >                 }
> > > > >                 eScaDomain.getDomainCompositeHelper().activateDomain();
> > > > > </snip>
> > > > >
> > > > > Service lookup is fine.  But, service invocation is throwing a
> > > > > NullPointerException.  Upon debugging I notice that the references
> >
> > > > inside
> > > > > the composite are not wired.  If I add a call
> > > > > compositeActivator.start(domainComposite)
> > > > > inside EmbeddedSCADomain.activateDomain() method , I am getting my
> > code
> > > > to
> > > > > run as expected.  I am wondering if there is a problem in
> > > > > EmbeddedSCADomain.activateDomain() method.
> > > > >
> > > > > Thanks and regards,
> > > > > Vamsi
> > > > >
> > > >
> > > >
> > > > --
> > > > Luciano Resende
> > > > Apache Tuscany Committer
> > > > http://people.apache.org/~lresende<http://people.apache.org/%7Elresende>
> > > > http://lresende.blogspot.com/
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> > > >
> > > >
> > >
> >
> >
> > --
> > Luciano Resende
> > Apache Tuscany Committer
> > http://people.apache.org/~lresende<http://people.apache.org/%7Elresende>
> > http://lresende.blogspot.com/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> >
>

Re: Is there a problem in EmbeddedSCADomain.activateDomain() ?

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
Hi Luciano,

I have created TUSCANY-1477 for the issue.

Here is another situation I am running into.
Step 0: Create an EmbeddedSCADomain.
Step 1: Add contribution from contribution1.jar (which provides say
"Service1") to EmbeddedSCADomain from Step 0.
Step 2: Call EmbeddedSCADomain.DomainCompositeHelper.activateDomain()
Step 3: Call EmbeddedSCADomain.DomainCompositeHelper.startComponent() on all
componets from contribution1.jar.
Step 4: Add contribution from contribution2.jar (which provides say
"Service2") to EmbeddedSCADomain from Step 0.
Step 5: Call EmbeddedSCADomain.DomainCompositeHelper.activateDomain()
Step 6: Call EmbeddedSCADomain.DomainCompositeHelper.startComponent() on all
componets from contribution2.jar.

After Step 3, I am able to run Service1 successfully.  At Step 5, I get a
message like the following:
"Composite assembly problem: Service not found for component service:
CalculatorServiceComponent/$promoted$.CalculatorService"

After Step 6, Service1 no longer runs, where as Service2 runs successfully.

Am I doing anything wrong in using EmbeddedSCADomain?  Can additional
contribution be added to an EmbeddedSCADomain after it has been activated
without disrupting the existing services?

contribution1.jar and contribution2.jar are similar except that I add a "2"
to each component name and the composite name.

Thanks and regards,
Vamsi

On 7/24/07, Luciano Resende <lu...@gmail.com> wrote:
>
> Yes, you are right, could you please create a JIRA. If you are
> comfortable, it would be great if you could also help on the fix by
> producing a patch, otherwise I'll investigate the issue.
>
> On 7/23/07, Vamsavardhana Reddy <c1...@gmail.com> wrote:
> > Hi Luciano,
> >
> > Thank you for your reply.  It was very helpful.
> >
> > I am seeing another problem and this is with removing components and
> > composites from EmbeddedSCADomain.  I have called
> > eScaDomain.getDomainCompositeHelper().stopComponent(
> > eScaDomain.getDomainCompositeHelper().getComponent(component.getName()))
> > with all the component names in my composite and then
> > eScaDomain.getDomainCompositeHelper().removeComposite().  I am noticing
> that
> > the components are not getting removed from
> > EmbeddedSCADomain.domainComposite.
> > EmbeddedSCADomain.DomainCompositeHelper.removeComposite() is calling
> > compositeActivator.deactivate().  But CompositeActivatorImpl.deactivate()
> is
> > empty.  Is there any other method to remove the components and composite
> > added to EmbeddedSCADomain?  Your input will be very helpful.  Thank you
> for
> > your time.
> >
> > Best regards,
> > Vamsi
> >
> > On 7/23/07, Luciano Resende <lu...@gmail.com> wrote:
> > >
> > > When using EmbeddedSCADomain, this is the expected behavior, activate
> > > would include in the domain, and then you would need to start/stop
> > > specific components. See the following as an example [1]
> > >
> > > [1]
> > >
> https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/contribution-import-export/test-import-composite/src/test/java/helloworld/HelloWorldServerTestCase.java
> > >
> > > On 7/23/07, Vamsavardhana Reddy <c1...@gmail.com> wrote:
> > > > Hi,
> > > >
> > > > I have the following piece of code to add contribution to an
> > > > EmbeddedSCADomain:
> > > >
> > > > <snip>
> > > >                 EmbeddedSCADomain eScaDomain = new
> > > > EmbeddedSCADomain(classLoader, domainUri);
> > > >                 ModelResolverImpl modelResolver = new
> > > > ModelResolverImpl(classLoader);
> > > >                 Contribution contribution =
> > > > eScaDomain.getContributionService().contribute(contributionURI, new
> > > > URL(contributionRoot), modelResolver, false);
> > > >                 for (DeployedArtifact artifact :
> > > contribution.getArtifacts())
> > > > {
> > > >                     if (artifact.getModel() instanceof Composite) {
> > > >                         eScaDomain.getDomainCompositeHelper
> > > > ().addComposite((Composite)artifact.getModel());
> > > >                     }
> > > >                 }
> > > >                 eScaDomain.getDomainCompositeHelper
> ().activateDomain();
> > > > </snip>
> > > >
> > > > Service lookup is fine.  But, service invocation is throwing a
> > > > NullPointerException.  Upon debugging I notice that the references
> > > inside
> > > > the composite are not wired.  If I add a call
> > > > compositeActivator.start(domainComposite)
> > > > inside EmbeddedSCADomain.activateDomain() method , I am getting my
> code
> > > to
> > > > run as expected.  I am wondering if there is a problem in
> > > > EmbeddedSCADomain.activateDomain() method.
> > > >
> > > > Thanks and regards,
> > > > Vamsi
> > > >
> > >
> > >
> > > --
> > > Luciano Resende
> > > Apache Tuscany Committer
> > > http://people.apache.org/~lresende
> > > http://lresende.blogspot.com/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> > >
> > >
> >
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende
> http://lresende.blogspot.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

Re: Is there a problem in EmbeddedSCADomain.activateDomain() ?

Posted by Luciano Resende <lu...@gmail.com>.
Yes, you are right, could you please create a JIRA. If you are
comfortable, it would be great if you could also help on the fix by
producing a patch, otherwise I'll investigate the issue.

On 7/23/07, Vamsavardhana Reddy <c1...@gmail.com> wrote:
> Hi Luciano,
>
> Thank you for your reply.  It was very helpful.
>
> I am seeing another problem and this is with removing components and
> composites from EmbeddedSCADomain.  I have called
> eScaDomain.getDomainCompositeHelper().stopComponent(
> eScaDomain.getDomainCompositeHelper().getComponent(component.getName()))
> with all the component names in my composite and then
> eScaDomain.getDomainCompositeHelper().removeComposite().  I am noticing that
> the components are not getting removed from
> EmbeddedSCADomain.domainComposite.
> EmbeddedSCADomain.DomainCompositeHelper.removeComposite() is calling
> compositeActivator.deactivate().  But CompositeActivatorImpl.deactivate() is
> empty.  Is there any other method to remove the components and composite
> added to EmbeddedSCADomain?  Your input will be very helpful.  Thank you for
> your time.
>
> Best regards,
> Vamsi
>
> On 7/23/07, Luciano Resende <lu...@gmail.com> wrote:
> >
> > When using EmbeddedSCADomain, this is the expected behavior, activate
> > would include in the domain, and then you would need to start/stop
> > specific components. See the following as an example [1]
> >
> > [1]
> > https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/contribution-import-export/test-import-composite/src/test/java/helloworld/HelloWorldServerTestCase.java
> >
> > On 7/23/07, Vamsavardhana Reddy <c1...@gmail.com> wrote:
> > > Hi,
> > >
> > > I have the following piece of code to add contribution to an
> > > EmbeddedSCADomain:
> > >
> > > <snip>
> > >                 EmbeddedSCADomain eScaDomain = new
> > > EmbeddedSCADomain(classLoader, domainUri);
> > >                 ModelResolverImpl modelResolver = new
> > > ModelResolverImpl(classLoader);
> > >                 Contribution contribution =
> > > eScaDomain.getContributionService().contribute(contributionURI, new
> > > URL(contributionRoot), modelResolver, false);
> > >                 for (DeployedArtifact artifact :
> > contribution.getArtifacts())
> > > {
> > >                     if (artifact.getModel() instanceof Composite) {
> > >                         eScaDomain.getDomainCompositeHelper
> > > ().addComposite((Composite)artifact.getModel());
> > >                     }
> > >                 }
> > >                 eScaDomain.getDomainCompositeHelper().activateDomain();
> > > </snip>
> > >
> > > Service lookup is fine.  But, service invocation is throwing a
> > > NullPointerException.  Upon debugging I notice that the references
> > inside
> > > the composite are not wired.  If I add a call
> > > compositeActivator.start(domainComposite)
> > > inside EmbeddedSCADomain.activateDomain() method , I am getting my code
> > to
> > > run as expected.  I am wondering if there is a problem in
> > > EmbeddedSCADomain.activateDomain() method.
> > >
> > > Thanks and regards,
> > > Vamsi
> > >
> >
> >
> > --
> > Luciano Resende
> > Apache Tuscany Committer
> > http://people.apache.org/~lresende
> > http://lresende.blogspot.com/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> >
>


-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Is there a problem in EmbeddedSCADomain.activateDomain() ?

Posted by Vamsavardhana Reddy <c1...@gmail.com>.
Hi Luciano,

Thank you for your reply.  It was very helpful.

I am seeing another problem and this is with removing components and
composites from EmbeddedSCADomain.  I have called
eScaDomain.getDomainCompositeHelper().stopComponent(
eScaDomain.getDomainCompositeHelper().getComponent(component.getName()))
with all the component names in my composite and then
eScaDomain.getDomainCompositeHelper().removeComposite().  I am noticing that
the components are not getting removed from
EmbeddedSCADomain.domainComposite.
EmbeddedSCADomain.DomainCompositeHelper.removeComposite() is calling
compositeActivator.deactivate().  But CompositeActivatorImpl.deactivate() is
empty.  Is there any other method to remove the components and composite
added to EmbeddedSCADomain?  Your input will be very helpful.  Thank you for
your time.

Best regards,
Vamsi

On 7/23/07, Luciano Resende <lu...@gmail.com> wrote:
>
> When using EmbeddedSCADomain, this is the expected behavior, activate
> would include in the domain, and then you would need to start/stop
> specific components. See the following as an example [1]
>
> [1]
> https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/contribution-import-export/test-import-composite/src/test/java/helloworld/HelloWorldServerTestCase.java
>
> On 7/23/07, Vamsavardhana Reddy <c1...@gmail.com> wrote:
> > Hi,
> >
> > I have the following piece of code to add contribution to an
> > EmbeddedSCADomain:
> >
> > <snip>
> >                 EmbeddedSCADomain eScaDomain = new
> > EmbeddedSCADomain(classLoader, domainUri);
> >                 ModelResolverImpl modelResolver = new
> > ModelResolverImpl(classLoader);
> >                 Contribution contribution =
> > eScaDomain.getContributionService().contribute(contributionURI, new
> > URL(contributionRoot), modelResolver, false);
> >                 for (DeployedArtifact artifact :
> contribution.getArtifacts())
> > {
> >                     if (artifact.getModel() instanceof Composite) {
> >                         eScaDomain.getDomainCompositeHelper
> > ().addComposite((Composite)artifact.getModel());
> >                     }
> >                 }
> >                 eScaDomain.getDomainCompositeHelper().activateDomain();
> > </snip>
> >
> > Service lookup is fine.  But, service invocation is throwing a
> > NullPointerException.  Upon debugging I notice that the references
> inside
> > the composite are not wired.  If I add a call
> > compositeActivator.start(domainComposite)
> > inside EmbeddedSCADomain.activateDomain() method , I am getting my code
> to
> > run as expected.  I am wondering if there is a problem in
> > EmbeddedSCADomain.activateDomain() method.
> >
> > Thanks and regards,
> > Vamsi
> >
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende
> http://lresende.blogspot.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

Re: Is there a problem in EmbeddedSCADomain.activateDomain() ?

Posted by Luciano Resende <lu...@gmail.com>.
When using EmbeddedSCADomain, this is the expected behavior, activate
would include in the domain, and then you would need to start/stop
specific components. See the following as an example [1]

[1] https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/contribution-import-export/test-import-composite/src/test/java/helloworld/HelloWorldServerTestCase.java

On 7/23/07, Vamsavardhana Reddy <c1...@gmail.com> wrote:
> Hi,
>
> I have the following piece of code to add contribution to an
> EmbeddedSCADomain:
>
> <snip>
>                 EmbeddedSCADomain eScaDomain = new
> EmbeddedSCADomain(classLoader, domainUri);
>                 ModelResolverImpl modelResolver = new
> ModelResolverImpl(classLoader);
>                 Contribution contribution =
> eScaDomain.getContributionService().contribute(contributionURI, new
> URL(contributionRoot), modelResolver, false);
>                 for (DeployedArtifact artifact : contribution.getArtifacts())
> {
>                     if (artifact.getModel() instanceof Composite) {
>                         eScaDomain.getDomainCompositeHelper
> ().addComposite((Composite)artifact.getModel());
>                     }
>                 }
>                 eScaDomain.getDomainCompositeHelper().activateDomain();
> </snip>
>
> Service lookup is fine.  But, service invocation is throwing a
> NullPointerException.  Upon debugging I notice that the references inside
> the composite are not wired.  If I add a call
> compositeActivator.start(domainComposite)
> inside EmbeddedSCADomain.activateDomain() method , I am getting my code to
> run as expected.  I am wondering if there is a problem in
> EmbeddedSCADomain.activateDomain() method.
>
> Thanks and regards,
> Vamsi
>


-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org