[GLASSFISH-9070] [BLOCKING]ClassCastException with Grizzly Blocking Mode Created: 07/Aug/09 Updated: 01/Sep/09 Resolved: 01/Sep/09 Status: Project: Component/s: Affects Version/s: Fix Version/s: Resolved glassfish web_container v2.1.1 Type: Reporter: Resolution: Labels: Remaining Estimate: Time Spent: Original Estimate: Environment: Bug meenap Fixed None Not Specified Attachments: grizzly-patch.jar 9,070 Issuezilla Id: v2.1.1 Priority: Assignee: Votes: Critical jfarcand 0 Not Specified Not Specified Operating System: other Platform: Other Description GlassFish V2.1.1 B27 Cluster Profile Windows 2003 Adv Svr Application: Richaccess. After configuring windows platform for Richaccess with Grizzly blocking mode, accessing the appserver instance is giving the following exception in server log. The browser reports "Problem loading page". #|2009-08-07T13:51:39.418-0700|SEVERE|sunappserver2.1|javax.enterprise.system.container.web|_ThreadID=18;_ThreadName=httpSSLWorkerThread-38080 0;_RequestID=ac8fdfc7-e3fc-4752-bc3b-268b2154c2a0;|WEB0777: Unblocking keep-alive exception java.lang.ClassCastException: java.net.SocketInputStream at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.parseRequest(DefaultProcessorTask.java:713) at com.sun.enterprise.web.connector.grizzly.blocking.ProcessorBlockingTask.doProcess(ProcessorBlockingTask.j at com.sun.enterprise.web.connector.grizzly.blocking.ProcessorBlockingTask.process(ProcessorBlockingTask.java at com.sun.enterprise.web.connector.grizzly.blocking.ProcessorBlockingTask.doTask(ProcessorBlockingTask.java at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265) at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106) #] [#|2009-08-07T13:51:41.793-0700|SEVERE|sunappserver2.1|javax.enterprise.system.container.web|_ThreadID=18;_ThreadName=httpSSLWorkerThread-38080 0;_RequestID=ac8fdfc7-e3fc-4752-bc3b-268b2154c2a0;|WEB0777: Unblocking keep-alive exception java.lang.ClassCastException: java.net.SocketInputStream at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.parseRequest(DefaultProcessorTask.java:713) at com.sun.enterprise.web.connector.grizzly.blocking.ProcessorBlockingTask.doProcess(ProcessorBlockingTask.j at com.sun.enterprise.web.connector.grizzly.blocking.ProcessorBlockingTask.process(ProcessorBlockingTask.java at com.sun.enterprise.web.connector.grizzly.blocking.ProcessorBlockingTask.doTask(ProcessorBlockingTask.java at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265) at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106) #] Blocking mode config in domain.xml *********************************** <config dynamic-reconfiguration-enabled="true" name="richaccess-win-cluster-config"> − <http-service> − <http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="true" default-virtual-server="server" enabled="true" family="inet" id="http-listener-1" port="$ {HTTP_LISTENER_PORT} " security-enabled="false" server-name="" xpowered-by="true"> <property name="proxiedProtocols" value="ws/tcp"/> </http-listener> − <http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false" default-virtual-server="server" enabled="true" family="inet" id="http-listener-2" port="$ {HTTP_SSL_LISTENER_PORT} " security-enabled="true" server-name="" xpowered-by="true"> <ssl cert-nickname="s1as" client-auth-enabled="false" ssl2-enabled="false" ssl3-enabled="true" tls-enabled="true" tls-rollback-enabled="true"/> </http-listener> − <virtual-server hosts="$ {com.sun.aas.hostName} " http-listeners="http-listener-1,http-listener-2" id="server" log-file="$ {com.sun.aas.instanceRoot}/logs/server.log" state="on"> <property name="docroot" value="${com.sun.aas.instanceRoot} /docroot"/> <property name="accesslog" value="$ {com.sun.aas.instanceRoot}/logs/access"/> <property name="default-web-xml" value="${com.sun.aas.instanceRoot} /config/default-web.xml"/> <property name="sso-enabled" value="false"/> </virtual-server> <request-processing header-buffer-length-in-bytes="8192" initial-thread-count="2" request-timeout-in-seconds="120" thread-count="200" thread-increment="1"/> <keep-alive max-connections="250" thread-count="1" timeout-in-seconds="0"/> <connection-pool max-pending-count="4096" queue-size-in-bytes="4096" receive-buffer-size-in-bytes="4096" send-buffer-size-in-bytes="8192"/> <http-protocol default-response-type="AttributeDeprecated" default-type="text/html; charset=iso-8859-1" dns-lookup-enabled="false" forced-response-type="AttributeDeprecated" forced-type="text/html; charset=iso-8859-1" ssl-enabled="true" version="HTTP/1.1"/> <http-file-cache file-caching-enabled="true" file-transmission-enabled="false" globally-enabled="true" hash-init-size="0" max-age-in-seconds="30" max-files-count="1024" medium-file-size-limit-in-bytes="537600" medium-file-space-in-bytes="10485760" small-file-size-limit-in-bytes="2048" small-file-space-in-bytes="1048576"/> <property name="accessLoggingEnabled" value="false"/> </http-service> Comments Comment by meenap [ 07/Aug/09 ] Changing target from V3 to V2.1.1 Comment by meenap [ 12/Aug/09 ] I am marking this bug as blocking as this is blocking my testing on windows 2003 platform. Comment by Dhiru Pandey [ 21/Aug/09 ] Please try the same tests with build 30. This has grizzly 1.0.29 integrated in it. Comment by oleksiys [ 21/Aug/09 ] Dhiru, I think it will not work. I've sent patch to Meena, with fix, which should work. Waiting for a feedback. Comment by meenap [ 21/Aug/09 ] Created an attachment (id=3123) Grizzly Patch Comment by meenap [ 21/Aug/09 ] Tried grizzly-patch.jar from Oleksiys and it worked on both B27 and B29. Started a 7 days with B29 + grizzly-patch.jar. Comment by oleksiys [ 24/Aug/09 ] fix was commited to Grizzly 1.0.30 module. Comment by oleksiys [ 24/Aug/09 ] Author: oleksiys Date: 2009-08-24 15:08:13+0000 New Revision: 3544 Modified: trunk/code/extras/grizzly1.0/src/main/java/com/sun/enterprise/web/connector/grizzly/DefaultProce ssorTask.java trunk/code/extras/grizzly1.0/src/main/java/com/sun/enterprise/web/connector/grizzly/handlers/No ParsingHandler.java Log: fix GF issue #9070 https://glassfish.dev.java.net/issues/show_bug.cgi?id=9070 "[Issue 9070] [web_container] [BLOCKING]ClassCastException with Grizzly Blocking Mode" Comment by jfarcand [ 24/Aug/09 ] Re-open the issue as the fix is incorrect. We must uses decrease the sotimeout under load because all the thread will blocks for 30 seconds and will delay any other request. The proper fix consist of using the inputStream's timeout value instead like: soTimeout = socket.getSoTimeout(); Comment by oleksiys [ 25/Aug/09 ] reworked the fix. Author: oleksiys Date: 2009-08-25 10:05:42+0000 New Revision: 3548 Modified: trunk/code/extras/grizzly1.0/src/main/java/com/sun/enterprise/web/connector/grizzly/DefaultProce ssorTask.java Log: enable keep-alive logic for blocking connections suggested by Jeanfrancois Comment by meenap [ 01/Sep/09 ] Tested the fix on promoted B30 and it is working as expected. The run is going on. Will mark issue as verified when the run completes 7 days. Generated at Sun Mar 06 09:46:11 UTC 2016 using JIRA 6.2.3#6260sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.