2

I am trying to create my first webservice using eclipse javaEE under Axis2, i am following this turorial eclipse tutorial to learn how to make it.I make the webservice but when i want to assure that the ws has been deployed through viewing it through URL, an HTTP status 400 occure. How can I know what is the error?? here what i make exactly:

  • i make the settings in preferences [ ant , axis2, tomcat and java ].
  • New -> New dynamic web page
  • new ->java (I create the class i want to convert to ws)
  • new ->web service (i want to create bottom up ws).
  • type http://localhost:8080/Axis2/services/listservices in the url of browser

this what return HTTP Status 404 - /services/listservices

can some one tell me how can i know what is the error? or how can i define it?

EDIT: an exception happen in the console of eclipse which is :

org.apache.axis2.transport.http.AxisAdminServlet java.lang.ClassNotFoundException: org.apache.axis2.transport.http.AxisAdminServlet

what should I do ,in the configuration i specify where is axis2 and eclipse shows

Axis2 runtime loaded successfully

after creating new work space and create webservice again, this is the output appears in console

 Dec 20, 2010 8:32:04 PM org.apache.catalina.core.AprLifecycleListener init
 INFO: The APR based Apache Tomcat Native library which allows optimal performance in 
production environments was not found on the java.library.path: C:\Program      
 Files\Java\jdk1.6.0_18\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;F:/alaa college/year 4/1st   
 semester/Advance sw/Libraries/eclipse/jre/bin/client;F:/alaa college/year 4/1st    
semester/Advance sw/Libraries/eclipse/jre/bin;D:\app\AloOoSh\product\11.1.0\db_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_18\bin;%ANT_HOME%\bin;%AXIS2_HOME%\bin;%CATALINA_HOME%\bin;C:\Program Files\MATLAB\R2008a\bin;C:\Program Files\MATLAB\R2008a\bin\win32;
Dec 20, 2010 8:32:05 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source'     
to 'org.eclipse.jst.jee.server:testFirst' did not find a matching property.
 Dec 20, 2010 8:32:05 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Dec 20, 2010 8:32:05 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 401 ms
Dec 20, 2010 8:32:05 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina

Dec 20, 2010 8:32:05 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
[INFO] Deploying module: addressing-1.4 -     file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testF
 irst/WEB-INF/modules/addressing-1.4.mar
[INFO] Deploying module: metadataExchange-1.4 -    
 file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/mex-1.4.mar
 [INFO] Deploying module: ping-1.4 -    
 file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/ping-1.4.mar
 [INFO] Deploying module: script-1.4 -  file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/scripting-1.4.mar
 [INFO] Deploying module: smtpfault - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/smtpfault.mar
[INFO] Deploying module: soapmonitor-1.4 - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/soapmonitor-1.4.mar
 [INFO] Deploying Web service: Converter - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/services/Converter/
[INFO] Deploying Web service: version.aar - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/services/version.aar
 Dec 20, 2010 8:32:06 PM org.apache.coyote.http11.Http11Protocol start
 INFO: Starting Coyote HTTP/1.1 on http-8080
 Dec 20, 2010 8:32:06 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Dec 20, 2010 8:32:06 PM org.apache.jk.server.JkMain start
 INFO: Jk running ID=0 time=0/19  config=null
Dec 20, 2010 8:32:06 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1383 ms
bluish
  • 26,356
  • 27
  • 122
  • 180
palAlaa
  • 9,500
  • 33
  • 107
  • 166

3 Answers3

3

These is my own post to creating webservice and use that service in android. its work properly.

Try this once below link

http://lukencode.com/2010/04/27/calling-web-services-in-android-using-httpclient/#comment-179

PrashantAdesara
  • 1,897
  • 3
  • 22
  • 41
1

The 404 error occurs because there is nothing at the desired url. So there must have been something wrong with your deployment.

Have you set up a server in eclipse and actually published the WS at all? Note that this is different from running Tomcat from a directory somewhere else on your computer! You can add a server instance by selecting New => Server.

If the server configuration is otherwise correct, the server output should appear in eclipse's console, and if anything is wrong with your WS setup, there should be error messages you can use to track down the problem.

