[SourceJammer-users] using SimpleInterface to connect
Brought to you by:
robertmacgrogan
From: Riccardo C. <rc...@ar...> - 2005-07-28 12:12:42
|
Hi I want to congratulate the developers of the simpletools.SimpleInterface api. It is really easy to use. I've coded a class to access the archive from client side, and have a connection error : java.lang.NullPointerException at org.sourcejammer.client.gui.CommandCentral.connectToArchive(Unknown Source) at org.sourcejammer.client.simpletools.SimpleInterface.connect(Unknown Source) at jammerlist.main(jammerlist.java:30) Apart from the fact that I do not congratulate the dev team for those numerous null pointer exceptions :) is there any way to have info about the error ? (the source does not provide a jar with both java and class, so the exception cannot give the line where it appears) I tried to compile source on unix, but it needs ant, so I downloaded ant but it needs sun jdk (i'm using ibm one) so I downloaded sunjdk but it needs libc++6 so i downloaded it but it needs libstdc++-libc6.1-1.so.2 so I forgave :( This is my code: Thanks Riccardo Cohen import java.lang.*; import java.util.*; import java.sql.*; import java.io.*; import java.net.*; import org.sourcejammer.client.simpletools.*; import org.sourcejammer.project.view.*; public class jammerlist { public static void main(String[] args) { boolean fail=false; Project proj=null; if (args.length==0) System.out.println("syntax : jammerlist c:\\jammer\\conf"); SimpleInterface si=SimpleInterface.getInstance(); fail=(si==null); if (fail) System.out.println("si null"); if (!fail) { try{si.setConfDirectory(args[0]);}catch(Exception ex){fail=true;} if (fail) System.out.println("conf err"); } if (!fail) { try{proj=si.connect("develjava","http://jam.articque.com/servlet/rpcrouter", "rcohen","zzzz");}catch(Exception ex){ex.printStackTrace();fail=true;} if (fail) System.out.println("connect err"); } if (!fail) { fail=proj==null; if (fail) System.out.println("proj null"); } if (!fail) { int count=proj.childCount(); System.out.println("count="+count); } if (!fail) { try{si.disconnect();}catch(Exception ex){fail=true;} if (fail) System.out.println("disconnect err"); } System.out.println(fail?"failed":"ok"); } } |