Red5 Client seems to be broken

265 views
Skip to first unread message

solomax

unread,
Jul 4, 2013, 12:11:29 PM7/4/13
to red5in...@googlegroups.com
Hello Paul,

After upgrading to the latest red5
I have removed building of the client from the sources (since it was not compilable)

Unfortunately it seems like red5-client-1.0.2-SNAPSHOT is broken

java.lang.NoSuchMethodError: org.red5.server.net.rtmp.RTMPMinaConnection.setState(Lorg/red5/server/net/rtmp/codec/RTMP;)V
at org.red5.client.net.rtmp.RTMPMinaIoHandler.sessionCreated(RTMPMinaIoHandler.java:88)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.sessionCreated(DefaultIoFilterChain.java:623)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionCreated(DefaultIoFilterChain.java:344)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$700(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionCreated(DefaultIoFilterChain.java:740)
at org.apache.mina.core.filterchain.IoFilterAdapter.sessionCreated(IoFilterAdapter.java:74)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionCreated(DefaultIoFilterChain.java:344)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionCreated(DefaultIoFilterChain.java:337)
at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:211)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.addNow(AbstractPollingIoProcessor.java:534)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.handleNewSessions(AbstractPollingIoProcessor.java:501)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:67)
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1116)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
java.lang.NoSuchMethodError: org.red5.server.net.rtmp.RTMPMinaConnection.setState(Lorg/red5/server/net/rtmp/codec/RTMP;)V
at org.red5.client.net.rtmp.RTMPMinaIoHandler.sessionCreated(RTMPMinaIoHandler.java:88)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.sessionCreated(DefaultIoFilterChain.java:623)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionCreated(DefaultIoFilterChain.java:344)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$700(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionCreated(DefaultIoFilterChain.java:740)
at org.apache.mina.core.filterchain.IoFilterAdapter.sessionCreated(IoFilterAdapter.java:74)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionCreated(DefaultIoFilterChain.java:344)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionCreated(DefaultIoFilterChain.java:337)
at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:211)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.addNow(AbstractPollingIoProcessor.java:534)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.handleNewSessions(AbstractPollingIoProcessor.java:501)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:67)
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1116)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)

Can you please help me to fix workaround this?

Thanks in advance!

Mondain

unread,
Jul 4, 2013, 12:35:37 PM7/4/13
to red5in...@googlegroups.com
I'll look into it


--
 
---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
http://gregoire.org/
http://code.google.com/p/red5/

Mondain

unread,
Jul 5, 2013, 3:17:08 PM7/5/13
to red5in...@googlegroups.com
This is caused by a stale red5 server snapshot jar in your m2 directory. If anyone knows how to trigger cleaning up stale snapshots, I'm all ears.

Paul

solomax

unread,
Jul 6, 2013, 1:17:25 AM7/6/13
to red5in...@googlegroups.com
I'm building red5-server from the sources each time ...
Will try to clean up red5* maven cache and recheck

solomax

unread,
Jul 6, 2013, 1:51:49 AM7/6/13
to red5in...@googlegroups.com
Just retest, same result :((
It seems to be connected with https://groups.google.com/d/msg/red5interest/nmEfy1__fKE/XS7W8wQrN-8J (I was unable to compile client using the latest server built from sources)

I can try to recompile client on my machine to double check .... should I?

Mondain

unread,
Jul 6, 2013, 10:17:50 AM7/6/13
to red5in...@googlegroups.com
The way that i resolved it was to force an update of my .m2 / local repository. I deleted this directory:
C:\Users\Paul\.m2\repository\org\red5\red5-server
And ran the build again, it worked. What I want to know how to do is make Maven pull the updated jar without having to manually delete this directory. I updated the lastUpdated value in my maven-metadata.xml, but this doesn't seem to force anything on the client end.

The classes that the client build complains about are very clearly in the snapshot jar on the repo, but making Maven get them is the problem here.

Regards,
Paul

solomax

unread,
Jul 7, 2013, 11:31:11 PM7/7/13
to red5in...@googlegroups.com
Something really weird is happening:

1) I have cleaned up ~/.m2/repository/org/red5
2) download latest client (sources)
3) delete trunk/lib/red5-server-1.0-RC3-r4424-java6.jar (just in case)
4) build everything using "mvn -Dmaven.buildNumber.doUpdate=false -Dmaven.test.skip=true clean install"

After all these steps I run normal Openmeetings build which has failed (due to changed client API)
I have fixed the code (build was OK)

Then I start our client application (used to implement screensharing), unfortunately client is failed to connect (maximum logging displays no reason, connection was just closed)

Then I decide to clean up everything and try to reproduce my steps without client manual build

