hello Rajini,

thank you for the answer!

As you assumed, i start tuscany outside of a osgi-container. I would
like tuscany to use the shipped felix.

Specifing a version in the Import-Packe didn't help. But taking a closer
look at the failure-output, i saw a line, which maybe points to the
source of my problem:

DEBUG: PackagePermission.EXPORT denied for org.osgi.frameworkfrom 0

The full failure-output is:

Using default configuration properties.
DEBUG: PackagePermission.EXPORT denied for org.osgi.frameworkfrom 0
DEBUG: PackagePermission.EXPORT denied for org.osgi.frameworkfrom 0
DEBUG: PackagePermission.EXPORT denied for org.osgi.frameworkfrom 0
DEBUG: PackagePermission.EXPORT denied for org.osgi.frameworkfrom 0
DEBUG: PackagePermission.EXPORT denied for org.osgi.frameworkfrom 0
DEBUG: PackagePermission.EXPORT denied for org.osgi.frameworkfrom 0
DEBUG: PackagePermission.EXPORT denied for org.osgi.frameworkfrom 0
DEBUG: PackagePermission.EXPORT denied for org.osgi.frameworkfrom 0
DEBUG: PackagePermission.EXPORT denied for org.osgi.frameworkfrom 0
DEBUG: PackagePermission.EXPORT denied for org.osgi.frameworkfrom 0
org.apache.tuscany.sca.core.factory.ObjectCreationException: org.
osgi.framework.BundleException: Unresolved package in bundle 1: package;
(&(package=org.osgi.framework)(version>=1.3.0))
        at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.
java:194)
        at org.apache.tools.ant.taskdefs.Java.run(Java.java:747)
        at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:201)
        at org.apache.tools.ant.taskdefs.Java.execute(Java.java:104)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        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:585)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.
java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.
java:41)
        at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.
executeTargets(EclipseDefaultExecutor.java:32)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at 
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.
java:423)
        at 
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.
java:137)
Caused by: org.apache.tuscany.sca.core.factory.ObjectCreationException:
org.osgi.framework.BundleException: Unresolved package in bundle 
1: package; (&(package=org.osgi.framework)(version>=1.3.0))
        at 
org.apache.tuscany.sca.implementation.osgi.invocation.OSGiImplementationProvider.
startBundle(OSGiImplementationProvider.java:374)
        at 
org.apache.tuscany.sca.implementation.osgi.invocation.OSGiImplementationProvider.
getScopeContainer(OSGiImplementationProvider.java:1023)
        at 
org.apache.tuscany.sca.implementation.osgi.invocation.OSGiTargetInvoker.
invokeTarget(OSGiTargetInvoker.java:93)
        at 
org.apache.tuscany.sca.implementation.osgi.invocation.OSGiTargetInvoker.
invoke(OSGiTargetInvoker.java:188)
        at 
org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.
java:61)
        at 
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.
java:286)
        at 
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.
java:154)
        at $Proxy0.getMessage(Unknown Source)
        at eumel.tuscany.sca.osgi.motd.launcher.Main.main(Unknown Source)
        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:585)
        at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
        at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.
java:152)
        ... 19 more
Caused by: org.osgi.framework.BundleException: Unresolved package 
in bundle 1: package; (&(package=org.osgi.framework)(version>=1.3.
0))
        at org.apache.felix.framework.Felix._resolveBundle(Felix.java:1699)
        at org.apache.felix.framework.Felix._startBundle(Felix.java:1566)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1519)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:354)
        at 
org.apache.tuscany.sca.implementation.osgi.invocation.OSGiImplementationProvider.
startBundle(OSGiImplementationProvider.java:360)
        ... 33 more
--- Nested Exception ---
org.apache.tuscany.sca.core.factory.ObjectCreationException: org.
osgi.framework.BundleException: Unresolved package in bundle 1: package;
(&(package=org.osgi.framework)(version>=1.3.0))
        at 
