CometD Servlet On WL 10.3.5.0 Yields IndexOutOfBoundsException (Doc ID 1463007.1)

Last updated on FEBRUARY 22, 2017

Applies to:

Oracle Weblogic Server - Version 10.3.3 to 10.3.6
Information in this document applies to any platform.

Symptoms

The issue is with the usage of Jetty Continuation filter on an application deployed in WLS. While implementing a new cometD based solution on WebLogic 10.3.x (10.3.3-10.3.6) as these versions are servlet spec 2.5, the Jetty continuation filter must be used to support key features of CometD.
The usage of this filter in WLS results in the following behavior in the server's stdout log and a dropped connection on the client side.

1. When the servlet/service first starts,the following is seen in the stdout.

  ***
 20 [[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO org.cometd.server.BayeuxServerImpl.873866398 - interval=0
 20 [[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO org.cometd.server.BayeuxServerImpl.873866398 - logLevel=1
 21 [[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO org.cometd.server.BayeuxServerImpl.873866398 - long-polling.multiSessionInterval=2000
 27 [[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO org.cometd.server.BayeuxServerImpl.873866398 - maxInterval=10000
 30 [[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO org.cometd.server.BayeuxServerImpl.873866398 - maxLazyTimeout=5000
 33 [[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO org.cometd.server.BayeuxServerImpl.873866398 - services=com.ibm.oracleTestCase.OracleTestService
 37 [[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO org.cometd.server.BayeuxServerImpl.873866398 - timeout=20000


CometD Test Service is now active...
In configure method to set up channel: /service/oracleTestCase
 

 108 [[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO org.cometd.java.annotation.AnnotationCometdServlet - Processed annotated service com.ibm.oracleTestCase.OracleTestService@7d316e00


When invoking the service,the following is thrown in the WLS stdout.

Incoming message on service/oracleTestCase
  java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
  at java.util.LinkedList.entry(LinkedList.java:365)
  at java.util.LinkedList.get(LinkedList.java:315)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:55)
  at org.eclipse.jetty.continuation.ContinuationFilter.doFilter(ContinuationFilter.java:100)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  Truncated. see log file for complete stacktrace
  >


On the client side an output indicating a connection is attempted but that long-polling is failing when the exception on the server is thrown and the connection is dropped.

  Attempting to handshake
  Checking connection status.
  Connection to Server Opened
  Closing session.
  6169 [HttpClient-11] INFO org.cometd.client.BayeuxClient.18464898 - Messages failed [{id=3, connectionType=long-polling, channel=/meta/connect, clientId=4jzqzuuep8ipbkvacg8ows1pl}]
  java.net.ProtocolException: Unexpected response 500:
  TransportExchange@1adc30=POST//9.41.22.163:7001/BEA_Testcase/cometd/connect#CONTENT(151ms)->COMPLETED(0ms)sent=5368ms
  at org.cometd.client.BayeuxClient$PublishTransportListener.onProtocolError(BayeuxClient.java:1144)
  at org.cometd.client.transport.LongPollingTransport$T

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms