mcculls / osgi-in-action Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/osgi-in-action
License: Apache License 2.0
Automatically exported from code.google.com/p/osgi-in-action
License: Apache License 2.0
OSGi in Action source code examples =================================== Requirements: Java SDK (1.5 or later http://java.sun.com/javase/downloads/index.jsp) Apache Ant (1.7 or later http://ant.apache.org/bindownload.cgi) Contents: chapter01 * greeting-example - "Hello, world" using each OSGi layer in turn chapter02 * paint-nonmodular - Original non-OSGi paint application * paint-modular - Painting with modularity chapter03 * shell-example - Remote shell example (telnet 127.0.0.1 7070) * paint-example - Painting with lifecycles (extender pattern) chapter04 * dynamics - Examples & counter-examples of handling services * paint-example - Painting with services (whiteboard pattern) chapter05 * paint-example - Painting with advanced modularity chapter06 * BeanUtils-example - Wrapping BeanUtils * HttpClient-example - Wrapping HttpClient * jEdit-example - Migrating jEdit to OSGi chapter07 * migration-example - Migrating tests to OSGi * mocking-example - Mocking OSGi APIs * testing-example - OSGi integration testing chapter08 * debugging-bundles - Debugging OSGi code * classloading - Common classloading issues * memory-leaks - OSGi memory leak example * dangling-services - Dangling service example chapter09 * combined-example - Managed shell example chapter10 * combined-example - Managed paint example chapter11 * non-component-example - Non-component example * paint-example-common - Shared component code * paint-example-ds - Declarative Services example chapter12 * non-component-example - Non-component example * paint-example-common - Shared component code * paint-example-bp - Blueprint example * paint-example-bp-fragment - Blueprint fragment example * paint-example-ip - Apache Felix iPOJO example * paint-example-mixed - Mixed component model example chapter13 * paint-example - Launching and embedding example chapter14 * combined-example - Secure paint example chapter15 * httpservice - Simple servlet example * pax-web - Advanced JSP example * gwtapp - OSGi web application (GWT) * webservice - Remote OSGi service example * webservice-client - ... client * webservice-impl - ... distribution provider Building: To build all the examples, just type "ant" from the top directory. Running: A few examples are packaged as normal Java applications, to run these type java -jar main.jar Most examples are packaged as collections of OSGi bundles, to run these type java -jar launcher.jar bundles The source for the basic OSGi launcher can be found in the "launcher" directory. Additional Ant targets: ant clean - remove all compiled/cached files ant wipe - remove all generated content ant dist - build examples (this is the default target) ant pde - generate Eclipse/PDE project files Please raise any questions or issues at http://code.google.com/p/osgi-in-action/
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 [email protected]
on 7 Jun 2012 at 8:14
ds
Original issue reported on code.google.com by [email protected]
on 4 Aug 2014 at 2:55
Attachments:
What steps will reproduce the problem?
1. Followed the instructions for running jedit with 3 bundles
2. ant jEdit.unpack
3. ant jEdit.patch
4. cd jEdit
5. ant dist
6. cd ..
7. java -Djedit.home=jEdit -jar launcher.jar jEdit
What is the expected output? What do you see instead?
I'm getting lots of exceptions about missing swing classes. Starting with
AWT-EventQueue-0: UIDefaults.getUI() failed: no ComponentUI class for:
javax.swing.JButton
What version of the product are you using? On what operating system?
Ant 1.8.4
JDK 1.7.0_11
Windows 7 64 bit
Please provide any additional information below.
The previous examples all work for me (e.g jedit-mega.bnd)
Original issue reported on code.google.com by [email protected]
on 5 Feb 2013 at 2:24
What steps will reproduce the problem?
1. Download source
2. changed into the directory [osgi-in-action]/chapter07/testing-example
3. made sure the required osgi bundles are available in the local maven rop (see issue #9 )
3. executed: ant test.container
What is the expected output?
successful tests.
What do you see instead?
... java.net.MalformedURLException: no protocol [J2SE-1.8] ...
What version of the product are you using? On what operating system?
Ant 1.9
JDK 1.8 (with JDK 1.6 it works fine)
Windows 10 64 bit (also tried Mac OS)
Please provide any additional information below.
The other examples all work for me
(with JDK 1.6 it works fine)
What steps will reproduce the problem?
What is the expected output?
successful tests.
What do you see instead?
... Fehler: Hauptklasse org.apache.felix.main.Main konnte nicht gefunden oder geladen werden ...
What version of the product are you using? On what operating system?
Ant 1.9
JDK 1.6
Windows 10 64 bit
Please provide any additional information below.
The other examples all work for me
What steps will reproduce the problem?
1. build everything with "ant" command on top directory
2. try to run launcher.jar
3. nothing happens
What is the expected output? What do you see instead?
The StockWatcher app running nothing happened even if I try to double click the
.jar file or run the .war on Tomcat
What version of the product are you using? On what operating system?
Windows 7, latest download available, java 1.6
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 4 Jul 2011 at 10:10
I want to follow the code example using the book. Forked the project, opened the first chapter, and wanted to build it using in the terminal:
ant
I get the following error:
Buildfile: C:\Users\ahmet.eroglu\eclipse-workspace\chapter01\greeting-example\lifecycle\build.xml
BUILD FAILED
C:\Users\ahmet.eroglu\eclipse-workspace\chapter01\greeting-example\lifecycle\build.xml:6: The following error occurred while executing this line:
C:\Users\ahmet.eroglu\eclipse-workspace\chapter01\greeting-example\build.xml:3: The following error occurred while executing this line:
C:\Users\ahmet.eroglu\eclipse-workspace\chapter01\build.xml:4: Cannot find C:\Users\ahmet.eroglu\eclipse-workspace\build.xml imported from C:\Users\ahmet.eroglu\eclipse-workspace\chapter01\build.xml
Total time: 0 seconds
The build.xml files look as follows:
<?xml version="1.0"?>
<project name="lifecycle" default="dist">
<property name="version" value="2.0"/>
<dirname property="example.dir" file="${ant.file.lifecycle}"/>
<import file="../build.xml"/>
<target name="provider">
<ant dir="${example.dir}/org.foo.hello" inheritAll="false"/>
</target>
<target name="consumer">
<ant dir="${example.dir}/org.foo.hello.client" inheritAll="false"/>
</target>
<target name="main">
<ant dir="${example.dir}/org.foo.hello.main" inheritAll="false"/>
</target>
</project>
As can be seen, the dist target is missing, what should I define and/or do for defining the dist and get the project up and running to follow exercises. Thanks in advance.
What steps will reproduce the problem?
1. go to osgiInAction/osgi-in-action/chapter02/paint-modular
2. execute ant
3. issue the following command: java -jar launcher.jar bundles/
What is the expected output? What do you see instead?
I expect to see the paint app run. Instead i get the following error:
Error starting framework: org.osgi.framework.BundleException: Unresolved
constraint in bundle org.foo.shape.circle [1]: Unable to resolve 1.0: missing
requirement [1.0] package; (package=javax.swing)
org.osgi.framework.BundleException: Unresolved constraint in bundle
org.foo.shape.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?
I downloaded the code at your web site: www.manning.com/OSGIinAction
I am using Fedora 18 with java 1.7.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 12 Jul 2014 at 9:42
What steps will reproduce the problem?
1. simply type ant from the top examples directory i.e. in my setup:
A:\osgi-in-action>ant
What is the expected output? What do you see instead?
Expected the examples get built. Instead I get the following error:
A:\osgi-in-action>ant
Buildfile: build.xml
BUILD FAILED
A:\osgi-in-action\build.xml:4: The following error occurred while executing
this line:
A:\osgi-in-action\common.xml:9: The <pathconvert> type doesn't support the
nested "fileset" element.
What version of the product are you using? On what operating system?
1. I downloaded this version of the examples: osgi-in-action-20090422.zip
2. and my ant and java versions are:
A:\osgi-in-action>ant -version
Apache Ant version 1.6.5 compiled on June 2 2005
A:\osgi-in-action>
A:\osgi-in-action>java -version
java version "1.6.0_11"
Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 15 Sep 2009 at 3:35
What steps will reproduce the problem?
What is the expected output?
successful tests.
What do you see instead?
... Caused by: org.ops4j.pax.runner.platform.PlatformException: [mvn:org.ops4j.pax.exam/pax-exam/1.1.0] is not a valid bundle ... Caused by: java.util.zip.ZipException: error in opening zip file ...
What version of the product are you using? On what operating system?
Ant 1.9
JDK 1.8 (also tried JDK 1.6)
Windows 10 64 bit (also tried Mac OS)
Please provide any additional information below.
The other examples all work for me
What steps will reproduce the problem?
1. Just look at the line 86 of ShapeTracker class in chapter 3 example
code. That is:
if ((m_context.getBundle(0).getState() & (Bundle.STARTING | Bundle.ACTIVE))
== 0)
2.
3.
What is the expected output? What do you see instead?
This code would only work if the different states in the Bundle interface
are set as a bit-map i.e. if a single bit is set to represent the state.
This might be a plausible expectation but by no means it is guaranteed
since the data type of the states defined in the Bundle interface is simply
an "int". This becomes more interesting because the book suggests that one
of the goals in OSGi modularity layer is to hide the implementation details
from the client code.
What version of the product are you using? On what operating system?
I believe I am using osgi-in-action-20090928.zip
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 8 Oct 2009 at 6:10
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.