Search code examples
javakurento

ProtocolException in getChildren()


When I try to call getChildren() on the mediapipeline which has my custom module endpoint running in it I'm getting this exception:

org.kurento.client.internal.server.ProtocolException: Exception creating Java Class for mycustomfilter.MyCustomFilter

This is the code which triggers it:

List<MediaObject> mediaObjects = pipelines.get(i).getChildren();

Do I have to cast the List<MediaObject> to some other data type?


Solution

  • When you create a custom media element for KMS, you can also create the client API for Java and JavaScript (see doc here). In your case, you need to create the Java client for your filter, as follows:

    cmake .. -DGENERATE_JAVA_CLIENT_PROJECT=TRUE
    

    The resulting Java classes (package mycustomfilter.MyCustomFilter in your example) should be in the classpath of the project which calls to getChildren() (internally it calls to Class.forName, see code here).