I did
1) cleaned up ~/.m2/repository/org/red5
2) download server r4675 (sources)
3) build server using "mvn -Dmaven.buildNumber.doUpdate=false -Dmaven.test.skip=true clean install"

I got compiler errors in my client code (client API was changed one more time????)

Will appreciate any help

solomax

unread,
Jul 7, 2013, 11:59:04 PM7/7/13
to red5in...@googlegroups.com
Additionally after modifiyng our build to build both client and server from the sources and set client and server version to 4679

I got 
[artifact:mvn] [ERROR] COMPILATION ERROR : 
[artifact:mvn] [INFO] -------------------------------------------------------------
[artifact:mvn] [ERROR] /home/solomax/work/openmeetings/trunk/singlewebapp/build/red5/server/src/main/java/org/red5/server/net/servlet/StatisticsServlet.java:[29,24] error: cannot find symbol
[artifact:mvn] [ERROR]  package org.apache.xmlrpc
[artifact:mvn] /home/solomax/work/openmeetings/trunk/singlewebapp/build/red5/server/src/main/java/org/red5/server/net/servlet/StatisticsServlet.java:[45,25] error: cannot find symbol
[artifact:mvn] [ERROR]  class StatisticsServlet
[artifact:mvn] /home/solomax/work/openmeetings/trunk/singlewebapp/build/red5/server/src/main/java/org/red5/server/net/servlet/StatisticsServlet.java:[45,51] error: cannot find symbol
[artifact:mvn] [INFO] 3 errors 


Maybe there is an option to get and build both client and server by one command?
Since these 2 depends on each other I believe it can be good idea :)

Mondain

unread,
Jul 8, 2013, 12:32:13 AM7/8/13
to red5in...@googlegroups.com
The client depends on the server, but the server doesn't need the client. The servlet dependency on xmlrpc was updated recently, but I didn't notice any issues building with it.


solomax

unread,
Jul 8, 2013, 12:50:26 AM7/8/13
to red5in...@googlegroups.com
I get this output while building server:

[artifact:mvn] [INFO] Building Red5 :: Server 1.0.2-SNAPSHOT
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [WARNING] Checksum validation failed, no checksums available from the repository for http://red5.googlecode.com/svn/repository/org/red5/red5-client/1.0.2-SNAPSHOT/red5-client-1.0.2-SNAPSHOT.pom


so client seems to be downloaded by the server (not sure if it is necessary)

solomax

unread,
Jul 8, 2013, 1:03:16 AM7/8/13
to red5in...@googlegroups.com
Am I right thinking:

Mondain

unread,
Jul 8, 2013, 9:25:34 AM7/8/13
to red5in...@googlegroups.com
The jar is pulled so that it will be packaged in red5/lib inside the zip/tar.gz. You should be able to delete the client trunk lib.

solomax

