Nitish1687 / osgi-in-action

Automatically exported from code.google.com/p/osgi-in-action
Apache License 2.0
0 stars 0 forks source link

Some problem with examples in chapter2 #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
When I was using the paint-modular example in chapter2,after typing in 
"ant"and"java -jar launcher.jar"

What is the expected output? What do you see instead?

Error starting framework: org.osgi.framework.BundleException: Unresolved constra
int in bundle org.foo.shape.circle [1]: Unable to resolve 1.0: missing requireme
nt [1.0] package; (package=javax.swing)
org.osgi.framework.BundleException: Unresolved constraint in bundle org.foo.shap
e.circle [1]: Unable to resolve 1.0: missing requirement [1.0] package; (package
=javax.swing)
        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3409)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1719)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:922)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:909)
        at launcher.Main.main(Main.java:92)

What version of the product are you using? On what operating system?
apache ant 1.8.4 , Win 7 

Please provide any additional information below.

Original issue reported on code.google.com by ADFXciph...@gmail.com on 7 Jun 2012 at 8:14

GoogleCodeExporter commented 8 years ago
Do you have any OSGi related properties in your environment? The javax.swing 
package should be exported from the system bundle - this is typically 
controlled by the org.osgi.framework.system.packages property, when this is not 
set then the default system bundle exports should include javax.swing.

Original comment by mccu...@gmail.com on 11 Jul 2012 at 11:42

GoogleCodeExporter commented 8 years ago
However, if you have the org.osgi.framework.system.packages property set then 
its value will replace the default list of exported packages from the system 
bundle, which could be why it's not finding javax.swing. Note to append rather 
than replace use the org.osgi.framework.system.packages.extra property.

Original comment by mccu...@gmail.com on 11 Jul 2012 at 11:45

GoogleCodeExporter commented 8 years ago
Hi !
Exactly the same problem !!
I've just reduce the jdk version : jdk7 -> jdk6
It's ok now...

Original comment by onclezeb...@gmail.com on 21 Sep 2012 at 2:20

GoogleCodeExporter commented 8 years ago
I also have the same problem. I don't have OSGi related properties in my 
environment. 

How can I fix this problem?

Original comment by hgoldfar...@gmail.com on 15 Nov 2012 at 9:35

GoogleCodeExporter commented 8 years ago
#c4 ... are you using JDK7? can you try JDK6?

Original comment by mccu...@gmail.com on 15 Nov 2012 at 9:38

GoogleCodeExporter commented 8 years ago
yes, and I can't reduce it to jdk6 due to another project.

Original comment by hgoldfar...@gmail.com on 15 Nov 2012 at 9:40

GoogleCodeExporter commented 8 years ago
When we created the samples the Felix launcher (contained in the lib directory) 
did not contain a profile for JDK7 (see 
https://issues.apache.org/jira/browse/FELIX-2864) which is why this error 
occurs. I'll look into updating the launcher or updating the default.properties 
embedded in the launcher (which contain the profiles).

As a workaround you can use "java -Djava.specification.version=1.6 -jar 
launcher.jar bundles" to force it to use the Java6 system packages profile even 
when running JDK7.

Original comment by mccu...@gmail.com on 15 Nov 2012 at 9:55

GoogleCodeExporter commented 8 years ago
Sweet! The workaround works! Thank you :-)

Will use it until you post the update.

Original comment by hgoldfar...@gmail.com on 15 Nov 2012 at 10:03

GoogleCodeExporter commented 8 years ago
Fixed in http://code.google.com/p/osgi-in-action/source/detail?r=37 - you'll 
need to rebuild the launcher (and either copy it to the example or rebuild the 
example chapter code)

Original comment by mccu...@gmail.com on 15 Nov 2012 at 10:11

GoogleCodeExporter commented 8 years ago
Great! Thank you for the fast response.

Love the book so far.

Original comment by hgoldfar...@gmail.com on 15 Nov 2012 at 10:19

GoogleCodeExporter commented 8 years ago
Great book, Loving it!!!. And thanks for the workarounds!!!

Original comment by navkkrn...@gmail.com on 28 Jun 2014 at 6:22

GoogleCodeExporter commented 8 years ago
Issue 6 has been merged into this issue.

Original comment by mccu...@gmail.com on 13 Jul 2014 at 6:09