axis客户端问题 10
在客户端运行到这句ServiceobjService=newService();(importorg.apache.axis.client.Service;)出现如下问题...
在客户端运行到这句Service objService = new Service();(import org.apache.axis.client.Service;)出现如下问题
java.lang.NoSuchMethodError: org.apache.commons.logging.LogFactory.getClassLoader(Ljava/lang/Class;)Ljava/lang/ClassLoader;
at org.apache.commons.logging.impl.LogFactoryImpl.getClassLoader(LogFactoryImpl.java:447)
at org.apache.commons.logging.impl.LogFactoryImpl.initDiagnostics(LogFactoryImpl.java:476)
at org.apache.commons.logging.impl.LogFactoryImpl.<init>(LogFactoryImpl.java:95)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at org.apache.commons.discovery.tools.ClassUtils.newInstance(ClassUtils.java:111)
at org.apache.commons.discovery.tools.SPInterface.newInstance(SPInterface.java:151)
at org.apache.commons.discovery.tools.DiscoverClass.newInstance(DiscoverClass.java:533)
at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:372)
at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:332)
at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:41)
at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:33)
at org.apache.axis.handlers.BasicHandler.<clinit>(BasicHandler.java:43)
at org.apache.axis.client.Service.getAxisClient(Service.java:104)
at org.apache.axis.client.Service.<init>(Service.java:113)
at com.comtop.product.webservice.test.CimClient.main(CimClient.java:16)
Exception in thread "main"
在地址栏输入:http://127.0.0.1:7001/web/services/CimMoudelExportService
可以显示:
CimMoudelExportService
Hi there, this is an AXIS service!
Perhaps there will be a form for invoking the service here...
====================================================================
代码:
import org.apache.axis.client.Service;
public class CimClient {
public static void main(String[] args) {
String url = "http://127.0.0.1:7001/web/services/CimMoudelExportService";
Service objService = new Service();
}
}
=============
OK,已经解决,主要是版本问题,可能和其他包有冲突,调正jar包顺序即可 展开
java.lang.NoSuchMethodError: org.apache.commons.logging.LogFactory.getClassLoader(Ljava/lang/Class;)Ljava/lang/ClassLoader;
at org.apache.commons.logging.impl.LogFactoryImpl.getClassLoader(LogFactoryImpl.java:447)
at org.apache.commons.logging.impl.LogFactoryImpl.initDiagnostics(LogFactoryImpl.java:476)
at org.apache.commons.logging.impl.LogFactoryImpl.<init>(LogFactoryImpl.java:95)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at org.apache.commons.discovery.tools.ClassUtils.newInstance(ClassUtils.java:111)
at org.apache.commons.discovery.tools.SPInterface.newInstance(SPInterface.java:151)
at org.apache.commons.discovery.tools.DiscoverClass.newInstance(DiscoverClass.java:533)
at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:372)
at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:332)
at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:41)
at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:33)
at org.apache.axis.handlers.BasicHandler.<clinit>(BasicHandler.java:43)
at org.apache.axis.client.Service.getAxisClient(Service.java:104)
at org.apache.axis.client.Service.<init>(Service.java:113)
at com.comtop.product.webservice.test.CimClient.main(CimClient.java:16)
Exception in thread "main"
在地址栏输入:http://127.0.0.1:7001/web/services/CimMoudelExportService
可以显示:
CimMoudelExportService
Hi there, this is an AXIS service!
Perhaps there will be a form for invoking the service here...
====================================================================
代码:
import org.apache.axis.client.Service;
public class CimClient {
public static void main(String[] args) {
String url = "http://127.0.0.1:7001/web/services/CimMoudelExportService";
Service objService = new Service();
}
}
=============
OK,已经解决,主要是版本问题,可能和其他包有冲突,调正jar包顺序即可 展开
展开全部
我也碰到伏丛这个问题了,最后是在Order and Export中调整了顺漏枣序,因为Service类在缺搜樱axis.jar中,所以把它移至最后,最后Service service=new Service(),就不报错了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询