Search |
||
Porting and Compiling your GlassFish v2 Comet application To v3Posted by jfarcand on July 1, 2008 at 2:18 PM PDT
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! 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): 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.
»
Related Topics >>
Glassfish Comments
Comments are listed in date ascending order (oldest first)
Submitted by segfault2007 on Wed, 2008-07-02 06:00.
hello,
I have grizzly-compat-1.8.0.jar as well as grizzly-comet-webserver-1.8.0.jar in my libraries, in my enterprise application.
I am using the following includes:
import com.sun.grizzly.comet.CometContext;
import com.sun.grizzly.comet.CometEngine;
import com.sun.grizzly.comet.CometEvent;
import com.sun.grizzly.comet.CometHandler;
it does compile and deploy, but I get:
java.lang.IllegalStateException: Grizzly Comet hasn't been registered
Submitted by jfarcand on Wed, 2008-07-02 08:41.
Salut,
you get that exception because you are compiling using Grizzly 1.8.0 but deploy in GlassFish v2, which use Grizzly 1.0.20. To deploy in v2, use the com.sun.enterprise.web... and compile agains Grizzly 1.0.20 or appserv-rt.jar.
Thanks
Submitted by igf1 on Mon, 2008-08-18 18:42.
ohh man, does anyone know how I can get the latest and greatest Grizzly working with GF V2ur2?
Submitted by jfarcand on Mon, 2008-08-25 15:21.
Salut, it will not works. Which features are you looking at in v3 that isn't in v2? Follow up the discussion on users@grizzly.dev.java.net (faster response). Thanks!
|
||
|
|