weltraumpirat
  • 22,544
  • 5
  • 40
  • 54
  • @weltraumpirat -yes there's an exception in the console , it's about axis2 .can u please check the Edit part. – palAlaa Dec 20 '10 at 17:57
  • This is definitely a configuration issue. The way I understand it, the AdminServlet is not part of the core Axis2 runtime. Do you deploy Axis2 as a library within the web service, or is it installed separately on the server? You need to set the classpath accordingly. If you haven't done a lot of changes yet, just go back up in your tutorial and make sure you've done all the necessary steps to set up Axis2 correctly. This should be a lot quicker than trying to find the error. – weltraumpirat Dec 20 '10 at 18:11
  • I create new work space and create new web service , no error occure but it doesn't run on URK :( – palAlaa Dec 20 '10 at 18:35
  • Can you post the entire output from the console? Otherwise the problem is quite hard to track down. – weltraumpirat Dec 20 '10 at 18:52
  • This seems to be the only odd message: Dec 20, 2010 8:32:05 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:testFirst' did not find a matching property. – weltraumpirat Dec 20 '10 at 20:23
  • Is "testFirst" the name of your WebService? – weltraumpirat Dec 20 '10 at 20:23
  • Hm, okay that's not it. Here's how to get rid of the warning: http://stackoverflow.com/questions/104854/setpropertiesrule-warning-message-when-starting-tomcat-from-eclipse/744872#744872 – weltraumpirat Dec 20 '10 at 20:45
  • Can you access the Tomcat default page at localhost:8080 ? – weltraumpirat Dec 20 '10 at 20:45
  • No,I can't. When i press double click on server, i found that i can specify server location.I think here's the point, the problem is that all options are disable. – palAlaa Dec 20 '10 at 21:10
  • I think you have a firewall problem. Are you sure port 8080 is open and/or you have disabled your firewall? – weltraumpirat Dec 20 '10 at 21:12
  • i turn firewall off , but the same. I think the problem is where i said in the previous comment "specify server location", but it's disable!! – palAlaa Dec 20 '10 at 21:18
  • Because it's running. But the server started up alright. So if you're not getting the default page, something is wrong with the port binding. Have you tried http://127.0.0.1:8080/ ? – weltraumpirat Dec 20 '10 at 21:19
  • I stop it , restart eclipse , also disable :( – palAlaa Dec 20 '10 at 21:21
  • I just tried running my own Tomcat from eclipse. The console output looks just about the same. But if I call http://localhost:8080 from the browser, I get the default page as expected. – weltraumpirat Dec 20 '10 at 21:31
  • So there must be something else wrong. Are you SURE you have disabled all firewalls and/or opened port 8080? Could you be running more than one firewall, maybe a custom one and some built-in Windows firewall? – weltraumpirat Dec 20 '10 at 21:33
  • I disable only winodws firewal. But how can I open port 8080 manually? – palAlaa Dec 21 '10 at 05:02
  • I'm afraid I cannot help you with that, since I don't run Windows, and I don't know which program you are using. But alright, first things first: Turn of ALL firewalls. Then check your Tomcat. If it runs, turn the firewalls back on and mark this question as answered. After that, please consult your manual or the vendor's web site on how to add a new rule opening port 8080. Or post a new question on that, but remember to say which firewall you are using (the program name), so that other people know what you are trying to do. – weltraumpirat Dec 21 '10 at 05:18
  • I am using AVG anti virus,I turn every firewall in my system down,but nothing works. I try to use GlassFish server using netbeans and run it, it works properly. Can i use it in eclipse instead of Tomcat v6?? – palAlaa Dec 21 '10 at 05:33
  • Of course you can. Select New => Server and choose Glassfish as your runtime. – weltraumpirat Dec 21 '10 at 05:41
0

You probably extracted the contents of axis2.war (renamed to app.zip) into the wrong folder or deployed files to the wrong folder. Look for the WEB-INF folder directly under the app.war folder that you deployed. If you have another folder of WEB-INF for the axis2 extracted folders, then JBoss cannot locate them. The WEB-INF folder must be a folder as a 1st level descendant. Along with the following folders: axis2-web, META-INF and org.

JustBeingHelpful
  • 18,332
  • 38
  • 160
  • 245