こんにちは、スレッドを実行すると例外 NoClassDefFoundError が発生しました。このプロセスは、スレッドなしで実行するとうまく実行されますが、開始メソッドを実行すると、別のステートメントでこのエラーが発生しました
スレッドがメインスレッドとは異なるクラスパスを取得した可能性はありますか?
コードを追加するために編集していただきありがとうございます
実行方法:
public void run(){
try{
boolean startAction = HeapThread.addAction(idCliente, idThread, Constants.ACTION_CREATE_TOPIC);
if (!startAction) {
synchronized (this){
this.wait();
}
}
createTopic();
}
catch(Exception ex){
log.error("Error", ex);
}
finally {
Long nextIdThread = HeapThread.getNextAction(idCliente, idThread, Constants.ACTION_CREATE_TOPIC);
if (nextIdThread > 0){
log.debug("Thread");
ThreadState thread = HeapThread.getState(nextIdThread);
synchronized (thread) {
thread.notify();
}
}
}
}
createTopic() 関数は searchBlog() を呼び出し、そこでこれを呼び出します
try{
sessionId = SessionWS.createSession(url, false);
CrawlerSearch crawler = new CrawlerSearchAPIService(new URL(url + Constants.URL_CRAWLER), new QName(Constants.QNAME_CRAWLER, "CrawlerSearchAPIService")).getCrawlerSearchAPIPort();
// para cada topico obtnemos 10 blogs
for (Long idTopic : blogsTopics.keySet()) {
...
完全な例外は次のとおりです。
java.lang.NoClassDefFoundError: com/befasoft/common/business/webservices/client/Session
at com.befasoft.common.business.webservices.client.SessionAPIService.getSessionAPIPort(SessionAPIService.java:56)
at com.befasoft.common.business.webservices.SessionWS.createSession(SessionWS.java:21)
at com.humanlike.web.tools.Crawler.searchBlogs(Crawler.java:50)
at com.humanlike.web.theads.CreateTopic.createTopic(CreateTopic.java:164)
at com.humanlike.web.theads.CreateTopic.run(CreateTopic.java:63)