java noclassdeffound_线程“ main”中的异常java.lang.NoClassDefFoundE...

在这里,我正在尝试通过wsdl使用Web服务进行调用,同时运行代码以获取以下异常.

同时显示测试代码,请帮帮我.谢谢.

import org.apache.axis.client.Service;

import org.apache.axis.client.Call;

import org.apache.commons.codec.binary.Base64;

import javax.xml.namespace.QName;

import java.net.URL;

public class WebTest {

Service service = null;

String endpoint = "http://mytest.com/test/Signup.jws";

String userName = "globel";

String userPw = new String(Base64.decodeBase64("Z23fG46732345FG=".getBytes()));;

public WebTest() {

try {

service = new Service();

System.out.println("*** executed successfully ");

} catch (Exception e) {

System.out.println("Exception - " + e.getMessage());

}

}

public void testWeb(String f1, String f2, String f3, int itemcode, String f4){

try {

Call call = (Call)service.createCall();

call.setTargetEndpointAddress(new URL(endpoint));

call.setOperationName(new QName("emp"));

call.setUsername(userName);

call.setPassword(userPw);

Object[] params = new Object[5];

params[0] = new String(f1);

params[1] = new String(f2);

params[2] = new String(f3);

params[3] = new Integer(itemcode);

params[4] = new String(f4);

call.invoke(params);

} catch (Exception e) {

System.out.println("Exception - " + e.getMessage());

}

}

public static void main(String[] args) {

String orderDate = "03-Jan-2013";

WebTest webtest= new WebTest() ;

webtest.testWeb("rayban","aviator",orderDate,82724,"113000") ;

}

}

getting following error –

Exception in thread “main” java.lang.NoClassDefFoundError:

org/apache/commons/discovery/tools/DiscoverSingleton 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.(LogFactory.java:33)

at

org.apache.axis.handlers.BasicHandler.(BasicHandler.java:43)

at org.apache.axis.client.Service.getAxisClient(Service.java:207) at

org.apache.axis.client.Service.(Service.java:225)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值