我在axis2上有一个webservice,在这个类中,一个函数启动一个线程,另一个函数检查线程是否仍在运行,但是当我请求检查线程是否仍在运行的函数时,我收到此错误:
org.apache.axis2.AxisFault:尝试在 org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531) 在 org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation) 调用服务方法 isTaskRunning 时发生异常.java:375) 在 org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421) 在 org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229) 在 org.apache.axis2。 client.OperationClient.execute(OperationClient.java:165) 在 be.kdg.cosys.thesis.ExecutorStub.isTaskRunning(ExecutorStub.java:487) 在 be.kdg.cosys.thesis.AllToPublicScheduler.executeTask(AllToPublicScheduler.java:158)在 be.kdg.cosys 的 be.kdg.cosys.thesis.AllToPublicScheduler.incomingApplication(AllToPublicScheduler.java:106)。论文.ParserToScheduler.run(ParserToScheduler.java:111) at java.lang.Thread.run(Unknown Source)
这是网络服务类:
公共类执行器{
private Task task = null;
private long startTime = 0;
private long runTime = 0;
private Thread taskThread=null;
public void execute(byte[] object){
ObjectInputStream in = null;
try {
in = new ObjectInputStream(new ByteArrayInputStream(object));
task = (Task) in.readObject();
in.close();
} catch (IOException | ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
runTime = task.getRunTime();
startTime = System.currentTimeMillis();
taskThread=new Thread(task);
taskThread.start();
}
public long timeToFinish()
{
return runTime-(System.currentTimeMillis()-startTime);
}
public boolean isTaskRunning()
{
return taskThread.isAlive();
}
public byte[] getTask()
{
byte[] ser=null;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutput out = null;
try {
out = new ObjectOutputStream(bos);
out.writeObject(task);
ser = bos.toByteArray();
out.close();
bos.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return ser;
}
}
在网络服务的服务器上,我得到一个 nullpointerexeception(catalina 的日志)
谁能帮我?
约里克