Miles to go …

April 28, 2011

This blog is moving to blogs.oracle.com/arungupta!

Filed under: General — arungupta @ 4:02 am

This 1200th blog entry announces that after 5 years, 8 months, 28 days and 1199 blog entries later, this blog (blogs.sun.com/arungupta) will be migrating to blogs.oracle.com/arungupta. The new location is not live yet but redirects will work once it is.

There will be no blogging activity starting April 29th, 2011 and blogs.oracle.com/arungupta will be live sometime late next week.

Starting with a first entry Hello Blogsphere! (Aug 2, 2005), this blog has talked about several topics as shown by the tag cloud:

Here are some other statistics reported by Google Analytics (since Jan 1, 2007):

Here is another interesting snapshot (starting 6/22/10) from clustrmaps:

I like how the red dots are distributed all around the world … even way up in Greenland :-)

And this blog visited tons of cities as well …


View Cities Visited by “Miles To Go…” in a larger map

There are still a tons of cities to visit…
Plenty of JUGs to spread the fever …
Loads of conferences to speak …
And miles to go before I sleep.

"Miles to go" will be back … stay tuned!

Technorati: milestogo blogs googleanalytics stats

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

April 27, 2011

JavaOne San Francisco 2011, Oct 2-6, The Zone

Filed under: General — arungupta @ 6:36 pm

When ? Oct 2-6, 2011

Where ? "The Zone" at San Francisco (On O’Farrell between Taylor and Mason, in the hotels Hilton San Francisco The Union Square, Hotel Nikko, and Parc 55)


View The Zone – JavaOne Conference Location in a larger map

What has improved since last time ?

  • Same week as Oracle Open World but run as a separate and stand-alone conference
  • All JavaOne related talks/events in "The Zone"
  • Larger session rooms and increased exhibitor space
  • More technical sessions, BoFs, hands-on labs
  • Additional networking area and meeting space
  • More maps, signage, and onsite staff to answer questions
  • Direct involvement from community for planning/steering the event
  • Popular sessions will be repeated through out the week

Here are some key links for you:

  • oracle.com/javaone
  • Tracks
  • Registration
  • @javaoneconf
  • blogs.oracle.com/javaone
  • facebook.com/javaone
  • linkedin.com/groups?gid=1749197

And in the meanwhile, I’ll see you at JavaOne India next month. Or you can also enjoy pictures from the JavaOne 2010!

Technorati: conf javaone sanfrancisco 2011 oracle

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

April 25, 2011

TOTD #161: Java EE 6 CDI Qualifiers explained – @Default, @Any, @New, @Named

Filed under: General — arungupta @ 1:00 am

The CDI specification (JSR-299) defines "Qualifer" as a means to uniquely identify one of the multiple implementations of the bean type to be injected. The spec defines certain built-in qualifiers (@Default, @Any, @Named, @New) and new qualifiers can be easily defined as well. This Tip Of The Day (TOTD) discusses the in-built qualifiers and how they can be used.

The @Named qualifier makes a bean EL-injectable, that’s it!

The @Default qualifier, appropriately called as "default qualifier", exists on all beans without an explicit qualifer, except @Named. Consider the following bean type and implementation:

public interface Greeting {
    public String greet(String name);
}
public class SimpleGreeting implements Greeting {
    public String greet(String name) {
        return "Hello " + name;
    }
}

So SimpleGreeting defined above is equivalent to:

@Default
public class SimpleGreeting implements Greeting {
    . . .
}

Similarly

@Named
public class SimpleGreeting implements Greeting {
    . . .
}

is equivalent to:

@Named
@Default
public class SimpleGreeting implements Greeting {
    . . .
}

The default qualifier works for the type injection as well. So

@Inject Greeting greeting;

and

@Inject @Default Greeting greeting;

are equivalent. However it is not recommended to use @Named as injection point qualifier, except in the case of integration with legacy code that uses string-based names to identify beans.

@Any is another in-built qualifier on all beans, including the ones with implicit or explicit @Default qualifier, except @New qualified beans (more on this later). So the SimpleGreeting implementation is equivalent to:

@Default @Any
public class SimpleGreeting implements Greeting {
    . . .
}

And can be injected as:

@Inject @Any Greeting greeting;

or even

@Inject @Any @Default Greeting greeting;

Now lets add a new implementation of the Greeting as:

public class FancyGreeting implements Greeting {
    public String greet(String name) {
        return "Nice to meet you, hello " + name;
    }
}

Now all of the following injections fail:

