SessionFactory.getInstance().setCredentials(credentials);
try {
Session session = SessionFactory.getInstance().getSession(false);
System.out.println("logging in");
final GraphicManager gm = graphicManager;
SessionFactory.callNoEx(session,"login",new Class[]{Closure.class},new Object[]{new Closure(){
public void execute(Object arg0) {
Map<String,String> env=(Map<String,String>)arg0;
if (env!=null){
String serverVersion=env.get("serverVersion");
checkServerVersion(serverVersion);