You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Jean-Sebastien Delfino <js...@apache.org> on 2008/10/01 07:21:24 UTC

Re: Tuscany / Equinox-OSGi integration, was: Creating distros for OSGi-enabled Tuscany/SCA

ant elder wrote:
> 
> 
> On Mon, Sep 29, 2008 at 5:01 PM, Jean-Sebastien Delfino 
> <jsdelfino@apache.org <ma...@apache.org>> wrote:
> 
>     ant elder wrote:
> 
> 
> 
>         On Thu, Sep 11, 2008 at 5:37 PM, Jean-Sebastien Delfino
>         <jsdelfino@apache.org <ma...@apache.org>
>         <mailto:jsdelfino@apache.org <ma...@apache.org>>> wrote:
> 
>         <snip>
> 
> 
>            I'll create a branch to make progress on this Equinox porting
>         effort
>            without breaking everybody else. As I said before it'll probably
>            take a few weeks to get most Tuscany samples and itests up and
>            running, but I'd like to try to have a few core itests and
>         maybe a
>            Web Service or two working in the next few days.
> 
> 
> 
>         Its been a few weeks now, what are the plans and time frames for
>         merging this branch back into the mainstream trunk?
> 
>           ...ant
> 
> 
>     Still making progress on the Equinox bringup, going slowly as I'm
>     busy at work. Getting the whole runtime really working end to end in
>     Equinox is going to require changes in many different places in the
>     code, so don't expect miracles it's going to take time. Some of the
>     changes may be possible to merge to trunk already if people want to
>     help with that.
> 
>     -- 
>     Jean-Sebastien
> 
> 
> The problem with helping is that its difficult to work out what are the 
> changes. I've done a diff of the sca-equinox branch to the trunk which 
> is at: http://people.apache.org/~antelder/temp/sca-equinox.diff. Its 
> huge, and lots of the changes seem quite unrelated to OSGi class 
> loading. Some changes from trunk get merged to the branch, some don't, 
> others get modified and then merged, there's also what looks like new 
> development not directly related to OSGi/Equinox that goes into the 
> branch but not trunk. If this branch is to show what changes are needed 
> for Equinox then wouldn't it be clearer if the only changes in the 
> branch were directly related to Equinox? With the diff so huge now how 
> can this ever get merged to trunk?
> 
>    ...ant
> 

I've always had trouble too working off flat diffs like that. Merging / 
porting individual commits from the history should be easier. That's 
what I've been doing to pull some changes from trunk, and it's really 
easy once you've done it a few times and have defined your merge 
processes with the Svn, diff, patch tools etc. If you're interested in 
trying it, for more complicated cases (like when I started to create the 
android branch) I've also found Git very powerful at handling merges. 
Working off the history should also help you pick only the changes that 
are not going to break the trunk at this point, or pick them in a more 
convenient sequence for example.

If that helps I could try to document the steps that I've been following 
for various merge cases but I'm busy these days so it'll probably take 
some time before I get to it.

If people want to help, at the moment I'm seeing issues with many 
'dirty' cross module dependencies (tapping directly into impl classes 
instead of going through the SPI.

An example is dependencies on o.a.t.sca.contribution.impl, causing this:

warning: Unresolved resource 
META-INF/services/org.apache.tuscany.sca.node.SCANodeFactory found in 15 
org.apache.tuscany.sca.node.impl INSTALLED
severe: SCA Node could not be created
java.lang.reflect.InvocationTargetException
         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at 
org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node(NodeLauncherUtil.java:155)
         at 
org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher.createNode(NodeLauncher.java:83)
         at calculator.CalculatorTestCase.setUp(CalculatorTestCase.java:44)
         at junit.framework.TestCase.runBare(TestCase.java:132)
         at junit.framework.TestResult$1.protect(TestResult.java:110)
         at junit.framework.TestResult.runProtected(TestResult.java:128)
         at junit.framework.TestResult.run(TestResult.java:113)
         at junit.framework.TestCase.run(TestCase.java:124)
         at junit.framework.TestSuite.runTest(TestSuite.java:232)
         at junit.framework.TestSuite.run(TestSuite.java:227)
         at 
org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
         at 
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
         at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
         at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
         at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at 
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:308)
         at 
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:879)
Caused by: org.osoa.sca.ServiceRuntimeException: 
java.lang.reflect.InvocationTargetException
         at 
org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:146)
         at 
org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationLauncherBootstrap.<init>(NodeImplementationLauncherBootstrap.java:116)
         ... 25 more
Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at 
org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:128)
         ... 26 more
Caused by: java.lang.IllegalStateException: 
org.osgi.framework.BundleException: The bundle could not be resolved. 
Reason: Missing Constraint: Import-Package: 
org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
         at 
org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:227)
         at 
org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getFirstServiceDeclaration(EquinoxServiceDiscoverer.java:191)
         at 
org.apache.tuscany.sca.extensibility.ServiceDiscovery.getFirstServiceDeclaration(ServiceDiscovery.java:83)
         ... 31 more
Caused by: org.osgi.framework.BundleException: The bundle could not be 
resolved. Reason: Missing Constraint: Import-Package: 
org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
         at 
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:305)
         at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
         at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:252)
         at 
org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:225)
         ... 33 more
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.213 
sec <<< FAILURE!
testDummy(calculator.CalculatorTestCase)  Time elapsed: 4.153 sec  <<< 
ERROR!
org.apache.tuscany.sca.node.equinox.launcher.LauncherException: 
java.lang.reflect.InvocationTargetException
         at 
org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node(NodeLauncherUtil.java:174)
         at 
org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher.createNode(NodeLauncher.java:83)
         at calculator.CalculatorTestCase.setUp(CalculatorTestCase.java:44)
         at junit.framework.TestCase.runBare(TestCase.java:132)
         at junit.framework.TestResult$1.protect(TestResult.java:110)
         at junit.framework.TestResult.runProtected(TestResult.java:128)
         at junit.framework.TestResult.run(TestResult.java:113)
         at junit.framework.TestCase.run(TestCase.java:124)
         at junit.framework.TestSuite.runTest(TestSuite.java:232)
         at junit.framework.TestSuite.run(TestSuite.java:227)
         at 
org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
         at 
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
         at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
         at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
         at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at 
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:308)
         at 
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:879)
Caused by: java.lang.reflect.InvocationTargetException
         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at 
org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node(NodeLauncherUtil.java:155)
         ... 20 more
Caused by: org.osoa.sca.ServiceRuntimeException: 
java.lang.reflect.InvocationTargetException
         at 
org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:146)
         at 
org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationLauncherBootstrap.<init>(NodeImplementationLauncherBootstrap.java:116)
         ... 25 more
Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at 
org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:128)
         ... 26 more
Caused by: java.lang.IllegalStateException: 
org.osgi.framework.BundleException: The bundle could not be resolved. 
Reason: Missing Constraint: Import-Package: 
org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
         at 
org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:227)
         at 
org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getFirstServiceDeclaration(EquinoxServiceDiscoverer.java:191)
         at 
org.apache.tuscany.sca.extensibility.ServiceDiscovery.getFirstServiceDeclaration(ServiceDiscovery.java:83)
         ... 31 more
Caused by: org.osgi.framework.BundleException: The bundle could not be 
resolved. Reason: Missing Constraint: Import-Package: 
org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
         at 
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:305)
         at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
         at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:252)
         at 
org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:225)
         ... 33 more


