problem with a java class converting in web service

S

SatBoy78

Hi,

I've created a java class that download in a local folder a csv file from
yahoo (containing the mib30 value) and then extract this value and return
it... Ive tried running this class and it works fine

now I want to transform this java class in a web service... I've got
eclipse, wtp and axis2 plugins, and I'm following this tutorial
(http://wso2.org/library/1719) to make the conversion of the java class in a
web service

My problem is that after i make aar file for the service and import this
into axis2, when I call http://localhost:8080/axis2/services I see that my
service is faulty, and clicking on link I see these errors



Error: org.apache.axis2.deployment.DeploymentException: Processing
Operations Modules Error in schema generating FornisciValore; nested
exception is: java.lang.ClassNotFoundException: FornisciValore; nested
exception is: org.apache.axis2.deployment.DeploymentException: Error in
schema generating FornisciValore; nested exception is:
java.lang.ClassNotFoundException: FornisciValore; nested exception is:
org.apache.axis2.deployment.DeploymentException: Processing Operations
Modules Error in schema generating FornisciValore; nested exception is:
java.lang.ClassNotFoundException: FornisciValore; nested exception is:
org.apache.axis2.deployment.DeploymentException: Error in schema generating
FornisciValore; nested exception is: java.lang.ClassNotFoundException:
FornisciValore at
org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:139)
at
org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:528)
at
org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:196)
at
org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:227)
at
org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:174)
at
org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:219)
at
org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:61)
at
org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:68)
at
org.apache.axis2.deployment.scheduler.Scheduler$SchedulerTimerTask.run(Scheduler.java:76)
at java.util.TimerThread.mainLoop(Timer.java:512) at
java.util.TimerThread.run(Timer.java:462) Caused by:
org.apache.axis2.deployment.DeploymentException: Processing Operations
Modules Error in schema generating FornisciValore; nested exception is:
java.lang.ClassNotFoundException: FornisciValore; nested exception is:
org.apache.axis2.deployment.DeploymentException: Error in schema generating
FornisciValore; nested exception is: java.lang.ClassNotFoundException:
FornisciValore at
org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:332)
at
org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:91)
at
org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:133)
.... 10 more Caused by: org.apache.axis2.deployment.DeploymentException:
Error in schema generating FornisciValore; nested exception is:
java.lang.ClassNotFoundException: FornisciValore at
org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:307)
.... 12 more Caused by: java.lang.ClassNotFoundException: FornisciValore at
java.net.URLClassLoader$1.run(URLClassLoader.java:200) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:188) at
java.lang.ClassLoader.loadClass(ClassLoader.java:306) at
java.lang.ClassLoader.loadClass(ClassLoader.java:251) at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:247) at
org.apache.ws.java2wsdl.SchemaGenerator.(SchemaGenerator.java:92) at
org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:272) at
org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:297)
.... 12 more



Now I can't understand because my java class works fine, and when I convert
it in a web service doesn't work

Could you please help me? thanks a lot

This is the source code of my java class:


import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;


public class FornisciValore {

/**
* @param args
*/

public static int returnValore () throws IOException
{

try
{
URL url = new URL("http://tinyurl.com/2ttw75");
InputStream is = url.openStream();
System.out.flush();
FileOutputStream fos=null;
fos = new FileOutputStream("C:\\WSmib30\\quotes.csv");
int oneChar, count=0;
while ((oneChar=is.read()) != -1)
{
fos.write(oneChar);
count++;
}
is.close();
fos.close();
}
catch (MalformedURLException e)
{ System.err.println(e.toString()); }
catch (IOException e)
{ System.err.println(e.toString()); }

BufferedReader filebuffer = new BufferedReader(new
FileReader("C:\\WSmib30\\quotes.csv"));
String next,ultimo;
next=filebuffer.readLine();
filebuffer.close();
ultimo=next.substring(7,12);
System.out.println(ultimo); //print on screen mib30 value
int valore = Integer.parseInt(ultimo); //convert mib30 string in an
integer value
return(valore); // returns mib30 value

}

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,061
Latest member
KetonaraKeto

Latest Threads

Top