unread,
Jul 18, 2013, 2:46:56 AM7/18/13
to red5in...@googlegroups.com
It seems like red5-client r4697 is not compilable :(
(both client and server are built from sources)

[artifact:mvn] [INFO] -------------------------------------------------------------
[artifact:mvn] [ERROR] COMPILATION ERROR : 
[artifact:mvn] [INFO] -------------------------------------------------------------
[artifact:mvn] [ERROR] /home/solomax/work/openmeetings/trunk/singlewebapp/build/red5/client/src/main/java/org/red5/client/net/rtmp/RTMPMinaIoHandler.java:[359,27] error: cannot find symbol
[artifact:mvn] [ERROR]  class RTMPMinaIoHandler.RTMPClientProtocolDecoder
[artifact:mvn] /home/solomax/work/openmeetings/trunk/singlewebapp/build/red5/client/src/main/java/org/red5/client/net/rtmpt/RTMPTClient.java:[77,8] error: no suitable method found for messageReceived(Object,IoSession)
[artifact:mvn] [ERROR]     method BaseRTMPHandler.messageReceived(Object) is not applicable
[artifact:mvn]       (actual and formal argument lists differ in length)
[artifact:mvn] /home/solomax/work/openmeetings/trunk/singlewebapp/build/red5/client/src/main/java/org/red5/client/net/rtmpt/RTMPTClient.java:[69,1] error: method does not override or implement a method from a supertype
[artifact:mvn] [INFO] 3 errors 
[artifact:mvn] [INFO] -------------------------------------------------------------
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [INFO] BUILD FAILURE
[artifact:mvn] [INFO] ------------------------------------------------------------------------

Mondain

unread,
Jul 18, 2013, 11:02:57 AM7/18/13
to red5in...@googlegroups.com
I did some refactoring yesterday and fixed an issue with RTMPT; I'll fix up the client today and hopefully I can get it to connect properly now.

solomax

unread,
Jul 18, 2013, 12:40:18 PM7/18/13
to red5in...@googlegroups.com
Great!

Thanks!

Mondain

unread,
Jul 19, 2013, 12:47:02 AM7/19/13
to red5in...@googlegroups.com
The RTMPT client seems to work now with the latest build; next up, fixing the RTMP version.

Ryan

unread,
Jul 19, 2013, 12:53:47 AM7/19/13
to red5in...@googlegroups.com
why the RTMPDecodeState must be ThreadLocal?

在 2013年7月19日星期五UTC+8下午12时47分02秒,Mondain写道:

Mondain

unread,
Jul 19, 2013, 1:45:29 AM7/19/13
to red5in...@googlegroups.com
Because each incoming message is handled in a thread and there is the possibility that there may be multiple threads for a single connection at once. This mostly depends upon the message executor which has its default set to 1 at-a-time right now.

Ryan

unread,
Jul 19, 2013, 2:01:41 AM7/19/13
to red5in...@googlegroups.com
You should make Decoder and Encoder don't dependent on Red5 ThreadLocal. Pass connection as parameter to them.
eg:
public interface IEventEncoder {
   
public abstract IoBuffer encodeNotify(Notify notify,RTMPConnection conn);
         .......................................
         public abstract ISharedObjectMessage decodeFlexSharedObject(IoBuffer in, RTMPConnection conn);
         ..........


So you can make Decoder and Encoder static or singleton and not dependent on any thread.  


RTMPMinaProtocolEncoder and RTMPMinaProtocolDecoder is in mina thread and some time have no place to set red5 ThreadLocal connection so you can see NULL red5 ThreadLocal connection sometimes. This cause some thread safe problem.

For mina you can get connection from sessionId always.

在 2013年7月19日星期五UTC+8下午1时45分29秒,Mondain写道:

solomax

unread,
Jul 19, 2013, 2:17:22 AM7/19/13
to red5in...@googlegroups.com
I just tried RTMPT client and I get Red5.getConnectionLocal() == null
Here is the StackTrace:

ERROR 07-19 13:14:51.240 RTMPProtocolEncoder.java 26936 111 org.red5.server.net.rtmp.codec.RTMPProtocolEncoder [Thread-3] - Error encoding
java.lang.NullPointerException: null
at org.red5.server.net.rtmp.codec.RTMPProtocolEncoder.encodeCommand(RTMPProtocolEncoder.java:763) ~[red5-server.jar:na]
at org.red5.server.net.rtmpt.codec.RTMPTProtocolEncoder.encodeCommand(RTMPTProtocolEncoder.java:49) ~[red5-server.jar:na]
at org.red5.server.net.rtmp.codec.RTMPProtocolEncoder.encodeCommand(RTMPProtocolEncoder.java:731) ~[red5-server.jar:na]
at org.red5.server.net.rtmp.codec.RTMPProtocolEncoder.encodeInvoke(RTMPProtocolEncoder.java:719) ~[red5-server.jar:na]
at org.red5.server.net.rtmp.codec.RTMPProtocolEncoder.encodeMessage(RTMPProtocolEncoder.java:499) ~[red5-server.jar:na]
at org.red5.server.net.rtmp.codec.RTMPProtocolEncoder.encodePacket(RTMPProtocolEncoder.java:134) ~[red5-server.jar:na]
at org.red5.server.net.rtmp.codec.RTMPProtocolEncoder.encode(RTMPProtocolEncoder.java:109) ~[red5-server.jar:na]
at org.red5.client.net.rtmpt.BaseRTMPTConnection.write(BaseRTMPTConnection.java:240) ~[red5-client-1.0.2-RC1.jar:1.0.2-RC1]
at org.red5.server.net.rtmp.Channel.write(Channel.java:138) ~[red5-server.jar:na]
at org.red5.server.net.rtmp.Channel.write(Channel.java:107) ~[red5-server.jar:na]
at org.red5.server.net.rtmp.RTMPConnection.invoke(RTMPConnection.java:953) ~[red5-server.jar:na]
at org.red5.server.net.rtmp.RTMPConnection.invoke(RTMPConnection.java:922) ~[red5-server.jar:na]
at org.red5.server.net.rtmp.RTMPConnection.invoke(RTMPConnection.java:977) ~[red5-server.jar:na]
at org.red5.client.net.rtmp.BaseRTMPClientHandler.invoke(BaseRTMPClientHandler.java:487) ~[red5-client-1.0.2-RC1.jar:1.0.2-RC1]
at org.apache.openmeetings.screen.webstart.CoreScreenShare.sendCursorStatus(CoreScreenShare.java:178) ~[eclipse/:na]
at org.apache.openmeetings.screen.webstart.CaptureScreen.run(CaptureScreen.java:94) ~[eclipse/:na]

Ryan

unread,
Jul 19, 2013, 2:33:13 AM7/19/13
to red5in...@googlegroups.com
:)

Try my revied version 

Just replace red5-server.jar using mine. and in red5-core.xml comment out  <!--<property name="executor" ref="messageExecutor" />--> for rtmpMinaConnection,comment out  <!--<property name="executor" ref="messageExecutor" />  --> for rtmptConnection


By the way rtmpScheduler can replace messageExecutor just using scheduler.execute

For handshake should be this:

/**
* Start waiting for a valid handshake.
*/
private ScheduledFuture<?> waitForHandshakeTaskFuture;
public void startWaitForHandshake() {
log.debug("startWaitForHandshake - {}", sessionId);
// start the handshake waiter
waitForHandshakeTaskFuture=scheduler.schedule(new WaitForHandshakeTask(),new Date(maxHandshakeTimeout+System.currentTimeMillis()));
}

and not necessary to sleep thread in WaitForHandshakeTask

and in close connection just:

if (scheduler != null) {
if(!waitForHandshakeTaskFuture.isDone())
waitForHandshakeTaskFuture.cancel(true);
log.debug("Shutting down scheduler");
try {
ScheduledExecutorService exe = scheduler.getScheduledExecutor();
List<Runnable> runables = exe.shutdownNow();
log.debug("Scheduler - shutdown: {} queued: {}", exe.isShutdown(), runables.size());
scheduler.shutdown();
scheduler = null;
} catch (NullPointerException e) {
// this can happen in a multithreaded env, where close has been called from more than one spot
if (log.isDebugEnabled()) {
log.warn("Exception during scheduler shutdown", e);
}
} catch (Exception e) {
log.warn("Exception during scheduler shutdown", e);
}
}




在 2013年7月19日星期五UTC+8下午2时17分22秒,solomax写道:
red5-server.jar

solomax

unread,
Jul 23, 2013, 6:49:11 AM7/23/13
to red5in...@googlegroups.com
Thanks Ryan,
but I would prefer the patch to the original red5 to precompiled server
Could you please attach the patch, fixing the issue?

Ryan

unread,
Jul 23, 2013, 7:58:50 AM7/23/13
to red5in...@googlegroups.com
Hi slomax
    I have modified a lot of sources and have many patches to fit for spring security authority,jpa,hibernate,absolutely amf3 support for rtmp. It is no way to detach this patch. I'll revise your latest original svn sources and give this patch. So just wait for a couple of hours.  
 
在 2013年7月23日星期二UTC+8下午6时49分11秒,solomax写道:

Ryan

unread,
Jul 23, 2013, 10:41:28 AM7/23/13
to red5in...@googlegroups.com
Hi solomax,There is a quick patch. You can apply it to latest snapshot.Please give me feedback.

在 2013年7月23日星期二UTC+8下午6时49分11秒,solomax写道:

Ryan

unread,
Jul 23, 2013, 10:45:54 AM7/23/13
to red5in...@googlegroups.com
Attachment failed. Post again.

在 2013年7月23日星期二UTC+8下午10时41分28秒,Ryan写道:
patch.txt

Ryan

unread,
Jul 23, 2013, 11:03:35 AM7/23/13
to red5in...@googlegroups.com
solomax. Forgot to remove messageExecutor bean in red5-core.xml.

在 2013年7月23日星期二UTC+8下午10时45分54秒,Ryan写道:

solomax

unread,
Jul 31, 2013, 11:59:26 PM7/31/13
to red5in...@googlegroups.com
Hello Ryan,

I have just try your patch (with small modifications: )

Unfortunately it fails with the following exception:

java.lang.NoSuchMethodError: org.red5.server.net.rtmp.RTMPConnection.setExecutor(Lorg/springframework/scheduling/concurrent/ThreadPoolTaskExecutor;)V
at org.red5.client.net.rtmp.RTMPClientConnManager.createConnectionInstance(RTMPClientConnManager.java:121) ~[red5-client-1.0.2-RC1.jar:1.0.2-RC1]
at org.red5.client.net.rtmp.RTMPClientConnManager.createConnection(RTMPClientConnManager.java:78) ~[red5-client-1.0.2-RC1.jar:1.0.2-RC1]
at org.red5.client.net.rtmpt.RTMPTClientConnector.openConnection(RTMPTClientConnector.java:172) ~[red5-client-1.0.2-RC1.jar:1.0.2-RC1]
at org.red5.client.net.rtmpt.RTMPTClientConnector.run(RTMPTClientConnector.java:88) ~[red5-client-1.0.2-RC1.jar:1.0.2-RC1]

@Paul can you please take a look at the patch?
Or maybe you already have working version?

Thanks in advance! :)
Reply all
Reply to author
Forward
0 new messages