Hii,
I tried to connect to a URL from my client and tried to extract information from it. Thing is that I can display the contents in node termila but its working continuously and the task is not finishing up. The log file erros are as follows.
-------------------------------------------------------------------------
2006-12-13 10:00:34,921 [INFO ][org.jppf.node.NodeLauncher.main(63)]: starting node
2006-12-13 10:00:59,406 [ERROR][org.jppf.server.node.JPPFNode.run(152)]: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream
java.io.NotSerializableException: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at org.jppf.utils.ObjectSerializerImpl.serialize(ObjectSerializerImpl.java:55)
at org.jppf.utils.SerializationHelperImpl.writeNextObject(SerializationHelperImpl.java:174)
at org.jppf.server.node.JPPFNode.writeResults(JPPFNode.java:373)
at org.jppf.server.node.JPPFNode.perform(JPPFNode.java:198)
at org.jppf.server.node.JPPFNode.run(JPPFNode.java:143)
at org.jppf.node.NodeLauncher.main(NodeLauncher.java:71)
----------------------------------------------------------
pls get me a solution for the same.
my taks code is as follows.
----------------------------------------------------------
package sample.hello;
import org.jppf.server.protocol.JPPFTask;
import java.net.*;
import java.io.*;
public class FileDownloadTestTask extends JPPFTask
{
URL url;
InputStream is;
String str=null;
public FileDownloadTestTask(URL url) throws MalformedURLException{
this.url=url;
System.out.println("Constructing Task... ");
System.out.println("First : "+url.getPort());
}
public void run(){
try{
int c,k=0;
is=url.openStream();
char[] ch=new char[is.available()];
if(is.available()>0){
int i=is.available();
while(((c=is.read())!= -1)&&(--i > 0)){
ch[k++]=(char)c;
}
}
// BufferedReader br=new BufferedReader(new InputStreamReader(is));
// str=br.readLine();
str=new String(ch);
System.out.println(str);
}
catch(Exception e){
e.printStackTrace();
}
}
public Object getResult(){
return str;
}
}
----------------------------------------------------------------
pls get me a solution.
regds - abhilash