File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Creating Web Service for Apache Http Client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Creating Web Service for Apache Http Client" Watch "Creating Web Service for Apache Http Client" New topic

Creating Web Service for Apache Http Client

H S Kumar

Joined: Jun 08, 2011
Posts: 10
I am using Tomcat 5.5 and Axis2 and Ecliple 3.3 IDE. I have made an Apache Http client that is calling a Servlet deployed on my Tomcat server. That is working fine as standalone application. Here is the code :

But When I try to create a web Service for this Apache HttpCleint file and create .aar file and try to deploy the .aar file on Axis-2, I got error as "Faulty Service"

I am copying the error trace that comes on Axis-2 admin console :

Error: java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.( at org.apache.axis2.deployment.util.Utils.fillAxisService( at org.apache.axis2.deployment.ServiceBuilder.populateService( at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup( at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup( at org.apache.axis2.deployment.ServiceDeployer.deploy( at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy( at org.apache.axis2.deployment.DeploymentEngine.doDeploy( at org.apache.axis2.deployment.repository.util.WSInfoList.update( at org.apache.axis2.deployment.RepositoryListener.update( at org.apache.axis2.deployment.RepositoryListener.checkServices( at org.apache.axis2.deployment.RepositoryListener.startListener( at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository( at at org.apache.axis2.deployment.scheduler.Scheduler$ at java.util.TimerThread.mainLoop(Unknown Source) at Source) Caused by: java.lang.ClassNotFoundException: Class Not found : org.apache.http.client.methods.HttpUriRequest at org.apache.axis2.deployment.DeploymentClassLoader.findClass( at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 19 more

Please help me in Creating a Web Service for Apache HTTP Client java program.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
Are all the jar files that are needed for HttpClient in the WEB-INF/lib directory of Axis?
I agree. Here's the link:
subject: Creating Web Service for Apache Http Client
jQuery in Action, 3rd edition