Home > Uncategorized > Porting and Compiling your GlassFish v2 Comet application To v3

Porting and Compiling your GlassFish v2 Comet application To v3

When Grizzly became a top level project on java.net, we renamed it’s package from com.sun.enterprise.web.connector.grizzly to com.sun.grizzly. For the core package, the transition was quite smooth, but for Comet based application, having to rename the imported packages and then recompile was painful. Worse, building an application that works for both v2 and v3 was quite complicated, having to support two version of the same application. That’s what we call a backward compatibility!

IMG_0312.JPG

So why have we changed the package name? Well, the original package name was quite confusing (and we didn’t have the choice at that time..in 2006). The web.connector.grizzly didn’t make any sense as well. So renaming was the best thing we have to grow our new community. Hence, the Comet package has been renamed from com.sun.enterprise.web.connector.grizzly.comet to com.sun.grizzly.comet. If you are planning to write a Comet based application, I strongly recommend you use the old package name so your Comet application will work on v2 and v3 without the need to changes anything.

How to do that? First, download the grizzly-compat package, and use that module to build against it. As an example (much simpler with an IDE like Eclipse or Netbeans, but just for an example):

% javac -classpath grizzly-compat-1.8.0.jar your_classes

This will compile your application and make it work on all GlassFish anf Grizzly version that support Comet. You might also want to put the grizzly-compat jar file under WEB-INF/lib as early versions of GlassFish v3 didn’t included this module, hence you application will fail to deploy. That way you are sure your Comet applications works on all GlassFish flavors without requiring any changes.

_uacct = “UA-3111670-1”;
urchinTracker();

technorati:

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: