Mytec
Patching Glassfish 2.1.x with the latest Grizzly 1.0.x releases
From time to time Grizzly team works on issues, found by Glassfish 2.1.x users. Very often it happens, that issue has/might already been fixed in latest Grizzly 1.0.x release, and to not force user to perform complete Glassfish upgrade, we ask to try latest Grizzly 1.0.x and check if it fixes the problem.
Here I'd like to describe how user can patch existing Glassfish 2.1.x with latest Grizzly 1.0.x.
1) Check the Grizzly version, which is currently integrated to Glassfish.
To check the current Grizzly version, we need to set system property "com.sun.enterprise.web.connector.grizzly.displayConfiguration" to true. We can do it by editing Glassfish instance's domain.xml file (usually located under GF/domains/domain1/config/domain.xml) , specifically we need to find XML element <java-config> and add there child element [1].
After restarting Glassfish instance in server.log (usually located under GF/domains/domain1/logs/server.log) we'd see output like [2], where Grizzly version is 1.0.30. Please note, that if you'll see output similar to [2], but without Grizzly version in it - it means, that your version is older than 1.0.30, so you might be interested in Grizzly upgrade :)
2) Find and download Grizzly 1.0.x binary file.
You can receive link to the required Grizzly binaries directly from Grizzly team, or find the latest Grizzly binaries in the maven repository [3].
3) Apply the latest Grizzly 1.0.x binary.
Assume we've downloaded Grizzly 1.0.x binary and saved it at "/home/my/grizzly-framework-http-1.0.30.jar". Now we need to set this jar file on Glassfish prefix-classpath, to force Glassfish use the latest Grizzly classes instead of embedded ones. Again we have to edit Glassfish instance's domain.xml file (usually located under GF/domains/domain1/config/domain.xml), find XML element <java-config> and edit/add its XML attribute classpath-prefix to make it point to the saved latest Grizzly binary. So it will like [4].
4) Restart Glassfish
Probably it will also make sense to repeat step 1, to make sure we run the latest Grizzly version.
That's it :)
[1] <jvm-options>-Dcom.sun.enterprise.web.connector.grizzly.displayConfiguration=true</jvm-options>
[2]
Grizzly 1.0.30 running on Mac OS X-10.5.8 under JDK version: 1.6.0_15-Apple Inc.
port: 8080
maxThreads: 5
ByteBuffer size: 4096
useDirectByteBuffer: 8192
maxKeepAliveRequests: 250
keepAliveTimeoutInSeconds: 30
Static File Cache enabled: false
Pipeline : com.sun.enterprise.web.portunif.PortUnificationPipeline
Round Robin Selector Algorithm enabled: false
Round Robin Selector pool size: 1
Asynchronous Request Processing enabled: true|#]
[3] http://download.java.net/maven/2/com/sun/grizzly/grizzly-framework-http/
[4] <java-config classpath-prefix="/home/my/grizzly-framework-http-1.0.30.jar" classpath-suffix="" debug-enabled="true" debug-options="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009" env-classpath-ignored="true" java-home="${com.sun.aas.javaRoot}" javac-options="-g" rmic-options="-iiop -poa -alwaysgenerate -keepgenerated -g" system-classpath="">
Posted at 03:02PM Oct 16, 2009 by oleksiys in Grizzly | Comments[1]