Wowza Community

AMFDataObj java.nio.BufferUnderflowException

The code used to work on Wowza 2. We upgraded to Wowza 3 recently. Yesterday after we restart wowza server, we get the following exception. The exception is thrown when we call AMFDataList.toString in the onConnect event. Code is given

All the exception comes from the same client we believe connected to us before restart, the connection must be lost after restart. Our problem is it repeatedly calls onConnect around 10 times/second and throws exception. After some time, the server crashed.

Several hours later, we believe the client closed their browser. And our server returns to normal finally after restart.

Although I may remove the AMFDataList.toString call temporarily to solve this problem, I’m afraid the same kind of error may come out from other event because the connection data doesn’t exist and wowza still call our code.

ERROR server comment - constructor AMFDataObj(ByteBuffer)[582:583]: java.nio.BufferUnderflowException

INFO session connect-pending 67.162.179.124 -

ERROR server comment - invoke(onConnect): java.lang.NullPointerException: com.wowza.wms.amf.AMFDataItem.toString(null:-1)

java.lang.NullPointerException

at com.wowza.wms.amf.AMFDataItem.toString(Unknown Source)

at com.wowza.wms.amf.AMFDataList.toString(Unknown Source)

at XXX.StreamApp.onConnect(StreamApp.java:127)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:616)

at com.wowza.wms.module.ModuleFunction.invoke(Unknown Source)

at com.wowza.wms.module.ModuleFunctions.a(Unknown Source)

at com.wowza.wms.module.ModuleFunctions.onConnect(Unknown Source)

at com.wowza.wms.module.ModuleConnect.connect(Unknown Source)

at com.wowza.wms.request.RequestProcessFunctions.processFunctions(Unknown Source)

at com.wowza.wms.request.RTMPRequestAdapter.service(Unknown Source)

at com.wowza.wms.server.ServerHandler.a(Unknown Source)

at com.wowza.wms.server.ServerHandler.a(Unknown Source)

at com.wowza.wms.server.ServerHandler.messageReceived(Unknown Source)

at com.wowza.wms.server.ServerHandlerThreadedSession.run(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:636)

public void onConnect(IClient client, RequestFunction function, AMFDataList params)

{

getLogger().info(new Date().toString() + " " + client.getClientId() + " onConnect: " + client.getClientId() + params.toString());

}

Thanks

I believe this is a bug of wowza 3. The code used to work on wowza 2. Could someone confirm this please? thanks