@Inject Greeting greeting;
@Inject @Default Greeting greeting;
@Inject @Any Greeting greeting;
@Inject @Default @Any Greeting greeting;

with the "ambiguous dependencies" error because both the implementations now have @Default and @Any qualifiers.

This can be resolved by adding a new qualifier called @Fancy to the FancyGreeting implementation as:

@Fancy
public class FancyGreeting implements Greeting {
    . . .
}

which is also equivalent to:

@Fancy @Any
public class FancyGreeting implements Greeting {
    . . .
}

Now all the following inject statements:

@Inject Greeting greeting;
@Inject @Default Greeting greeting;
@Inject @Any @Default Greeting greeting;

will inject the SimpleGreeting implementation. However

@Inject @Any Greeting greeting;

will throw an "ambiguous dependency" error because now there are two implementations with that qualifier. The right implementation can be picked by specifying the additional qualifier such as:

@Inject @Any @Default Greeting greeting;

will inject the SimpleGreeting implementation and

@Inject @Any @Fancy Greeting greeting;

will inject the FancyGreeting implementation. The following injection will work anyway:

@Inject @Fancy Greeting greeting;

Lastly

@Inject @Default @Fancy Greeting greeting;

will give an "unsatisfied dependency" error because any bean with an explicit qualifier, except @Named, does not have the @Default qualifier.

@Any may also be used to add qualifiers programmatically such as:

@Inject @Any Instance<Greeting> greeting;
greeting.select(new AnnotationLiteral<Fancy>(){}).get();

will return a Greeting implementation with @Fancy qualifier. Here the "javax.enterprise.inject.Instance" and "javax.enteprise.util.AnnotationLiteral" classes are defined by the CDI spec.

@Any may also be used to iterate over all Greeting implementations such as:

@Inject @Any Instance<Greeting> greeting;
for (Greeting g : greeting) {
    // do something with g
}

The @New qualifier allows to obtain a depdendent object of a specified class, independent of the declared scope. So if SimpleGreeting is defined as:

@RequestScoped
public class SimpleGreeting implements Greeting {
    . . .
}

and injected as:

@Inject Greeting greeting;

then a request-scoped Greeting implementation (SimpleGreeting in this case) is injected. However if it is injected as:

@Inject @New Greeting greeting;

then the injected SimpleGreeting is in the @Dependent scope and only has @New qualifier (neither @Default or @Any).

I tried all of this using GlassFish 3.1 and NetBeans 7.0 that provides complete development and fully-clustered deployment environment for your Java EE 6 applications. Where are you deploying your Java EE 6 apps ?

Technorati: totd cdi qualifier javaee6 glassfish

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

April 22, 2011

JavaOne India 2011, May 10/11, Hyderabad – Java EE and GlassFish sessions

Filed under: General — arungupta @ 2:23 am

JavaOne India is almost there!

When ? May 10-11, 2011 (agenda)

Where ? Hyderabad International Convention Center, Hyderabad, India

What ? Keynote, Technical sessions, Exhibitor Halls, OTN Night, Hallway conversations, Biryanis, and much more!

Four tracks will cover the complete Java landscape:

  • Core Java Platform
  • Java EE, Enterprise Computing, and the Cloud
  • Java SE, Client Side Technologies, and Rich User Experiences
  • Java ME (Mobile & Embedded)

There are several sessions on Java EE and GlassFish:

  • Java EE Technical Keynote
  • The Java EE 6 Programming Model Explained: How to Write Better Applications
  • Complete Tools Coverage for the Java EE 6 Platform
  • GlassFish 3.1: Fully-clustered Java EE 6
  • Java Persistence API 2.0: An Overview
  • Servlet 3.0 extensible, asynchronous and easy to use
  • Hyperproductive JavaServer Faces 2.0
  • What’s New in Enterprise JavaBean Technology
  • Creating RESTful Web services using JAX-RS
  • Using Contexts and Dependency Injection (CDI) in the Java EE 6 Ecosystem
  • Dealing with Asynchronicity in Java Technology-Based Web Services
  • Beginning with the Java EE 6 Platform HOL
  • Embedded APIs for GlassFish Server Open Source Edition
  • Running your Java EE 6 applications in the Cloud

There are several related sessions in Oracle Develop as well!

I’ll be there, will you ?

What are you waiting for – register now!

Technorati: conf javaone india hyderabad javaee6 glassfish

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

JavaOne India 2011, May 10/11, Hyderabad – Java EE and GlassFish sessions

Filed under: General — arungupta @ 2:00 am

