java错误的类文件,java“类文件包含错误的类”;错误

I'm trying to make a console application to test my webservice.

I successfully deployed a webservice at http://localhost:8080/WS/myWS

and i made proxy classes with wsimport:

wsimport -d bin -s src http://localhost:8080/WS/myWS?wsdl

Now my webservice classes are located in bin/mywebservice/ and i'm trying to compile my client class with classpath = ./

Here's the source code of my class:

import bin.mywebservice.myClass_Service;

public class TesterApp{

public static void main (String args[])

{

myClass_Service service = new myClass_Service();

}

}

And i have error:

TesterApp.java:1: error: cannot access myClass_Service

import bin.mywebservice_Service.myClass;

^

bad class file: .\bin\mywebservice\myClass_Service.class

class file contains wrong class: mywebservice.myClass_Service

Please remove or make sure it appears in the correct subdirectory of the classpath.

please help, what's wrong with myClass_Service?

i swear, myClass_Service.class exists in .\bin\mywebservice\

解决方案

You're incorrectly including the bin in the import declaration.

Rather put bin on the classpath and correct the import.

Unless (the poorly-named) myClass_Service.java file is package bin.mywebservice (which it isn't, according the the error message), you're trying to correct the problem in the wrong place.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值