S313522: Instructions for OSGi-enabled Java EE Applications Hands-on Lab at JavaOne 2010

This blog provides instructions on how to follow S313522 (Hands-on Lab on OSGi-enabled Java EE Applications) that was conducted at JavaOne 2010 earlier today.

  1. Download and Install NetBeans 6.9.1.
  2. Download and Unzip GlassFish 3.1 b20 Web Profile.
  3. Start GlassFish as "asadmin start-domain" and Database as "asadmin start-database" from "glassfishv3/glassfish/bin" directory.
  4. Go to "glassfishv3/glassfish/modules/autostart" directory and execute the following script:
    #!/bin/sh -x
    wget http://download.java.net/maven/glassfish/org/glassfish/osgi-http/3.1-b20/osgi-http-3.1-b20.jar
    wget http://download.java.net/maven/glassfish/org/glassfish/osgi-platforms/felix-webconsole-extensio
    n/3.1-b20/felix-webconsole-extension-3.1-b20.jar
    wget http://download.java.net/maven/glassfish/org/glassfish/osgi-jpa/3.1-b20/osgi-jpa-3.1-b20.jar
    wget http://download.java.net/maven/glassfish/org/glassfish/osgi-ejb-container/3.1-b20/osgi-ejb-cont
    ainer-3.1-b20.jar
    wget http://download.java.net/maven/glassfish/org/glassfish/admingui/glassfish-osgi-console-plugin/3
    .1-b20/glassfish-osgi-console-plugin-3.1-b20.jar
    wget http://www.reverse.net/pub/apache//felix/org.apache.felix.webconsole-3.1.2.jar
    This is going to download the required OSGi bundles.

Refer to detailed docs and completed solutions to get started. A detailed screencast highlighting the exact set of steps will be available next week.

Technorati: conf javaone handson osgi javaee glassfish netbeans

Comments:

My sincere apology to each of the 80 attendees (it was a full house) who turned up for the lab, which eventually didn't happen because the machines were not set up properly. I will post a message in my blog as well.

Sahoo

Posted by Sanjeeb Sahoo on September 22, 2010 at 06:46 PM PDT #

I am referring ur example... But I did not understand the following code...

private BundleContext getBundleContext() {
return BundleContext.class.cast(getServletConfig().getServletContext().getAttribute("osgi-bundlecontext"));
}

please reply soon.

Posted by Ajinkya on January 27, 2011 at 07:51 PM PST #

Ajinkya,

This method gets the bundle context stores in the ServletContext as Object using "osgi-bundlecontext" attribute and casts it to BundleContext.

Posted by Arun Gupta on January 28, 2011 at 07:09 AM PST #

Could you please explain...
is osgi-bundlecontext a predefined attribute.

Can it be done by another way ?

Posted by Ajinkya on January 30, 2011 at 05:23 AM PST #

I have collected and downloaded all of your materials, but while I am trying to create the UserAuthServiceImpl class under simple_service maven project it doesn't find the dependency for UserAuthService interface. I am running on mac os and netbeans 6.9.1. The only change I have is org.apache.felix.webconsole-3.1.8.jar instead of org.apache.felix.webconsole-3.1.2.jar as I couldn't find it there. Can you please tell what is the possible error?

Posted by shaon on April 09, 2011 at 01:58 AM PDT #

shaon,

The section 9.3 in the troubleshooting section says:

If NetBeans is not able to resolve
dependencies from the local Maven
repository then the Maven cache in
NetBeans need to be explicitly
refreshed.
For that, go to menu item “Window”,
“Other”, “Maven Repository Browser”.
Then in “Maven Repository Browser” pane,
right-click on “Local Repository”, and select
“Update Index” as shown.

This should help.

Posted by Arun Gupta on April 09, 2011 at 12:25 PM PDT #

thanks for your post above, it definitely worked.

Posted by jason mraz on September 02, 2011 at 04:23 AM PDT #

Post a Comment:
Comments are closed for this entry.
About

profile image
Arun Gupta is a technology enthusiast, a passionate runner, author, and a community guy who works for Oracle Corp.


Java EE 7 Samples

Stay Connected

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today