Since 2012, I start to paly with Glassfish OSGi-JavaEE, and this is a unique position in Glassfish. Since 2009 - the first release of Glassfish v3, Glassfish OSGi-JavaEE came into being.
Fistly, let us see the definition of Glassfish OSGi-JavaEE:
"GlassFish Server enables interaction between OSGi services and Java EE components. This interaction is bi-directional. On one hand, OSGi services managed by OSGi framework can invoke Java EE components managed by Java EE container. On the other hand, Java EE components managed by Java EE container can invoke OSGi services managed by OSGi framework. "
If you are careful enough, you will find that in Glassfish v3's distro, there is a special directory called "autostart" which is located in "glassfish/modules" and the jars or OSGi bundles as following implemeting Glassfish OSGi-JavaEE features are located in the "autostart" directory.
The above nine jar files are implemented by a glassfish sub-project called "Fighterfish". While I start to play with Fighterfish, I am very curious the name of Fighterfish. Although I have not ask Sahoo(Fighterfish's leader, a famous developer of Glassfish Team) why uses the name, I guess that compared with Glassfish, Fighterfish can aim to make glassfish inject more energies and more competitive strength while competing with other application servers. The approach should be OSGi & OSGi-JavaEE!
Backing to 2012.7, while I start to contribute Fighterfish(maybe you want to ask me why seclecting Fighterfish, because I like both OSGi and JavaEE!), the first thing to do is to check out Fighterfish's source and building it, OK, my story begins with here,
Noting: you can directly see the document from the Oracle Glassfish Wiki:
However, if you think that contents of the above link have a litter long, please continue to see the following
1. check out fighterfish's source from trunk
prerequisite: needing the following tools
1) JDK 6 or JDK 7
2) SVN Client Tool
Because my OS is WindowsXP, I use TortoiseSVN, a very great tool.
To check out source from trunk, please using the following svn url:
svn checkout https://svn.java.net/svn/glassfish~svn/trunk/fighterfish
Noting: if you are behind in your corporation's proxy server, you should config your TortoiseSVN's network setting.
2. Building the fighterfish trunk
Here, what I said "building the fighterfish trunk" means to build "fighterfish/module", because fighterfish/module implements the above nine jars(osgi-*.jar) which are located in the "autostart" directory.
prerequisite: needing the following tools
1) Maven 3.0.4
You can use other versions of Maven such as maven 2.2.1, however, I use maven 3.0.4, a latest maven 3.x release.
2) (Optional)Current Glassfish v4 SnapShot
Why I said a Glassfish Distro is optional? Here has two reasons:
- if you tight wish Glassfish v4's development, for example, you find a OSGi-JavaEE's regression on current Glassfish v4 SnapShot, you should have a current Glassfish v4 SnapShot.
- if you maintance a Glassfish v3's release, or plan to investigate a OSGi-JavaEE's bug in Glassfish v3, you need not to have a current Glassfish v4 SnapShot. Please remembering such a fact: the most of Fighterfish's modules are compatible with Glassfish v3 and v4 except for the osgi-ee-resources, that is to say, the most of Fighterfish's modules do not depend on Glassfish v4's API.
- (★)for osgi-ee-resources, if you build it or build the whole fighterfish/module, you will meet the following error,
Failure to find org.glassfish.main.jdbc:jdbc-config:jar:4.0-b73 in
http://download.eclipse.org/rt/eclipselink/maven.repo/ was cached in the
This is because currently, repo1 maven repository has not 4.0-b73 related artifacts(I have reported the error into community), so, if you am playing with osgi-ee-resources, you have two choices:
①manually install jdbc-config-4.0-b73.jar and connectors-internal-api-4.0-b73.jar from the following repo:
installing directive is as following(eg. jdbc-config-4.0-b73.jar):
mvn install:install-file -DgroupId=org.glassfish.main.jdbc -DartifactId=jdbc-config -Dversion=4.0-b73 -Dpackaging=jar -Dfile=/.../.../jdbc-config-4.0-b73.jar
②you can also modify osgi-ee-resources's pom and replace 4.0-b73 with 4.0-SNAPSHOT if you want to use the latest Glassfish Trunk API.
3) config maven's setting.xml
For me (a glassfish outside contributor), I will config my maven's setting.xml and add the following:
The mirror also applies in Glassfish Main's building. If you come from Oracle itself, you'd better do liking .
To build the fighterfish's module, please execute the following command from your shell:
> set MAVEN_OPTS = -Xmx512m -XX:MaxPermSize=256m
> mvn -DskipTests=true clean install
Note: you must set MAVEN_OPTS and if you do not set the env varible, you can get an out of memory exception while executing maven building.
OK, about "testing and looking fighterfish modules in depth", I will put the next part.