我下载的是最新openmeetings代码
服务端(http://openmeetings.googlecode.com/svn/trunk/webapp)
客户端(http://openmeetings.googlecode.com/svn/trunk/openmeetings_lps411)
这两个代码在ECLIPSE用SVN CHECK到项目中,运行调试就行了
在演讲里导入文件时经常出现死线程,原因是openmeetings代码有问题
1.先写一个这个类
package org.openmeetings.app.documents;
import java.lang.*;
import java.io.*;
import org.red5.logging.Red5LoggerFactory;
import org.slf4j.Logger;
public class StreamGobbler implements Runnable {
private static final Logger log = Red5LoggerFactory.getLogger(StreamGobbler.class, "openmeetings");
String name;
InputStream is;
Thread thread;
public StreamGobbler (String name, InputStream is) {
this.name = name;
this.is = is;
}
public void start () {
thread = new Thread (this);
thread.start ();
}
public void run () {
try {
InputStreamReader isr = new InputStreamReader (is);
BufferedReader br = new BufferedReader (isr);
while (true) {
String s = br.readLine ();
if (s == null) break;
log.debug("[" + name + "] " + s);
}
is.close ();
} catch (Exception ex) {
log.debug("Problem reading stream " + name + "... :" + ex);
ex.printStackTrace ();
}
}
}
2.找到org.openmeetings.app.documents中的GenerateSWF类
把executeScript方法里的类容,修改为
static HashMap<String, Object> executeScript(String process, String[] argv) {
HashMap<String, Object> returnMap = new HashMap<String, Object>();
returnMap.put("process", process);
log.debug("process: " + process);
log.debug("args: " + Arrays.toString(argv));
try {
Runtime rt = Runtime.getRuntime();
returnMap.put("command", Arrays.toString(argv));
Process p = rt.exec(argv);
StreamGobbler s1 = new StreamGobbler ("stdin", p.getInputStream ());
StreamGobbler s2 = new StreamGobbler ("stderr", p.getErrorStream ());
s1.start ();
s2.start ();
int exitVal=p.waitFor();
log.debug("exitVal: " + exitVal);
returnMap.put("exitValue", exitVal);
} catch (Throwable t) {
t.printStackTrace();
returnMap.put("error", t.getMessage());
returnMap.put("exitValue", -1);
}
return returnMap;
}
ok,现在不管是导ppt,word,还是图片都行