Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
230 views
in Technique[技术] by (71.8m points)

java - Axis2 - always getting 404 errors

I'm trying to move some Web Service stubs from Metro to Axis2, however after generating my stubs using wsdl2java I'm constently getting 404 errors whenever I try and make a service call.

16/12/2010 11:14:57 AM org.apache.axis2.deployment.ModuleDeployer deploy
INFO: Deploying module: addressing-1.5.3-jar - file:/C:/Users/xxx/.m2/repository/org/apache/axis2/axis2/1.5.3/axis2-1.5.3-jar.jar
16/12/2010 11:14:57 AM org.apache.axis2.transport.http.HTTPSender sendViaPost
INFO: Unable to sendViaPost to url[xxxx]
org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found
    at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:307)
    at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:200)
    at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:438)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    at au.com.jpaterso.betcalc.axis2.tab.LoginStub.getKey(LoginStub.java:184)
    at au.com.jpaterso.betcalc.axis2.tab.Test.main(Test.java:13)
Exception in thread "main" org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found
    at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:307)
    at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:200)
    at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:438)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    at au.com.jpaterso.betcalc.axis2.tab.LoginStub.getKey(LoginStub.java:184)
    at au.com.jpaterso.betcalc.axis2.tab.Test.main(Test.java:13)

The URL that it's trying to connect to is definitely correct as I can access it via my browser/SoapUI.

Any help would be greatly appreciated!

Thanks, Joseph.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You didn't provide much information about the environment in which you try to deploy your WS. E.g. is this a webapp running under Tomcat/JBoss or maybe the standalone server deployed with Axis2?

From the trace that you have posted I suppose that there is a connection with your server but your WS is not successfully deployed. I assume that you may use the standalone server for your tests and I suggest:

  1. Go to your WS repository. On my test machine this would be something like ~/axis2-x.x.x/repository/services and make sure that your service is there (either the .aar file or the unpacked version).

  2. Start the server and check if your service is really deployed. On my installation, for example the server will generate the following output (not complete):

    me@melinuxpc:~/axis2-1.5.1/bin> ./axis2server.sh
    Using AXIS2_HOME: xxx
    Using JAVA_HOME: xxx
    Using JAVA_OPTS: -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n Listening for transport dt_socket at address: 8000 [INFO] [SimpleAxisServer] Starting [INFO] [SimpleAxisServer] Using the Axis2 Repository xxx [SimpleAxisServer] Using the Axis2 Repository xxx [SimpleAxisServer] Using the Axis2 Configuration File xxx [INFO] Clustering has been disabled [INFO] Deploying module: xxx [INFO] Deploying Web service: MyTestService - file: ~/axis2-1.5.1/repository/services/MyTestService/

Check if your web service is deployed and there are no errors. You may check if the WSDL of the service is available "in the browser". On my test machine the URL will be:

http://localhost:8080/axis2/services/MyTestService?wsdl

While a list with all deployed services may be seen at:

http://localhost:8080/axis2/services/

And do not be too quick in abandoning Axis2 ;)

Good luck!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...