org.apache.tuscany.sca.implementation.osgi.invocation.OSGiImplementationProvider.
startBundle(OSGiImplementationProvider.java:374)
        at 
org.apache.tuscany.sca.implementation.osgi.invocation.OSGiImplementationProvider.
getScopeContainer(OSGiImplementationProvider.java:1023)
        at 
org.apache.tuscany.sca.implementation.osgi.invocation.OSGiTargetInvoker.
invokeTarget(OSGiTargetInvoker.java:93)
        at 
org.apache.tuscany.sca.implementation.osgi.invocation.OSGiTargetInvoker.
invoke(OSGiTargetInvoker.java:188)
        at 
org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.
java:61)
        at 
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.
java:286)
        at 
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.
java:154)
        at $Proxy0.getMessage(Unknown Source)
        at eumel.tuscany.sca.osgi.motd.launcher.Main.main(Unknown Source)
        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:585)
        at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
        at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.
java:152)
        at org.apache.tools.ant.taskdefs.Java.run(Java.java:747)
        at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:201)
        at org.apache.tools.ant.taskdefs.Java.execute(Java.java:104)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        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:585)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.
java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.
java:41)
        at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.
executeTargets(EclipseDefaultExecutor.java:32)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at 
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.
java:423)
        at 
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.
java:137)
Caused by: org.osgi.framework.BundleException: Unresolved package 
in bundle 1: package; (&(package=org.osgi.framework)(version>=1.3.
0))
        at org.apache.felix.framework.Felix._resolveBundle(Felix.java:1699)
        at org.apache.felix.framework.Felix._startBundle(Felix.java:1566)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1519)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:354)
        at 
org.apache.tuscany.sca.implementation.osgi.invocation.OSGiImplementationProvider.
startBundle(OSGiImplementationProvider.java:360)
        ... 33 more



Best regards,
Eugene



On sun, 1 jun 2008 you wrote:

>Eugene,
> 
>Yes, org.osgi.framework is exported from the OSGi container. If you
>are running Tuscany outside of OSGi and using <implementation.osgi/>,
>the embedded Felix runtime started by Tuscany will
>export  org.osgi.framework version 1.3.0. So your bundle should be
>able to import this package if you haven't specified any version in
>your import or if the version range specified in your import includes
>1.3.0. Could you cut-and-paste the full exception stack trace from 
>your failure?
> 
>On 5/30/08, Yevgeniy Melnichuk <[EMAIL PROTECTED]> 
wrote:
>hy!i would like to use Tuscany to expose services from my OSGi-Bundles,
but iget a BundleException, because Felix can't resolve org.osgi.
framework. I
>thougth a OSGi-Container would provide this package - isn't it so?I 
tested my OSGi-Bundle with Eclipse/Equinox and it worked fine.My 
project consists of following files,osgi-service.composite:
><?xml version="1.0" encoding="UTF-8"?><composite xmlns="http://www.
osoa.org/xmlns/sca/1.0"  xmlns:t="http://tuscany.apache.org/xmlns/sca/1.
0"
>  name="SomeComposite">     <component name="SomeComponent">    
<t:implementation.osgi           bundleSymbolicName="com.sample.
myBundle" />     </component>
></composite>com.sample.myBundle.componentType:<?xml version="1.0" 
encoding="UTF-8"?><componentType xmlns="http://www.osoa.org/xmlns/sca/1.
0"
>  xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0";>  <service name="com.
sample.SomeService">     <interface.java        interface="com.sample.
SomeServiceInterface" />
>  </service></componentType>and a Main-Class with the following 
main-method:public static void main(String[] args) {  SCADomain domain 
= SCADomain.newInstance("osgi-service.composite");
>  MotdService service = domain.getService(MotdService.class,    
"SomeComponent/com.sample.SomeService");  /* do something with the 
service */}Does anybody knows whats my problem? do i have to provide 
a bundle,
>which exports the org.osgi.framework package myself?Thx for your 
answers,Eugene-- Thank you...Regards,Rajini 
>
>








Reply via email to