JavaOne India is almost there!

When ? May 10-11, 2011 (agenda)

Where ? Hyderabad International Convention Center, Hyderabad, India

What ? Keynote, Technical sessions, Exhibitor Halls, OTN Night, Hallway conversations, Biryanis, and much more!

Four tracks will cover the complete Java landscape:

  • Core Java Platform
  • Java EE, Enterprise Computing, and the Cloud
  • Java SE, Client Side Technologies, and Rich User Experiences
  • Java ME (Mobile & Embedded)

There are several sessions on Java EE and GlassFish:

  • Java EE Technical Keynote
  • The Java EE 6 Programming Model Explained: How to Write Better Applications
  • Complete Tools Coverage for the Java EE 6 Platform
  • GlassFish 3.1: Fully-clustered Java EE 6
  • Java Persistence API 2.0: An Overview
  • Servlet 3.0 extensible, asynchronous and easy to use
  • Hyperproductive JavaServer Faces 2.0
  • What’s New in Enterprise JavaBean Technology
  • Creating RESTful Web services using JAX-RS
  • Using Contexts and Dependency Injection (CDI) in the Java EE 6 Ecosystem
  • Dealing with Asynchronicity in Java Technology-Based Web Services
  • Beginning with the Java EE 6 Platform HOL
  • Embedded APIs for GlassFish Server Open Source Edition
  • OSGi-enabled Java EE Applications using GlassFish
  • Running your Java EE 6 applications in the Cloud

There are several related sessions in Oracle Develop as well!

I’ll be there, will you ?

What are you waiting for – register now!

Technorati: conf javaone india hyderabad javaee6 glassfish

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

April 21, 2011

Why JAX Conf San Jose 2011 ?

Filed under: General — arungupta @ 1:00 am

Last week at JAX London Spring 2011, I got an opportunity to talk with Sebastien Meyen and Mark Hazell and they explained on why they are bringing JAX to San Jose and how they expect to work with different community leaders to make it effective.

JAX Conferences are "Java platform centric with a high passion" and provides a "Pragmatic mix with Java focused sessions".

Hear it all from them:


Register by 5/9 and save $200 – register now!

Are you a user group community interested in working with JAX Conf ? Send an email to Mark Hazell at .

There are several special days, including 7 sessions in the Java EE Day on Wed and Thu. More details on that later.

See ya there!

Technorati: conf jaxconf sanjose java

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

April 20, 2011

2 day Java EE 6 Workshop at Bratislava, Slovakia Delivered

Filed under: General — arungupta @ 1:00 am

I just completed my second (first in Budapest) 2-day Java EE 6 workshop, this time in Bratislava, Slovakia. Thank you Oracle University!

The workshop covered the majority of Java EE 6 technologies such as EJB 3.1, JPA 2, JSF 2, Servlets 3, CDI 1.0, Bean Validation 1.1, and had several hands-on components using NetBeans and Eclipse. I also gave an update on GlassFish 3.1 and all the features typically offered for deploying your Java EE 6 applications. And also added a session on OSGi-enabled Java EE Applications. The timing was much better coordinated from the last workshop, had more time for hands-on sessions, and all attendees could complete them.

The number of attendees was definitely small but that allowed me to engage into 1-1 conversation easily, and all of them were quite engaging. Here is some feedback from the attendees on how Java EE 6 and GlassFish will simplifying development and deployment:

  • Lot of annotations makes the life extremely simple but still have the choice to use XML to override them.
  • Provides a light-weight installation which has a small footprint, intuitive IDE experience for NetBeans. This is the same feedback also mentioned by customers.
  • Don’t use Tomcat, use GlassFish.
  • Good starting point for EJB as well as CDI. The misconception is that using Seam is the most easy to start with EJB, but don’t think that’s true with all the simplifications in EJB 3.1.
  • New extensions mechanism in the platform makes possible to develop and deployon standard platforms, at the same time keep track with innovation
  • Concepts of JSF2 with XHTML layout and easy way to define composite components is very compelling
  • OSGi platform on top of Java EE is a good one, compared to heavy Java modular system in the past

You can always a read more detailed feedback on Java EE 6 in this community feedback series.

If you are interested then similar workshops are also planned in Utrecht, Netherlands on May 23/24 (register here) and Athens, Greece on May 26/27 (register here)!

On a personal front, the hot water + lemon + honey helped me keep my voice and throat soothing. A very nice fitness center (Golem Club) in a close by shopping complex, with elaborate set of workout machines, also helped me maintain my workout regime. :-)

