我想在我的Red5服務器應用程序中使用JWT生成令牌代碼。當我通過本地JWT生成令牌代碼時,沒有任何錯誤。當我嵌入我產生的Red5服務器應用程序的令牌代碼,這個節目的異常如下:如何將我的代碼嵌入到red5服務器中?
[ERROR] [RTMPConnectionExecutor-1] org.red5.server.net.rtmp.BaseRTMPHandler - Exception
java.lang.NoClassDefFoundError: com/auth0/jwt/JWTSigner
at org.red5.jwt.util.JWTUtil.<clinit>(JWTUtil.java:23)
at org.red5.core.Application.connect(Application.java:68)
at org.red5.server.scope.Scope.connect(Scope.java:248)
at org.red5.server.BaseConnection.connect(BaseConnection.java:366)
at org.red5.server.net.rtmp.RTMPConnection.connect(RTMPConnection.java:486)
at org.red5.server.net.rtmp.RTMPMinaConnection.connect(RTMPMinaConnection.java:93)
at org.red5.server.net.rtmp.RTMPHandler.onCommand(RTMPHandler.java:337)
at org.red5.server.net.rtmp.BaseRTMPHandler.messageReceived(BaseRTMPHandler.java:116)
at org.red5.server.net.rtmp.ReceivedMessageTask.call(ReceivedMessageTask.java:72)
at org.red5.server.net.rtmp.ReceivedMessageTask.call(ReceivedMessageTask.java:38)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.auth0.jwt.JWTSigner
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
... 16 common frames omitted
我的代碼是這樣的:
public class Application extends MultiThreadedApplicationAdapter {
@Override
public boolean connect(IConnection conn, IScope scope, Object[] params) {
String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9";
PayLoadMapper userValid = JWTUtil.unsign(token, PayLoadMapper.class);
System.out.println(userValid);
}
}
爲什麼我不能嵌入我的API代碼到Red5的應用程序?這是我做錯的方式,我該怎麼辦?
是的,我確定。查看我說的答案。 – lee