I'm starting to fix node-impl to only reference SPIs but I've not been 
able to find what's causing the above exception, given that the 
unresolved contribution.impl package is exported+imported right now (as 
a workaround, but the workaround doesn't seem to work).

So if anybody has ideas about that exception, please let me know...

Thanks
-- 
Jean-Sebastien

Re: Tuscany / Equinox-OSGi integration, was: Creating distros for OSGi-enabled Tuscany/SCA

Posted by ant elder <an...@gmail.com>.
On Thu, Oct 9, 2008 at 10:08 AM, ant elder <an...@gmail.com> wrote:

>
>
> On Thu, Oct 9, 2008 at 7:52 AM, Jean-Sebastien Delfino <
> jsdelfino@apache.org> wrote:
>
>> Simon Nash wrote:
>>
>>> See inline.
>>>
>>>  Simon
>>>
>>> ant elder wrote:
>>>
>>>>
>>>>
>>>> On Mon, Oct 6, 2008 at 9:02 AM, Jean-Sebastien Delfino <
>>>> jsdelfino@apache.org <ma...@apache.org>> wrote:
>>>>
>>>>    ant elder wrote:
>>>>
>>>>   > (cut)
>>>
>>>>
>>>>        So this branch is really a fork isn't it?
>>>>
>>>>          ...ant
>>>>
>>>>
>>>>    Is that a question or a statement? I don't really understand how you
>>>>    come up to that conclusion.
>>>>
>>>>    It's not a fork, it's a branch to work through breaking changes (and
>>>>    pretty complex changes I must say) which should allow our runtime to
>>>>    correctly work as a set of modular bundles in an Equinox/OSGi
>>>>    environment.
>>>>
>>>>    I'm hoping that this work can somehow benefit Tuscany, by providing
>>>>    code, patterns or maybe just a set of techniques that the project
>>>>    can implement to work in Equinox/OSGi. It'll be up to the Tuscany
>>>>    community to take a look and decide what can be reused or if it's
>>>>    just something to study and learn from.
>>>>
>>>>  If the focus is purely on OSGi/Equinox support, this sounds fine to me,
>>> with the resulting code/patterns/techniques eventually getting applied
>>> to trunk.  If it includes other restructuring or changes, I'd prefer to
>>> see this kind of thing done in trunk as far as possible so it's easier
>>> for the whole community to participate.
>>>
>>>     At the moment that Equinox port is still pretty broken, I've made
>>>>    changes to start to clean up the dependencies on
>>>>    assembly.builder.impl and contribution.service.impl for example, but
>>>>    there are many other similar cross-bundle dependencies on
>>>>    implementation packages which will take time to clean up.
>>>>
>>>>  When this is working, will it imply a hard dependency from Tuscany on
>>> Equinox, or will there still be a way to run Tuscany outside of the
>>> OSGI/Equinox environment?
>>>
>>>  Simon
>>>
>>>     --     Jean-Sebastien
>>>>
>>>>
>>>> I guess what i'm still not understanding is why can't the most of this
>>>> happen in trunk? For example - "clean up the dependencies on
>>>> assembly.builder.impl and contribution.service.impl for example, but there
>>>> are many other similar cross-bundle dependencies on implementation packages"
>>>> - all of that is applicable to the trunk code and has no dependencies on the
>>>> OSGi changes so why not just do it from the start in trunk?
>>>>
>>>>   ...ant
>>>>
>>>
>> Here's how I'm approaching this work at the moment (although the approach
>> may change as I make progress, resolve issues or run into new issues).
>>
>> - Correctly running in OSGi requires significant restructuring and
>> refactoring of the Tuscany runtime. It's not just about dependencies on OSGi
>> APIs or changing how a few classes get loaded, it's also about making sure
>> that cross-bundle calls go through defined and exported SPIs. We had well
>> defined SPIs for a while but a lot of code has gone around the SPIs, instead
>> of evolving the SPIs when needed and that has gone for about 18 months, so
>> there's many examples of that. Now when you try to run this stuff in OSGi,
>> it just breaks as OSGi is not going to allow you to go around the package
>> visibility rules (and putting the whole runtime in a few big bundles that
>> import/export everything is not really serious or interesting).
>>
>
> Ok and AFAICT there are no reasons that sort of SPI clean up and module
> refactoring work could not happen in the trunk code.
>
>
>>
>> - That restructuring would probably break trunk for a few months while we
>> work through ways to refactor it.
>
>
> I don't see why that needs to break trunk for months, this type of
> refactoring and clean up can be done less disruptively than that, we've done
> that type of thing in the earlier days of Tuscany without being broken for
> months at a time.
>
>
>> So, I'm trying to contribute enough  of the refactoring and the code
>> patterns that work well in OSGi in the sca-equinox branch now, to make it
>> easier to do it in trunk when trunk is ready for it. I'm hoping that we'll
>> then be able to do this work without breaking trunk too much and too long,
>> since we'll have something to look at and reflect on in the branch. It's
>> always much easier to do things a second time, when somebody has already
>> been through the pain of exploring it for you and you can take a look at the
>> result. That's what I'm trying to do now to help the project.
>>
>>
> I'm _really_ nervous of this approach. It sounds so much like what happened
> with the chianti fork and the disaster that caused.
>
> I don't believe after months of development you'd be able to easily share
> what you'd learnt while doing it or that it would be just used to "look at
> and reflect on". Its already becoming so different its almost impossible for
> those outside to be able to make any detailed code comparisons so i just
> don't see how this approach would be that useful to us for making
> corresponding changes in trunk.
>
> I've been wondering what to do about this fork for a while now, having it
> developed by one person in isolation and then forced on us as the new 2.x
> code stream would be the final nail in the project IMO. Just having the fork
> going on has stalled the trunk - nothing much is going on these days other
> than a bit of bug fixing, i've certainly stopped bothering doing much else
> as unless it gets picked up by the branch there doesn't seem much point.
>
> There's only one thing i've been able to think of to do so far - all join
> in now while its still in its infancy. We keep saying we need a new 2.x
> branch to do some breaking changes, to clean things up, and to 'innovate'
> in. The final versions of the OASIS spec are coming out so we could use a
> new branch to have clean support for those. Having us all work together on
> this refactor and clean up would mean we'd all get a much better
> understanding of the changes and would completely avoid all the issues about
> how to move it forward.
>
> What do others think? Are you happy having the branch going on? Nervous
> about what the future holds? Do you have other suggestions for changes that
> might make it seem more benevolent? Is anyone else up for helping to use
> this branch as the new 2.x?
>
>    ...ant
>
>

With only two replies to this I don't think we should go ahead with such a
drastic change to trunk. As an alternative could we base the new 2.x branch
on the current trunk code and right away start moving over the changes from
the branch to trunk and do any further development for OSGi in this new
trunk? That way we'd all start learning better whats needed for OSGi, with
help we could even probably all help moving some of the branch changes to
trunk. We'd still take the 1.4 branch now based on the current trunk so we'd
have that stable branch for near term releases.

   ...ant

Re: Tuscany / Equinox-OSGi integration, was: Creating distros for OSGi-enabled Tuscany/SCA

Posted by Simon Laws <si...@googlemail.com>.
On Thu, Oct 9, 2008 at 10:08 AM, ant elder <an...@gmail.com> wrote:

>
>
> On Thu, Oct 9, 2008 at 7:52 AM, Jean-Sebastien Delfino <
> jsdelfino@apache.org> wrote:
>
>> Simon Nash wrote:
>>
>>> See inline.
>>>
>>>  Simon
>>>
>>> ant elder wrote:
>>>
>>>>
>>>>
>>>> On Mon, Oct 6, 2008 at 9:02 AM, Jean-Sebastien Delfino <
>>>> jsdelfino@apache.org <ma...@apache.org>> wrote:
>>>>
>>>>    ant elder wrote:
>>>>
>>>>   > (cut)
>>>
>>>>
>>>>        So this branch is really a fork isn't it?
>>>>
>>>>          ...ant
>>>>
>>>>
>>>>    Is that a question or a statement? I don't really understand how you
>>>>    come up to that conclusion.
>>>>
>>>>    It's not a fork, it's a branch to work through breaking changes (and
>>>>    pretty complex changes I must say) which should allow our runtime to
>>>>    correctly work as a set of modular bundles in an Equinox/OSGi
>>>>    environment.
>>>>
>>>>    I'm hoping that this work can somehow benefit Tuscany, by providing
>>>>    code, patterns or maybe just a set of techniques that the project
>>>>    can implement to work in Equinox/OSGi. It'll be up to the Tuscany
>>>>    community to take a look and decide what can be reused or if it's
>>>>    just something to study and learn from.
>>>>
>>>>  If the focus is purely on OSGi/Equinox support, this sounds fine to me,
>>> with the resulting code/patterns/techniques eventually getting applied
>>> to trunk.  If it includes other restructuring or changes, I'd prefer to
>>> see this kind of thing done in trunk as far as possible so it's easier
>>> for the whole community to participate.
>>>
>>>     At the moment that Equinox port is still pretty broken, I've made
>>>>    changes to start to clean up the dependencies on
>>>>    assembly.builder.impl and contribution.service.impl for example, but
>>>>    there are many other similar cross-bundle dependencies on
>>>>    implementation packages which will take time to clean up.
>>>>
>>>>  When this is working, will it imply a hard dependency from Tuscany on
>>> Equinox, or will there still be a way to run Tuscany outside of the
>>> OSGI/Equinox environment?
>>>
>>>  Simon
>>>
>>>     --     Jean-Sebastien
>>>>
>>>>
>>>> I guess what i'm still not understanding is why can't the most of this
>>>> happen in trunk? For example - "clean up the dependencies on
>>>> assembly.builder.impl and contribution.service.impl for example, but there
>>>> are many other similar cross-bundle dependencies on implementation packages"
>>>> - all of that is applicable to the trunk code and has no dependencies on the
>>>> OSGi changes so why not just do it from the start in trunk?
>>>>
>>>>   ...ant
>>>>
>>>
>> Here's how I'm approaching this work at the moment (although the approach
>> may change as I make progress, resolve issues or run into new issues).
>>
>> - Correctly running in OSGi requires significant restructuring and
>> refactoring of the Tuscany runtime. It's not just about dependencies on OSGi
>> APIs or changing how a few classes get loaded, it's also about making sure
>> that cross-bundle calls go through defined and exported SPIs. We had well
>> defined SPIs for a while but a lot of code has gone around the SPIs, instead
>> of evolving the SPIs when needed and that has gone for about 18 months, so
>> there's many examples of that. Now when you try to run this stuff in OSGi,
>> it just breaks as OSGi is not going to allow you to go around the package
>> visibility rules (and putting the whole runtime in a few big bundles that
>> import/export everything is not really serious or interesting).
>>
>
> Ok and AFAICT there are no reasons that sort of SPI clean up and module
> refactoring work could not happen in the trunk code.
>
>
>>
>> - That restructuring would probably break trunk for a few months while we
>> work through ways to refactor it.
>
>
> I don't see why that needs to break trunk for months, this type of
> refactoring and clean up can be done less disruptively than that, we've done
> that type of thing in the earlier days of Tuscany without being broken for
> months at a time.
>
>
>> So, I'm trying to contribute enough  of the refactoring and the code
>> patterns that work well in OSGi in the sca-equinox branch now, to make it
>> easier to do it in trunk when trunk is ready for it. I'm hoping that we'll
>> then be able to do this work without breaking trunk too much and too long,
>> since we'll have something to look at and reflect on in the branch. It's
>> always much easier to do things a second time, when somebody has already
>> been through the pain of exploring it for you and you can take a look at the
>> result. That's what I'm trying to do now to help the project.
>>
>>
> I'm _really_ nervous of this approach. It sounds so much like what happened
> with the chianti fork and the disaster that caused.
>
> I don't believe after months of development you'd be able to easily share
> what you'd learnt while doing it or that it would be just used to "look at
> and reflect on". Its already becoming so different its almost impossible for
> those outside to be able to make any detailed code comparisons so i just
> don't see how this approach would be that useful to us for making
> corresponding changes in trunk.
>
> I've been wondering what to do about this fork for a while now, having it
> developed by one person in isolation and then forced on us as the new 2.x
> code stream would be the final nail in the project IMO. Just having the fork
> going on has stalled the trunk - nothing much is going on these days other
> than a bit of bug fixing, i've certainly stopped bothering doing much else
> as unless it gets picked up by the branch there doesn't seem much point.
>
> There's only one thing i've been able to think of to do so far - all join
> in now while its still in its infancy. We keep saying we need a new 2.x
> branch to do some breaking changes, to clean things up, and to 'innovate'
> in. The final versions of the OASIS spec are coming out so we could use a
> new branch to have clean support for those. Having us all work together on
> this refactor and clean up would mean we'd all get a much better
> understanding of the changes and would completely avoid all the issues about
> how to move it forward.
>
> What do others think? Are you happy having the branch going on? Nervous
> about what the future holds? Do you have other suggestions for changes that
> might make it seem more benevolent? Is anyone else up for helping to use
> this branch as the new 2.x?
>
>    ...ant
>
>
I'm actually completely comfortable if someone feels the motivation to go
off and try some things out in a branch or a sandbox. I wouldn't want to
make that hard to do in Tuscany.

I do share your concern about how the hidden gems in that work are
exploited. Normally I would expect the people doing the work to take the
responsibility for educating the community with their findings and for
working out how to suitably enhance the trunk. However in this case the
changes and challenges are, IMHO, more psychological/intellectual than
technical. If we really are going to do OSGi we all need to learn how to do
it and what this means for the way wite write Tuscany runtime code.

Hence +1 for making the contents of the branch be the new 2.x trunk.

I would say though that there are a number of things that I personally want
to see enhanced in the 1.x code stream and I certainly don't want to
disappear into 6 months (or however long/short it is) of 2.x trunk
development without adding value for our community that has committed to 1.x
for the time being.

So I would further propose that we take the current trunk and create a 1.x
branch (1-SNAPSHOT?) from which I (we?) can continue 1.x development and
releases as trunk shapes up.

Simon

Re: Tuscany / Equinox-OSGi integration, was: Creating distros for OSGi-enabled Tuscany/SCA

Posted by ant elder <an...@gmail.com>.
On Thu, Oct 9, 2008 at 7:52 AM, Jean-Sebastien Delfino <jsdelfino@apache.org
> wrote:

> Simon Nash wrote:
>
>> See inline.
>>
>>  Simon
>>
>> ant elder wrote:
>>
>>>
>>>
>>> On Mon, Oct 6, 2008 at 9:02 AM, Jean-Sebastien Delfino <
>>> jsdelfino@apache.org <ma...@apache.org>> wrote:
>>>
>>>    ant elder wrote:
>>>
>>>   > (cut)
>>
>>>
>>>        So this branch is really a fork isn't it?
>>>
>>>          ...ant
>>>
>>>
>>>    Is that a question or a statement? I don't really understand how you
>>>    come up to that conclusion.
>>>
>>>    It's not a fork, it's a branch to work through breaking changes (and
>>>    pretty complex changes I must say) which should allow our runtime to
>>>    correctly work as a set of modular bundles in an Equinox/OSGi
>>>    environment.
>>>
>>>    I'm hoping that this work can somehow benefit Tuscany, by providing
>>>    code, patterns or maybe just a set of techniques that the project
>>>    can implement to work in Equinox/OSGi. It'll be up to the Tuscany
>>>    community to take a look and decide what can be reused or if it's
>>>    just something to study and learn from.
>>>
>>>  If the focus is purely on OSGi/Equinox support, this sounds fine to me,
>> with the resulting code/patterns/techniques eventually getting applied
>> to trunk.  If it includes other restructuring or changes, I'd prefer to
>> see this kind of thing done in trunk as far as possible so it's easier
>> for the whole community to participate.
>>
>>     At the moment that Equinox port is still pretty broken, I've made
>>>    changes to start to clean up the dependencies on
>>>    assembly.builder.impl and contribution.service.impl for example, but
>>>    there are many other similar cross-bundle dependencies on
>>>    implementation packages which will take time to clean up.
>>>
>>>  When this is working, will it imply a hard dependency from Tuscany on
>> Equinox, or will there still be a way to run Tuscany outside of the
>> OSGI/Equinox environment?
>>
>>  Simon
>>
>>     --     Jean-Sebastien
>>>
>>>
>>> I guess what i'm still not understanding is why can't the most of this
>>> happen in trunk? For example - "clean up the dependencies on
>>> assembly.builder.impl and contribution.service.impl for example, but there
>>> are many other similar cross-bundle dependencies on implementation packages"
>>> - all of that is applicable to the trunk code and has no dependencies on the
>>> OSGi changes so why not just do it from the start in trunk?
>>>
>>>   ...ant
>>>
>>
> Here's how I'm approaching this work at the moment (although the approach
> may change as I make progress, resolve issues or run into new issues).
>
> - Correctly running in OSGi requires significant restructuring and
> refactoring of the Tuscany runtime. It's not just about dependencies on OSGi
> APIs or changing how a few classes get loaded, it's also about making sure
> that cross-bundle calls go through defined and exported SPIs. We had well
> defined SPIs for a while but a lot of code has gone around the SPIs, instead
> of evolving the SPIs when needed and that has gone for about 18 months, so
> there's many examples of that. Now when you try to run this stuff in OSGi,
> it just breaks as OSGi is not going to allow you to go around the package
> visibility rules (and putting the whole runtime in a few big bundles that
> import/export everything is not really serious or interesting).
>

Ok and AFAICT there are no reasons that sort of SPI clean up and module
refactoring work could not happen in the trunk code.


>
> - That restructuring would probably break trunk for a few months while we
> work through ways to refactor it.


I don't see why that needs to break trunk for months, this type of
refactoring and clean up can be done less disruptively than that, we've done
that type of thing in the earlier days of Tuscany without being broken for
months at a time.


> So, I'm trying to contribute enough  of the refactoring and the code
> patterns that work well in OSGi in the sca-equinox branch now, to make it
> easier to do it in trunk when trunk is ready for it. I'm hoping that we'll
> then be able to do this work without breaking trunk too much and too long,
> since we'll have something to look at and reflect on in the branch. It's
> always much easier to do things a second time, when somebody has already
> been through the pain of exploring it for you and you can take a look at the
> result. That's what I'm trying to do now to help the project.
>
>
I'm _really_ nervous of this approach. It sounds so much like what happened
with the chianti fork and the disaster that caused.

I don't believe after months of development you'd be able to easily share
what you'd learnt while doing it or that it would be just used to "look at
and reflect on". Its already becoming so different its almost impossible for
those outside to be able to make any detailed code comparisons so i just
don't see how this approach would be that useful to us for making
corresponding changes in trunk.

I've been wondering what to do about this fork for a while now, having it
developed by one person in isolation and then forced on us as the new 2.x
code stream would be the final nail in the project IMO. Just having the fork
going on has stalled the trunk - nothing much is going on these days other
than a bit of bug fixing, i've certainly stopped bothering doing much else
as unless it gets picked up by the branch there doesn't seem much point.

There's only one thing i've been able to think of to do so far - all join in
now while its still in its infancy. We keep saying we need a new 2.x branch
to do some breaking changes, to clean things up, and to 'innovate' in. The
final versions of the OASIS spec are coming out so we could use a new branch
to have clean support for those. Having us all work together on this
refactor and clean up would mean we'd all get a much better understanding of
the changes and would completely avoid all the issues about how to move it
forward.

What do others think? Are you happy having the branch going on? Nervous
about what the future holds? Do you have other suggestions for changes that
might make it seem more benevolent? Is anyone else up for helping to use
this branch as the new 2.x?

   ...ant

Re: Tuscany / Equinox-OSGi integration, was: Creating distros for OSGi-enabled Tuscany/SCA

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Simon Nash wrote:
> See inline.
> 
>   Simon
> 
> ant elder wrote:
>>
>>
>> On Mon, Oct 6, 2008 at 9:02 AM, Jean-Sebastien Delfino 
>> <jsdelfino@apache.org <ma...@apache.org>> wrote:
>>
>>     ant elder wrote:
>>
>  > (cut)
>>
>>         So this branch is really a fork isn't it?
>>
>>           ...ant
>>
>>
>>     Is that a question or a statement? I don't really understand how you
>>     come up to that conclusion.
>>
>>     It's not a fork, it's a branch to work through breaking changes (and
>>     pretty complex changes I must say) which should allow our runtime to
>>     correctly work as a set of modular bundles in an Equinox/OSGi
>>     environment.
>>
>>     I'm hoping that this work can somehow benefit Tuscany, by providing
>>     code, patterns or maybe just a set of techniques that the project
>>     can implement to work in Equinox/OSGi. It'll be up to the Tuscany
>>     community to take a look and decide what can be reused or if it's
>>     just something to study and learn from.
>>
> If the focus is purely on OSGi/Equinox support, this sounds fine to me,
> with the resulting code/patterns/techniques eventually getting applied
> to trunk.  If it includes other restructuring or changes, I'd prefer to
> see this kind of thing done in trunk as far as possible so it's easier
> for the whole community to participate.
> 
>>     At the moment that Equinox port is still pretty broken, I've made
>>     changes to start to clean up the dependencies on
>>     assembly.builder.impl and contribution.service.impl for example, but
>>     there are many other similar cross-bundle dependencies on
>>     implementation packages which will take time to clean up.
>>
> When this is working, will it imply a hard dependency from Tuscany on
> Equinox, or will there still be a way to run Tuscany outside of the
> OSGI/Equinox environment?
> 
>   Simon
> 
>>     --     Jean-Sebastien
>>
>>
>> I guess what i'm still not understanding is why can't the most of this 
>> happen in trunk? For example - "clean up the dependencies on 
>> assembly.builder.impl and contribution.service.impl for example, but 
>> there are many other similar cross-bundle dependencies on 
>> implementation packages" - all of that is applicable to the trunk code 
>> and has no dependencies on the OSGi changes so why not just do it from 
>> the start in trunk?
>>
>>    ...ant

Here's how I'm approaching this work at the moment (although the 
approach may change as I make progress, resolve issues or run into new 
issues).

- Correctly running in OSGi requires significant restructuring and 
refactoring of the Tuscany runtime. It's not just about dependencies on 
OSGi APIs or changing how a few classes get loaded, it's also about 
making sure that cross-bundle calls go through defined and exported 
SPIs. We had well defined SPIs for a while but a lot of code has gone 
around the SPIs, instead of evolving the SPIs when needed and that has 
gone for about 18 months, so there's many examples of that. Now when you 
try to run this stuff in OSGi, it just breaks as OSGi is not going to 
allow you to go around the package visibility rules (and putting the 
whole runtime in a few big bundles that import/export everything is not 
really serious or interesting).

- That restructuring would probably break trunk for a few months while 
we work through ways to refactor it. So, I'm trying to contribute enough 
  of the refactoring and the code patterns that work well in OSGi in the 
sca-equinox branch now, to make it easier to do it in trunk when trunk 
is ready for it. I'm hoping that we'll then be able to do this work 
without breaking trunk too much and too long, since we'll have something 
to look at and reflect on in the branch. It's always much easier to do 
things a second time, when somebody has already been through the pain of 
exploring it for you and you can take a look at the result. That's what 
I'm trying to do now to help the project.

- You've already asked a similar question about 'a dependency from 
Tuscany on Equinox', I've looked up my earlier response for you as it 
has not changed: http://marc.info/?l=tuscany-dev&m=122274696224651

-- 
Jean-Sebastien

Re: Tuscany / Equinox-OSGi integration, was: Creating distros for OSGi-enabled Tuscany/SCA

Posted by Simon Nash <na...@apache.org>.
See inline.

   Simon

ant elder wrote:
> 
> 
> On Mon, Oct 6, 2008 at 9:02 AM, Jean-Sebastien Delfino 
> <jsdelfino@apache.org <ma...@apache.org>> wrote:
> 
>     ant elder wrote:
> 
 > (cut)
> 
>         So this branch is really a fork isn't it?
> 
>           ...ant
> 
> 
>     Is that a question or a statement? I don't really understand how you
>     come up to that conclusion.
> 
>     It's not a fork, it's a branch to work through breaking changes (and
>     pretty complex changes I must say) which should allow our runtime to
>     correctly work as a set of modular bundles in an Equinox/OSGi
>     environment.
> 
>     I'm hoping that this work can somehow benefit Tuscany, by providing
>     code, patterns or maybe just a set of techniques that the project
>     can implement to work in Equinox/OSGi. It'll be up to the Tuscany
>     community to take a look and decide what can be reused or if it's
>     just something to study and learn from.
> 
If the focus is purely on OSGi/Equinox support, this sounds fine to me,
with the resulting code/patterns/techniques eventually getting applied
to trunk.  If it includes other restructuring or changes, I'd prefer to
see this kind of thing done in trunk as far as possible so it's easier
for the whole community to participate.

>     At the moment that Equinox port is still pretty broken, I've made
>     changes to start to clean up the dependencies on
>     assembly.builder.impl and contribution.service.impl for example, but
>     there are many other similar cross-bundle dependencies on
>     implementation packages which will take time to clean up.
> 
When this is working, will it imply a hard dependency from Tuscany on
Equinox, or will there still be a way to run Tuscany outside of the
OSGI/Equinox environment?

   Simon

>     -- 
>     Jean-Sebastien
> 
> 
> I guess what i'm still not understanding is why can't the most of this 
> happen in trunk? For example - "clean up the dependencies on 
> assembly.builder.impl and contribution.service.impl for example, but 
> there are many other similar cross-bundle dependencies on implementation 
> packages" - all of that is applicable to the trunk code and has no 
> dependencies on the OSGi changes so why not just do it from the start in 
> trunk?
> 
>    ...ant



Re: Tuscany / Equinox-OSGi integration, was: Creating distros for OSGi-enabled Tuscany/SCA

Posted by ant elder <an...@gmail.com>.
On Mon, Oct 6, 2008 at 9:02 AM, Jean-Sebastien Delfino <jsdelfino@apache.org
> wrote:

> ant elder wrote:
>
>>
>>
>> On Wed, Oct 1, 2008 at 6:21 AM, Jean-Sebastien Delfino <
>> jsdelfino@apache.org <ma...@apache.org>> wrote:
>>
>>    ant elder wrote:
>>
>>
>>
>>        On Mon, Sep 29, 2008 at 5:01 PM, Jean-Sebastien Delfino
>>        <jsdelfino@apache.org <ma...@apache.org>
>>        <mailto:jsdelfino@apache.org <ma...@apache.org>>>
>> wrote:
>>
>>           ant elder wrote:
>>
>>
>>
>>               On Thu, Sep 11, 2008 at 5:37 PM, Jean-Sebastien Delfino
>>               <jsdelfino@apache.org <ma...@apache.org>
>>        <mailto:jsdelfino@apache.org <ma...@apache.org>>
>>               <mailto:jsdelfino@apache.org
>>        <ma...@apache.org> <mailto:jsdelfino@apache.org
>>        <ma...@apache.org>>>> wrote:
>>
>>               <snip>
>>
>>
>>                  I'll create a branch to make progress on this Equinox
>>        porting
>>               effort
>>                  without breaking everybody else. As I said before
>>        it'll probably
>>                  take a few weeks to get most Tuscany samples and
>>        itests up and
>>                  running, but I'd like to try to have a few core itests
>> and
>>               maybe a
>>                  Web Service or two working in the next few days.
>>
>>
>>
>>               Its been a few weeks now, what are the plans and time
>>        frames for
>>               merging this branch back into the mainstream trunk?
>>
>>                 ...ant
>>
>>
>>           Still making progress on the Equinox bringup, going slowly as
>> I'm
>>           busy at work. Getting the whole runtime really working end to
>>        end in
>>           Equinox is going to require changes in many different places
>>        in the
>>           code, so don't expect miracles it's going to take time. Some
>>        of the
>>           changes may be possible to merge to trunk already if people
>>        want to
>>           help with that.
>>
>>           --    Jean-Sebastien
>>
>>
>>        The problem with helping is that its difficult to work out what
>>        are the changes. I've done a diff of the sca-equinox branch to
>>        the trunk which is at:
>>        http://people.apache.org/~antelder/temp/sca-equinox.diff<http://people.apache.org/%7Eantelder/temp/sca-equinox.diff>
>>        <http://people.apache.org/%7Eantelder/temp/sca-equinox.diff>.
>>
>>        Its huge, and lots of the changes seem quite unrelated to OSGi
>>        class loading. Some changes from trunk get merged to the branch,
>>        some don't, others get modified and then merged, there's also
>>        what looks like new development not directly related to
>>        OSGi/Equinox that goes into the branch but not trunk. If this
>>        branch is to show what changes are needed for Equinox then
>>        wouldn't it be clearer if the only changes in the branch were
>>        directly related to Equinox? With the diff so huge now how can
>>        this ever get merged to trunk?
>>
>>          ...ant
>>
>>
>>    I've always had trouble too working off flat diffs like that.
>>    Merging / porting individual commits from the history should be
>>    easier. That's what I've been doing to pull some changes from trunk,
>>    and it's really easy once you've done it a few times and have
>>    defined your merge processes with the Svn, diff, patch tools etc. If
>>    you're interested in trying it, for more complicated cases (like
>>    when I started to create the android branch) I've also found Git
>>    very powerful at handling merges. Working off the history should
>>    also help you pick only the changes that are not going to break the
>>    trunk at this point, or pick them in a more convenient sequence for
>>    example.
>>
>>    If that helps I could try to document the steps that I've been
>>    following for various merge cases but I'm busy these days so it'll
>>    probably take some time before I get to it.
>>
>>    If people want to help, at the moment I'm seeing issues with many
>>    'dirty' cross module dependencies (tapping directly into impl
>>    classes instead of going through the SPI.
>>
>>    An example is dependencies on o.a.t.sca.contribution.impl, causing
>> this:
>>
>>    warning: Unresolved resource
>>    META-INF/services/org.apache.tuscany.sca.node.SCANodeFactory found
>>    in 15 org.apache.tuscany.sca.node.impl INSTALLED
>>    severe: SCA Node could not be created
>>    java.lang.reflect.InvocationTargetException
>>           at
>>    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>>           at
>>
>>  sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>>           at
>>
>>  sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>>           at
>>    java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>           at
>>
>>  org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node(NodeLauncherUtil.java:155)
>>           at
>>
>>  org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher.createNode(NodeLauncher.java:83)
>>           at
>>    calculator.CalculatorTestCase.setUp(CalculatorTestCase.java:44)
>>           at junit.framework.TestCase.runBare(TestCase.java:132)
>>           at junit.framework.TestResult$1.protect(TestResult.java:110)
>>           at junit.framework.TestResult.runProtected(TestResult.java:128)
>>           at junit.framework.TestResult.run(TestResult.java:113)
>>           at junit.framework.TestCase.run(TestCase.java:124)
>>           at junit.framework.TestSuite.runTest(TestSuite.java:232)
>>           at junit.framework.TestSuite.run(TestSuite.java:227)
>>           at
>>
>>  org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
>>           at
>>
>>  org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>>           at
>>
>>  org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
>>           at
>>
>>  org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
>>           at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>>           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>           at
>>
>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>           at
>>
>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>           at java.lang.reflect.Method.invoke(Method.java:597)
>>           at
>>
>>  org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:308)
>>           at
>>
>>  org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:879)
>>    Caused by: org.osoa.sca.ServiceRuntimeException:
>>    java.lang.reflect.InvocationTargetException
>>           at
>>
>>  org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:146)
>>           at
>>
>>  org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationLauncherBootstrap.<init>(NodeImplementationLauncherBootstrap.java:116)
>>           ... 25 more
>>    Caused by: java.lang.reflect.InvocationTargetException
>>           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>           at
>>
>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>           at
>>
>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>           at java.lang.reflect.Method.invoke(Method.java:597)
>>           at
>>
>>  org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:128)
>>           ... 26 more
>>    Caused by: java.lang.IllegalStateException:
>>    org.osgi.framework.BundleException: The bundle could not be
>>    resolved. Reason: Missing Constraint: Import-Package:
>>    org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
>>           at
>>
>>  org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:227)
>>           at
>>
>>  org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getFirstServiceDeclaration(EquinoxServiceDiscoverer.java:191)
>>           at
>>
>>  org.apache.tuscany.sca.extensibility.ServiceDiscovery.getFirstServiceDeclaration(ServiceDiscovery.java:83)
>>           ... 31 more
>>    Caused by: org.osgi.framework.BundleException: The bundle could not
>>    be resolved. Reason: Missing Constraint: Import-Package:
>>    org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
>>           at
>>
>>  org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:305)
>>           at
>>
>>  org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
>>           at
>>
>>  org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:252)
>>           at
>>
>>  org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:225)
>>           ... 33 more
>>    Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:
>>    4.213 sec <<< FAILURE!
>>    testDummy(calculator.CalculatorTestCase)  Time elapsed: 4.153 sec
>>     <<< ERROR!
>>    org.apache.tuscany.sca.node.equinox.launcher.LauncherException:
>>    java.lang.reflect.InvocationTargetException
>>           at
>>
>>  org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node(NodeLauncherUtil.java:174)
>>           at
>>
>>  org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher.createNode(NodeLauncher.java:83)
>>           at
>>    calculator.CalculatorTestCase.setUp(CalculatorTestCase.java:44)
>>           at junit.framework.TestCase.runBare(TestCase.java:132)
>>           at junit.framework.TestResult$1.protect(TestResult.java:110)
>>           at junit.framework.TestResult.runProtected(TestResult.java:128)
>>           at junit.framework.TestResult.run(TestResult.java:113)
>>           at junit.framework.TestCase.run(TestCase.java:124)
>>           at junit.framework.TestSuite.runTest(TestSuite.java:232)
>>           at junit.framework.TestSuite.run(TestSuite.java:227)
>>           at
>>
>>  org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
>>           at
>>
>>  org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>>           at
>>
>>  org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
>>           at
>>
>>  org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
>>           at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>>           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>           at
>>
>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>           at
>>
>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>           at java.lang.reflect.Method.invoke(Method.java:597)
>>           at
>>
>>  org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:308)
>>           at
>>
>>  org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:879)
>>    Caused by: java.lang.reflect.InvocationTargetException
>>           at
>>    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>>           at
>>
>>  sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>>           at
>>
>>  sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>>           at
>>    java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>           at
>>
>>  org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node(NodeLauncherUtil.java:155)
>>           ... 20 more
>>    Caused by: org.osoa.sca.ServiceRuntimeException:
>>    java.lang.reflect.InvocationTargetException
>>           at
>>
>>  org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:146)
>>           at
>>
>>  org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationLauncherBootstrap.<init>(NodeImplementationLauncherBootstrap.java:116)
>>           ... 25 more
>>    Caused by: java.lang.reflect.InvocationTargetException
>>           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>           at
>>
>>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>           at
>>
>>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>           at java.lang.reflect.Method.invoke(Method.java:597)
>>           at
>>
>>  org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:128)
>>           ... 26 more
>>    Caused by: java.lang.IllegalStateException:
>>    org.osgi.framework.BundleException: The bundle could not be
>>    resolved. Reason: Missing Constraint: Import-Package:
>>    org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
>>           at
>>
>>  org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:227)
>>           at
>>
>>  org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getFirstServiceDeclaration(EquinoxServiceDiscoverer.java:191)
>>           at
>>
>>  org.apache.tuscany.sca.extensibility.ServiceDiscovery.getFirstServiceDeclaration(ServiceDiscovery.java:83)
>>           ... 31 more
>>    Caused by: org.osgi.framework.BundleException: The bundle could not
>>    be resolved. Reason: Missing Constraint: Import-Package:
>>    org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
>>           at
>>
>>  org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:305)
>>           at
>>
>>  org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
>>           at
>>
>>  org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:252)
>>           at
>>
>>  org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:225)
>>           ... 33 more
>>
>>
>>    I'm starting to fix node-impl to only reference SPIs but I've not
>>    been able to find what's causing the above exception, given that the
>>    unresolved contribution.impl package is exported+imported right now
>>    (as a workaround, but the workaround doesn't seem to work).
>>
>>    So if anybody has ideas about that exception, please let me know...
>>
>>    Thanks
>>    --    Jean-Sebastien
>>
>>
>>
>> So this branch is really a fork isn't it?
>>
>>   ...ant
>>
>>
> Is that a question or a statement? I don't really understand how you come
> up to that conclusion.
>
> It's not a fork, it's a branch to work through breaking changes (and pretty
> complex changes I must say) which should allow our runtime to correctly work
> as a set of modular bundles in an Equinox/OSGi environment.
>
> I'm hoping that this work can somehow benefit Tuscany, by providing code,
> patterns or maybe just a set of techniques that the project can implement to
> work in Equinox/OSGi. It'll be up to the Tuscany community to take a look
> and decide what can be reused or if it's just something to study and learn
> from.
>
> At the moment that Equinox port is still pretty broken, I've made changes
> to start to clean up the dependencies on assembly.builder.impl and
> contribution.service.impl for example, but there are many other similar
> cross-bundle dependencies on implementation packages which will take time to
> clean up.
>
> --
> Jean-Sebastien
>

I guess what i'm still not understanding is why can't the most of this
happen in trunk? For example - "clean up the dependencies on
assembly.builder.impl and contribution.service.impl for example, but there
are many other similar cross-bundle dependencies on implementation packages"
- all of that is applicable to the trunk code and has no dependencies on the
OSGi changes so why not just do it from the start in trunk?

   ...ant

Re: Tuscany / Equinox-OSGi integration, was: Creating distros for OSGi-enabled Tuscany/SCA

Posted by Jean-Sebastien Delfino <js...@apache.org>.
ant elder wrote:
> 
> 
> On Wed, Oct 1, 2008 at 6:21 AM, Jean-Sebastien Delfino 
> <jsdelfino@apache.org <ma...@apache.org>> wrote:
> 
>     ant elder wrote:
> 
> 
> 
>         On Mon, Sep 29, 2008 at 5:01 PM, Jean-Sebastien Delfino
>         <jsdelfino@apache.org <ma...@apache.org>
>         <mailto:jsdelfino@apache.org <ma...@apache.org>>> wrote:
> 
>            ant elder wrote:
> 
> 
> 
>                On Thu, Sep 11, 2008 at 5:37 PM, Jean-Sebastien Delfino
>                <jsdelfino@apache.org <ma...@apache.org>
>         <mailto:jsdelfino@apache.org <ma...@apache.org>>
>                <mailto:jsdelfino@apache.org
>         <ma...@apache.org> <mailto:jsdelfino@apache.org
>         <ma...@apache.org>>>> wrote:
> 
>                <snip>
> 
> 
>                   I'll create a branch to make progress on this Equinox
>         porting
>                effort
>                   without breaking everybody else. As I said before
>         it'll probably
>                   take a few weeks to get most Tuscany samples and
>         itests up and
>                   running, but I'd like to try to have a few core itests and
>                maybe a
>                   Web Service or two working in the next few days.
> 
> 
> 
>                Its been a few weeks now, what are the plans and time
>         frames for
>                merging this branch back into the mainstream trunk?
> 
>                  ...ant
> 
> 
>            Still making progress on the Equinox bringup, going slowly as I'm
>            busy at work. Getting the whole runtime really working end to
>         end in
>            Equinox is going to require changes in many different places
>         in the
>            code, so don't expect miracles it's going to take time. Some
>         of the
>            changes may be possible to merge to trunk already if people
>         want to
>            help with that.
> 
>            --    Jean-Sebastien
> 
> 
>         The problem with helping is that its difficult to work out what
>         are the changes. I've done a diff of the sca-equinox branch to
>         the trunk which is at:
>         http://people.apache.org/~antelder/temp/sca-equinox.diff
>         <http://people.apache.org/%7Eantelder/temp/sca-equinox.diff>.
>         Its huge, and lots of the changes seem quite unrelated to OSGi
>         class loading. Some changes from trunk get merged to the branch,
>         some don't, others get modified and then merged, there's also
>         what looks like new development not directly related to
>         OSGi/Equinox that goes into the branch but not trunk. If this
>         branch is to show what changes are needed for Equinox then
>         wouldn't it be clearer if the only changes in the branch were
>         directly related to Equinox? With the diff so huge now how can
>         this ever get merged to trunk?
> 
>           ...ant
> 
> 
>     I've always had trouble too working off flat diffs like that.
>     Merging / porting individual commits from the history should be
>     easier. That's what I've been doing to pull some changes from trunk,
>     and it's really easy once you've done it a few times and have
>     defined your merge processes with the Svn, diff, patch tools etc. If
>     you're interested in trying it, for more complicated cases (like
>     when I started to create the android branch) I've also found Git
>     very powerful at handling merges. Working off the history should
>     also help you pick only the changes that are not going to break the
>     trunk at this point, or pick them in a more convenient sequence for
>     example.
> 
>     If that helps I could try to document the steps that I've been
>     following for various merge cases but I'm busy these days so it'll
>     probably take some time before I get to it.
> 
>     If people want to help, at the moment I'm seeing issues with many
>     'dirty' cross module dependencies (tapping directly into impl
>     classes instead of going through the SPI.
> 
>     An example is dependencies on o.a.t.sca.contribution.impl, causing this:
> 
>     warning: Unresolved resource
>     META-INF/services/org.apache.tuscany.sca.node.SCANodeFactory found
>     in 15 org.apache.tuscany.sca.node.impl INSTALLED
>     severe: SCA Node could not be created
>     java.lang.reflect.InvocationTargetException
>            at
>     sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>            at
>     sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>            at
>     sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>            at
>     java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>            at
>     org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node(NodeLauncherUtil.java:155)
>            at
>     org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher.createNode(NodeLauncher.java:83)
>            at
>     calculator.CalculatorTestCase.setUp(CalculatorTestCase.java:44)
>            at junit.framework.TestCase.runBare(TestCase.java:132)
>            at junit.framework.TestResult$1.protect(TestResult.java:110)
>            at junit.framework.TestResult.runProtected(TestResult.java:128)
>            at junit.framework.TestResult.run(TestResult.java:113)
>            at junit.framework.TestCase.run(TestCase.java:124)
>            at junit.framework.TestSuite.runTest(TestSuite.java:232)
>            at junit.framework.TestSuite.run(TestSuite.java:227)
>            at
>     org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
>            at
>     org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>            at
>     org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
>            at
>     org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
>            at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>            at
>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>            at
>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>            at java.lang.reflect.Method.invoke(Method.java:597)
>            at
>     org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:308)
>            at
>     org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:879)
>     Caused by: org.osoa.sca.ServiceRuntimeException:
>     java.lang.reflect.InvocationTargetException
>            at
>     org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:146)
>            at
>     org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationLauncherBootstrap.<init>(NodeImplementationLauncherBootstrap.java:116)
>            ... 25 more
>     Caused by: java.lang.reflect.InvocationTargetException
>            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>            at
>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>            at
>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>            at java.lang.reflect.Method.invoke(Method.java:597)
>            at
>     org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:128)
>            ... 26 more
>     Caused by: java.lang.IllegalStateException:
>     org.osgi.framework.BundleException: The bundle could not be
>     resolved. Reason: Missing Constraint: Import-Package:
>     org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
>            at
>     org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:227)
>            at
>     org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getFirstServiceDeclaration(EquinoxServiceDiscoverer.java:191)
>            at
>     org.apache.tuscany.sca.extensibility.ServiceDiscovery.getFirstServiceDeclaration(ServiceDiscovery.java:83)
>            ... 31 more
>     Caused by: org.osgi.framework.BundleException: The bundle could not
>     be resolved. Reason: Missing Constraint: Import-Package:
>     org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
>            at
>     org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:305)
>            at
>     org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
>            at
>     org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:252)
>            at
>     org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:225)
>            ... 33 more
>     Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:
>     4.213 sec <<< FAILURE!
>     testDummy(calculator.CalculatorTestCase)  Time elapsed: 4.153 sec
>      <<< ERROR!
>     org.apache.tuscany.sca.node.equinox.launcher.LauncherException:
>     java.lang.reflect.InvocationTargetException
>            at
>     org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node(NodeLauncherUtil.java:174)
>            at
>     org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher.createNode(NodeLauncher.java:83)
>            at
>     calculator.CalculatorTestCase.setUp(CalculatorTestCase.java:44)
>            at junit.framework.TestCase.runBare(TestCase.java:132)
>            at junit.framework.TestResult$1.protect(TestResult.java:110)
>            at junit.framework.TestResult.runProtected(TestResult.java:128)
>            at junit.framework.TestResult.run(TestResult.java:113)
>            at junit.framework.TestCase.run(TestCase.java:124)
>            at junit.framework.TestSuite.runTest(TestSuite.java:232)
>            at junit.framework.TestSuite.run(TestSuite.java:227)
>            at
>     org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
>            at
>     org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>            at
>     org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
>            at
>     org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
>            at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>            at
>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>            at
>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>            at java.lang.reflect.Method.invoke(Method.java:597)
>            at
>     org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:308)
>            at
>     org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:879)
>     Caused by: java.lang.reflect.InvocationTargetException
>            at
>     sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>            at
>     sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>            at
>     sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>            at
>     java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>            at
>     org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node(NodeLauncherUtil.java:155)
>            ... 20 more
>     Caused by: org.osoa.sca.ServiceRuntimeException:
>     java.lang.reflect.InvocationTargetException
>            at
>     org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:146)
>            at
>     org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationLauncherBootstrap.<init>(NodeImplementationLauncherBootstrap.java:116)
>            ... 25 more
>     Caused by: java.lang.reflect.InvocationTargetException
>            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>            at
>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>            at
>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>            at java.lang.reflect.Method.invoke(Method.java:597)
>            at
>     org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:128)
>            ... 26 more
>     Caused by: java.lang.IllegalStateException:
>     org.osgi.framework.BundleException: The bundle could not be
>     resolved. Reason: Missing Constraint: Import-Package:
>     org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
>            at
>     org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:227)
>            at
>     org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getFirstServiceDeclaration(EquinoxServiceDiscoverer.java:191)
>            at
>     org.apache.tuscany.sca.extensibility.ServiceDiscovery.getFirstServiceDeclaration(ServiceDiscovery.java:83)
>            ... 31 more
>     Caused by: org.osgi.framework.BundleException: The bundle could not
>     be resolved. Reason: Missing Constraint: Import-Package:
>     org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
>            at
>     org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:305)
>            at
>     org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
>            at
>     org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:252)
>            at
>     org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:225)
>            ... 33 more
> 
> 
>     I'm starting to fix node-impl to only reference SPIs but I've not
>     been able to find what's causing the above exception, given that the
>     unresolved contribution.impl package is exported+imported right now
>     (as a workaround, but the workaround doesn't seem to work).
> 
>     So if anybody has ideas about that exception, please let me know...
> 
>     Thanks
>     -- 
>     Jean-Sebastien
> 
> 
> 
> So this branch is really a fork isn't it?
> 
>    ...ant
> 

Is that a question or a statement? I don't really understand how you 
come up to that conclusion.

It's not a fork, it's a branch to work through breaking changes (and 
pretty complex changes I must say) which should allow our runtime to 
correctly work as a set of modular bundles in an Equinox/OSGi environment.

I'm hoping that this work can somehow benefit Tuscany, by providing 
code, patterns or maybe just a set of techniques that the project can 
implement to work in Equinox/OSGi. It'll be up to the Tuscany community 
to take a look and decide what can be reused or if it's just something 
to study and learn from.

At the moment that Equinox port is still pretty broken, I've made 
changes to start to clean up the dependencies on assembly.builder.impl 
and contribution.service.impl for example, but there are many other 
similar cross-bundle dependencies on implementation packages which will 
take time to clean up.

-- 
Jean-Sebastien

Re: Tuscany / Equinox-OSGi integration, was: Creating distros for OSGi-enabled Tuscany/SCA

Posted by ant elder <an...@gmail.com>.
On Wed, Oct 1, 2008 at 6:21 AM, Jean-Sebastien Delfino <jsdelfino@apache.org
> wrote:

> ant elder wrote:
>
>>
>>
>> On Mon, Sep 29, 2008 at 5:01 PM, Jean-Sebastien Delfino <
>> jsdelfino@apache.org <ma...@apache.org>> wrote:
>>
>>    ant elder wrote:
>>
>>
>>
>>        On Thu, Sep 11, 2008 at 5:37 PM, Jean-Sebastien Delfino
>>        <jsdelfino@apache.org <ma...@apache.org>
>>        <mailto:jsdelfino@apache.org <ma...@apache.org>>>
>> wrote:
>>
>>        <snip>
>>
>>
>>           I'll create a branch to make progress on this Equinox porting
>>        effort
>>           without breaking everybody else. As I said before it'll probably
>>           take a few weeks to get most Tuscany samples and itests up and
>>           running, but I'd like to try to have a few core itests and
>>        maybe a
>>           Web Service or two working in the next few days.
>>
>>
>>
>>        Its been a few weeks now, what are the plans and time frames for
>>        merging this branch back into the mainstream trunk?
>>
>>          ...ant
>>
>>
>>    Still making progress on the Equinox bringup, going slowly as I'm
>>    busy at work. Getting the whole runtime really working end to end in
>>    Equinox is going to require changes in many different places in the
>>    code, so don't expect miracles it's going to take time. Some of the
>>    changes may be possible to merge to trunk already if people want to
>>    help with that.
>>
>>    --    Jean-Sebastien
>>
>>
>> The problem with helping is that its difficult to work out what are the
>> changes. I've done a diff of the sca-equinox branch to the trunk which is
>> at: http://people.apache.org/~antelder/temp/sca-equinox.diff<http://people.apache.org/%7Eantelder/temp/sca-equinox.diff>.
>> Its huge, and lots of the changes seem quite unrelated to OSGi class
>> loading. Some changes from trunk get merged to the branch, some don't,
>> others get modified and then merged, there's also what looks like new
>> development not directly related to OSGi/Equinox that goes into the branch
>> but not trunk. If this branch is to show what changes are needed for Equinox
>> then wouldn't it be clearer if the only changes in the branch were directly
>> related to Equinox? With the diff so huge now how can this ever get merged
>> to trunk?
>>
>>   ...ant
>>
>>
> I've always had trouble too working off flat diffs like that. Merging /
> porting individual commits from the history should be easier. That's what
> I've been doing to pull some changes from trunk, and it's really easy once
> you've done it a few times and have defined your merge processes with the
> Svn, diff, patch tools etc. If you're interested in trying it, for more
> complicated cases (like when I started to create the android branch) I've
> also found Git very powerful at handling merges. Working off the history
> should also help you pick only the changes that are not going to break the
> trunk at this point, or pick them in a more convenient sequence for example.
>
> If that helps I could try to document the steps that I've been following
> for various merge cases but I'm busy these days so it'll probably take some
> time before I get to it.
>
> If people want to help, at the moment I'm seeing issues with many 'dirty'
> cross module dependencies (tapping directly into impl classes instead of
> going through the SPI.
>
> An example is dependencies on o.a.t.sca.contribution.impl, causing this:
>
> warning: Unresolved resource
> META-INF/services/org.apache.tuscany.sca.node.SCANodeFactory found in 15
> org.apache.tuscany.sca.node.impl INSTALLED
> severe: SCA Node could not be created
> java.lang.reflect.InvocationTargetException
>        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>        at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>        at
> org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node(NodeLauncherUtil.java:155)
>        at
> org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher.createNode(NodeLauncher.java:83)
>        at calculator.CalculatorTestCase.setUp(CalculatorTestCase.java:44)
>        at junit.framework.TestCase.runBare(TestCase.java:132)
>        at junit.framework.TestResult$1.protect(TestResult.java:110)
>        at junit.framework.TestResult.runProtected(TestResult.java:128)
>        at junit.framework.TestResult.run(TestResult.java:113)
>        at junit.framework.TestCase.run(TestCase.java:124)
>        at junit.framework.TestSuite.runTest(TestSuite.java:232)
>        at junit.framework.TestSuite.run(TestSuite.java:227)
>        at
> org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
>        at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>        at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
>        at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
>        at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:308)
>        at
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:879)
> Caused by: org.osoa.sca.ServiceRuntimeException:
> java.lang.reflect.InvocationTargetException
>        at
> org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:146)
>        at
> org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationLauncherBootstrap.<init>(NodeImplementationLauncherBootstrap.java:116)
>        ... 25 more
> Caused by: java.lang.reflect.InvocationTargetException
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at
> org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:128)
>        ... 26 more
> Caused by: java.lang.IllegalStateException:
> org.osgi.framework.BundleException: The bundle could not be resolved.
> Reason: Missing Constraint: Import-Package:
> org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
>        at
> org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:227)
>        at
> org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getFirstServiceDeclaration(EquinoxServiceDiscoverer.java:191)
>        at
> org.apache.tuscany.sca.extensibility.ServiceDiscovery.getFirstServiceDeclaration(ServiceDiscovery.java:83)
>        ... 31 more
> Caused by: org.osgi.framework.BundleException: The bundle could not be
> resolved. Reason: Missing Constraint: Import-Package:
> org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
>        at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:305)
>        at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
>        at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:252)
>        at
> org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:225)
>        ... 33 more
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.213 sec
> <<< FAILURE!
> testDummy(calculator.CalculatorTestCase)  Time elapsed: 4.153 sec  <<<
> ERROR!
> org.apache.tuscany.sca.node.equinox.launcher.LauncherException:
> java.lang.reflect.InvocationTargetException
>        at
> org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node(NodeLauncherUtil.java:174)
>        at
> org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher.createNode(NodeLauncher.java:83)
>        at calculator.CalculatorTestCase.setUp(CalculatorTestCase.java:44)
>        at junit.framework.TestCase.runBare(TestCase.java:132)
>        at junit.framework.TestResult$1.protect(TestResult.java:110)
>        at junit.framework.TestResult.runProtected(TestResult.java:128)
>        at junit.framework.TestResult.run(TestResult.java:113)
>        at junit.framework.TestCase.run(TestCase.java:124)
>        at junit.framework.TestSuite.runTest(TestSuite.java:232)
>        at junit.framework.TestSuite.run(TestSuite.java:227)
>        at
> org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
>        at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>        at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
>        at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
>        at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:308)
>        at
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:879)
> Caused by: java.lang.reflect.InvocationTargetException
>        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>        at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>        at
> org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node(NodeLauncherUtil.java:155)
>        ... 20 more
> Caused by: org.osoa.sca.ServiceRuntimeException:
> java.lang.reflect.InvocationTargetException
>        at
> org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:146)
>        at
> org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationLauncherBootstrap.<init>(NodeImplementationLauncherBootstrap.java:116)
>        ... 25 more
> Caused by: java.lang.reflect.InvocationTargetException
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at
> org.apache.tuscany.sca.node.SCANodeFactory.newInstance(SCANodeFactory.java:128)
>        ... 26 more
> Caused by: java.lang.IllegalStateException:
> org.osgi.framework.BundleException: The bundle could not be resolved.
> Reason: Missing Constraint: Import-Package:
> org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
>        at
> org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:227)
>        at
> org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getFirstServiceDeclaration(EquinoxServiceDiscoverer.java:191)
>        at
> org.apache.tuscany.sca.extensibility.ServiceDiscovery.getFirstServiceDeclaration(ServiceDiscovery.java:83)
>        ... 31 more
> Caused by: org.osgi.framework.BundleException: The bundle could not be
> resolved. Reason: Missing Constraint: Import-Package:
> org.apache.tuscany.sca.contribution.service.impl; version="1.4.0"
>        at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:305)
>        at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
>        at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:252)
>        at
> org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoverer.getServiceDeclarations(EquinoxServiceDiscoverer.java:225)
>        ... 33 more
>
>
> I'm starting to fix node-impl to only reference SPIs but I've not been able
> to find what's causing the above exception, given that the unresolved
> contribution.impl package is exported+imported right now (as a workaround,
> but the workaround doesn't seem to work).
>
> So if anybody has ideas about that exception, please let me know...
>
> Thanks
> --
> Jean-Sebastien
>


So this branch is really a fork isn't it?

   ...ant