Apache Axis ConfigurationException
Asked Answered
C

5

16

I am using Apache Axis to connect my Java app to a web server. I used wsdl2java to create the stubs for me, but when I try to use the stubs, I get the following exception:

org.apache.axis.ConfigurationException: No service named `<web service name>` is available

What is happening?

Commissioner answered 15/9, 2008 at 18:13 Comment(0)
D
2

Just a guess, but it looks like that error message is reporting that you've left the service name blank. I imagine the code that generates that error message looks like this:

throw new ConfigurationException("No service named" + serviceName + " is available");
Domela answered 7/10, 2008 at 16:56 Comment(0)
S
22

According to the documentation linked to by @arnonym, this exception is somewhat misleading. In the first attempt to find the service a ConfigurationException is thrown and caught. It is logged at DEBUG level by the ConfigurationException class. Then another attempt is made using a different method to find the service that may then succeed. The workaround for this is to just change the log level on the ConfigurationException class to INFO in your log4j.properties:

log4j.logger.org.apache.axis.ConfigurationException = INFO
Sutphin answered 31/7, 2013 at 21:19 Comment(0)
D
2

Just a guess, but it looks like that error message is reporting that you've left the service name blank. I imagine the code that generates that error message looks like this:

throw new ConfigurationException("No service named" + serviceName + " is available");
Domela answered 7/10, 2008 at 16:56 Comment(0)
R
1

It is an exception used by Axis' control flow.

http://wiki.apache.org/ws/FrontPage/Axis/DealingWithCommonExceptions --> org.apache.axis.ConfigurationException: No service named XXX is available

Ruddock answered 27/6, 2011 at 16:45 Comment(0)
E
0

This is what my code looks like. It seems to work fine. Are you using a service locator or just creating your service?

SomeServiceLocator locator = new SomeServiceLocator();
SomeService service = null;
try
{
    service = locator.getSomeServiceImplPort();
}
catch (ServiceException e)
{
    e.printStackTrace();
}
Ectoderm answered 15/9, 2008 at 18:45 Comment(0)
B
0

I don't know what version of Axis you're using but I'm using Axis2 for both server and client and the Java2WSDL create a default endpoint for the service on localhost. If you create the client stub with WSDL2Java, the default constructor of the stub will then point to localhost. If the service is on other endpoint you must use the constructor with the endpoint as parameter... Maybe the problem is not that at all but as said on other answers, without the WSDL you're using as WSDL2Java input it's hard to say.

Bowens answered 14/10, 2008 at 11:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.