When you run schema generation through JavaTest Agent, your generator will be executed in the Agent's JVM. Your implementation should provide a custom class, which implements the following interface:

package com.sun.jck.lib;

public interface SchemaGenTool {
    int generate(String[] args, PrintStream out, PrintStream err);
}

The invocation of the generate method should start schema generation.

The JCK devtools test suite includes the following class that is fully compatible with Oracle's reference implementation and that can be used for schema generation: com.sun.jck.lib.SchemaGen. The realization of the method

generate(String[] args, java.io.PrintStream out, java.io.PrintStream err)
generates xml schema from java file(s).

If your implementation doesn't provide such a class, please, create it and specify it here.