[Red5] Bug or Stupidity: SharedObject.getStatistics() throws exception
clemos
cl3mos at gmail.com
Tue Nov 20 07:51:48 PST 2007
hi thomas
I'm not an expert, but I did experience the fact that Shared Object
become null and throw nullPointerExceptions when no clients are
connected to the app or to them ...
(my Java jargon is probably very bad, but ...)
does this bug happen when no client is connected to the SO or app ?
if so, you should check somewhere that your "so" var is not null (or
do this "try - - - catch - - - -" stuff ...)
once again, take these advices as those of a person who started
learning Java directly with Red5, who went through this problem, and
somewhat solved it...
by the way, I also find this weird that SOs become null when nobody's
connected... but I guess that's the way it is !
++++++
clément
On Nov 20, 2007 4:32 PM, Thomas Auge <auge at virtues.net> wrote:
> Hi all,
>
> This function:
>
> public int numClients(String soname)
> {
> Red5 r5 = new Red5();
> IScope scope = r5.getScope();
> ISharedObjectService sos = new SharedObjectService();
> ISharedObject so = sos.getSharedObject(scope, soname);
> ISharedObjectStatistics sostat = so.getStatistics();
> return sostat.getActiveListeners();
> }
>
>
> Gets me this exception:
>
> [ERROR] 2007-11-20 16:20:54,304 pool-3-thread-7:(
> org.red5.server.service.ServiceInvoker.invoke ) Error executing call:
> Service: null Met
> hod: numClients Num Params: 10: VAGallg
> [ERROR] 2007-11-20 16:20:54,304 pool-3-thread-7:(
> org.red5.server.service.ServiceInvoker.invoke ) Service invocation error
> java.lang.reflect.InvocationTargetException
> at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.red5.server.service.ServiceInvoker.invoke(ServiceInvoker.java:217)
> at
> org.red5.server.service.ServiceInvoker.invoke(ServiceInvoker.java:123)
> at
> org.red5.server.net.rtmp.RTMPHandler.invokeCall(RTMPHandler.java:163)
> at
> org.red5.server.net.rtmp.RTMPHandler.onInvoke(RTMPHandler.java:431)
> at
> org.red5.server.net.rtmp.BaseRTMPHandler.messageReceived(BaseRTMPHandler.java:143)
> at
> org.red5.server.net.rtmp.RTMPMinaIoHandler.messageReceived(RTMPMinaIoHandler.java:120)
> at
> org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:570)
> at
> org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
> at
> org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
> at
> org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
> at
> org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220)
> at
> org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.NullPointerException
> at org.red5.camChat.Application.numClients(Application.java:156)
> ... 18 more
>
>
>
> Line 156 is "ISharedObjectStatistics sostat = so.getStatistics();".
> Using 0.6.3 with JDK 1.6.0_05
>
> Is it me or is this a bug?
>
> Thanks,
>
> Thomas
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
More information about the Red5
mailing list