Here are a few shots from the neighborhood:

And also managed to get a long run in the neighborhood as well:


On an unrelated note, one of the attendees asked me where to buy Oracle merchandise:

oraclestore.corpmerchandise.com is your answer!

Check out several other offerings from Oracle University at education.oracle.com.

Technorati: conf slovakia workshop javaee6 glassfish

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

April 19, 2011

GlassFish Geo Map Updated – Mar 2011

Filed under: General — arungupta @ 2:00 am

One of the multiple ways GlassFish adoption is tracked is by doing a reverse geo-lookup on the IPs from the GlassFish Admin Console and plotting them on a Google Map. The data is not very precise as not everybody uses the web-based console and proxies and firewalls get in the way but this is an interesting visual representation. You can zoom in/out and the numbers for the visible area are updated on the right bar.

The bottom left corner allows you to view the monthly or the cumulative total. The "IP" labels represent installations and "hits" count repeated GETs.

A live version of map can always be seen at maps.glassfish.org and a snapshot from Mar 2011 is shown below:

The world is certainly becoming pink :-)

This data has been gathered since Feb 2007 and has > 21 million hits from ~1.2million unique IPs through Mar 2011. The data for Mar 2011 is the highest so far: 691k hits from 48k unique IPs. This can certainly be attributed to the GlassFish 3.1 launch in the late February.

Do you know there are GlassFIsh users in Greenland as well ? I’m still waiting for research stations in Antartica to use it :-)

Go ahead, take a look at the live version and see who is using GlassFish in your neighborhood! Drop a comment on this blog if your city is shown in pink color.

Technorati: glassfish adoption geomap google mashup

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

April 18, 2011

TOTD #160: OSGi bundles not auto-starting in GlassFish 3.1 ?

Filed under: General — arungupta @ 4:00 am

You are copying OSGi bundles in the "domains/domain1/autodeploy/bundles" directory of GlassFish 3.1 and yet the OSGi bundles are not starting. This is because the "fileinstall" bundle which is responsible for autostarting bundles had to be disabled in the final build. This can be easily fixed by executing the following commands:

asadmin delete-jvm-options --target server-config \
-Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell, \
org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell, \
org.apache.felix.gogo.command
asadmin create-jvm-options --target server-config \
-Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell, \
org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell, \
org.apache.felix.gogo.command,org.apache.felix.shell.remote, \
org.apache.felix.fileinstall

Note, these commands are whitespace sensitive so ensure the entire command is executed in one line. More details and other options are discussed at users@glassfish.

Learn more about building OSGi-enabled Java EE Applications using NetBeans (screencast #32) and Eclipse (screencast #38).

Technorati: totd osgi glassfish fileinstall

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot

April 15, 2011

London Underground and Java EE 6 Interactive Hackathon @ JAX London 2011 using NetBeans and GlassFish

Filed under: General — arungupta @ 2:00 am

Do you know what is common between London Underground and Java EE 6 ?

They got together at JAX London 2011 in a slides-free, NetBeans-driven, interactive Java EE 6 hackathon. I’ve done similar NetBeans and/or Eclipse-driven sessions at other conferences as well but this is the most comprehensive I’ve ever done and also covered the widest range of Java EE 6 technologies as well. Adam Bien is certainly well known to do these kind of sessions all around the world and now I can certainly feel why he feels excited about doing them again and again :-)

The hackathon started a little late because of the late food arrival but went on for 1.5 hrs, instead of the scheduled 1 hr and way beyond 10pm. We built an application that allowed to store the duration between any two tube stations. The sample application demonstrated the usage of @Entity, @javax.validation.constraints.*, @Inject, @Stateless, @Singleton, @Schedule, CDI Events, @Path, @Interceptor, @Model, and much more. The most interesting part certainly was the interactive nature of the audience and discussing the different options.

 Anyway, you can start with the following DDL:

create table underground (
   id integer not null generated always as identity,
   fromStation varchar(20) not null,
   toStation varchar(20) not null,
   duration varchar(5) not null,
   primary key(id)
);

for creating your database, download the sample code here built during the session, open it in NetBeans 7.0 RC1, run it on GlassFish. And then get a feel for all the features yourself!

Are you interested in having a similar hackathon at your conference / event / JUG ? :-)

A comprehensive Java EE 6 tooling screencast using NetBeans is available at screencast #37 and using Eclipse is available at screencast #36.

Technorati: conf jaxlondon javaee6 netbeans glassfish london underground

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
Older Posts »

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.
Powered by WordPress