InputStream in = loader.getResourceAsStream("META-INF/ejb-jar.xml");
EjbJarDocument jar = EjbJarDocument.Factory.parse(in);
Validator v =new EjbValidator();
v.initialize(new PrintWriter(new OutputStreamWriter(System.out), true), args[0], loader, ModuleType.EJB, new XmlObject[]{jar}, null);
System.out.println("Validation Result: "+v.validate());
} catch(Exception e) {
e.printStackTrace();
}
}
}