[ 
https://issues.apache.org/jira/browse/TUSCANY-2086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579432#action_12579432
 ] 

Jürgen Schumacher commented on TUSCANY-2086:
--------------------------------------------

Yes, something has changed, but its not much better (-;
I get the same error with a different filename for the component file (using my 
own all-in-one-tuscany bundle, i did not test the itest/osgi-tuscany bundles 
yet):

org.apache.tuscany.sca.contribution.service.ContributionResolveException: 
org.apache.tuscany.sca.contribution.service.ContributionResolveException: 
missing .componentType side file tuscany/osgi.componentType
        at 
org.apache.tuscany.sca.implementation.osgi.xml.OSGiImplementationProcessor.resolve(OSGiImplementationProcessor.java:276)
        at 
org.apache.tuscany.sca.implementation.osgi.xml.OSGiImplementationProcessor.resolve(OSGiImplementationProcessor.java:74)
        at 
org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint$LazyStAXArtifactProcessor.resolve(DefaultStAXArtifactProcessorExtensionPoint.java:252)
        at 
org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.resolve(ExtensibleStAXArtifactProcessor.java:109)
        at 
org.apache.tuscany.sca.assembly.xml.BaseAssemblyProcessor.resolveImplementation(BaseAssemblyProcessor.java:248)
        at 
org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(CompositeProcessor.java:876)
        at 
org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(CompositeProcessor.java:80)
        at 
org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.resolve(ExtensibleStAXArtifactProcessor.java:109)
        at 
org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolve(CompositeDocumentProcessor.java:129)
        at 
org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolve(CompositeDocumentProcessor.java:52)
        at 
org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.resolve(ExtensibleURLArtifactProcessor.java:86)
        at 
org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processResolvePhase(ContributionServiceImpl.java:464)
        at 
org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution(ContributionServiceImpl.java:348)
        at 
org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute(ContributionServiceImpl.java:161)
        at 
launch.DomainActivator.initDomainByContribution(DomainActivator.java:76)
        at launch.DomainActivator.start(DomainActivator.java:31)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:999)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:993)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:974)
        at 
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
        at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:350)
        at 
org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1118)
        at 
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:634)
        at 
org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:508)
        at 
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:282)
        at 
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:468)
        at 
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:195)
        at 
org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:297)
Caused by: 
org.apache.tuscany.sca.contribution.service.ContributionResolveException: 
missing .componentType side file tuscany/osgi.componentType
        at 
org.apache.tuscany.sca.implementation.osgi.xml.OSGiImplementationProcessor.resolve(OSGiImplementationProcessor.java:227)
        ... 28 more

While I do not really like the generated name, this problem is currently 
secondary to me - the name of my bundle is not nice, too, but I think even with 
a good bundle name the generated component type file name would not be  nice. 
Anyway, I debugged what happened and tried to put my component type file to 
where it was looked for:
- org.apache.tuscany.sca.assembly.xml.ComponentTypeModelResolver searched in my 
contribution for an imported package "tuscany", so I created one, imported it 
explicitly, added it to the export-package of the bundle etc. 
- then the resolving continues in 
org.apache.tuscany.sca.contribution.resolver.DefaultImportAllModelResolver, but 
there are not contributions known in this resolver where it could look in.

But there is a big FIXME comment in ComponentTypeModelResolver.resolve which 
seems to indicate that this may be not the way it should work? So I'm a bit 
lost now. If you could explain what should really happen, maybe I can 
investigate why it does not.

I'll attach my test projects so you can have a look if I'm doing something 
wrong anywhere: tuscany.osgi.sample contains the component implementations, 
service interfaces and the bundle activate registeres one OSGi service. 
tuscany.osgi.sample.launch contains the contribution jar and the bundle 
activator starts a domain using the contribution and does some client 
simulation. The code works when using only implementation.java in the composite 
file, so it should be basically OK. I tried to switch to implementation.osgi 
for one component The jardesc file can be used to create to create the 
contribution jar after updates of the contained files (in src of the the 
.launch project). Thanks for your patience (-;


> implementation.osgi cannot find compomentType file when referring to bundles 
> in Eclipse Workspace
> -------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-2086
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2086
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA OSGi Integration
>         Environment: Windows XP, Eclipse 3.3.2 (org.eclipse.osgi 3.3.2)
>            Reporter: Jürgen Schumacher
>            Assignee: Rajini Sivaram
>             Fix For: Java-SCA-1.2
>
>         Attachments: tuscany-equinox-runtime.patch, tuscany.osgi.sample.zip
>
>
> This issue refers to activities described in 
> http://mail-archives.apache.org/mod_mbox/ws-tuscany-user/200803.mbox/[EMAIL 
> PROTECTED]
> When trying to test <implementation.osgi> I ended with this error message:
> org.apache.tuscany.sca.contribution.service.ContributionResolveException: 
> org.apache.tuscany.sca.contribution.service.ContributionResolveException: 
> missing .componentType side file .componentType
>       at 
> org.apache.tuscany.sca.implementation.osgi.xml.OSGiImplementationProcessor.resolve(OSGiImplementationProcessor.java:276)
> ...
> caused by
> Caused by: 
> org.apache.tuscany.sca.contribution.service.ContributionResolveException: 
> missing .componentType side file .componentType
>       at 
> org.apache.tuscany.sca.implementation.osgi.xml.OSGiImplementationProcessor.resolve(OSGiImplementationProcessor.java:227)
> ...
> While Tuscany is right in that I did not provide a componentType file, it 
> seems to be wrong in  how it has created the filename.
> I debugged a bit and found the following: 
> org.apache.tuscany.sca.contribution.osgi.impl.OSGiBundleReferenceModelResolver
>  has a method getBundleFilename(...) that tries to extract the bundles 
> filename from its location by looking for the last "/" in the location and 
> using the rest afterwards. But when the bundle is located in my Eclipse 
> workspace as a Plugin project under development and not packed as a JAR and I 
> run my examples in a Equinox runtime, the reported location is e.g.
> "[EMAIL PROTECTED]:file:../workspace/EILF/tuscany.osgi.sample/" where 
> tuscany.osgi.sample is the actual bundle name.
> Therefore getBundleFilename returns just an empty string. And this empty 
> string is used later in 
> org.apache.tuscany.sca.implementation.osgi.xml.OSGiImplementationProcessor.resolve(...)
>  to build the filename for the component type file, which results in 
> ".componentType" as the complete filename in this case. 
> I suppose the current code is meant to look for the componentType file next 
> to a bundle JAR with the same basename as the bundle JAR. I'm not sure where 
> it should look for it in my case, probably inside the workspace bundle 
> directory, as the workspace directory itself is usually not visible in 
> Eclipse and so it would be inconvenient to edit the file in the IDE. 
> Sorry that I cannot provide a test case currently because had to create own 
> Tuscany bundles to get this far (see mail thread linked above for details), 
> which would be a bit large to attach, I suppose (-; Also I cannot provide a 
> patch yet, because I'm quite new to OSGi and Tuscany myself and therefore 
> cannot estimate what would be a valid solution currently. Of course if you 
> have any ideas how to solve this, I can test it in my setup and give more 
> feedback.
> Thanks in advance.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to