Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/398.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java在端点中找不到接口_Java_Web Services_Jax Ws_Endpoint - Fatal编程技术网

Java在端点中找不到接口

Java在端点中找不到接口,java,web-services,jax-ws,endpoint,Java,Web Services,Jax Ws,Endpoint,我试图使用Java中的端点将设备中的方法公开为web服务。问题是,在创建端点时,我需要传入定义类的接口实现的实例,但在加载设备的计算机上找不到接口。例如: Endpoint anEndpoint = Endpoint.publish("http://localhost:8080/HelloWorldImpl", new HelloWorldImpl()); 但是没有找到HelloWorldImpl实现的接口 其他课程是 package application; @WebService pu

我试图使用Java中的端点将设备中的方法公开为web服务。问题是,在创建端点时,我需要传入定义类的接口实现的实例,但在加载设备的计算机上找不到接口。例如:

Endpoint anEndpoint = Endpoint.publish("http://localhost:8080/HelloWorldImpl", new HelloWorldImpl()); 
但是没有找到HelloWorldImpl实现的接口

其他课程是

package application;

@WebService
public interface IHelloWorld{
    @WebMethod
    public void speak();
}
实施计划如下:

package application;

@WebService(EndpointInterface="application.IHelloWorld")
public class HelloWorldImpl extends ClassForDeviceInteraction implements IHelloWorld{

    @Override
    public void speak(){
        //code that prints to a controller on the device
    }

    public void initialize(){
        //code that initializes stuff for the device
        Endpoint anEndpoint = Endpoint.publish("http://localhost:8080/
        HelloWorldImpl", new HelloWorldImpl()); 

    }

    public static void main(String [] args){
        //code to initialize the device
    }
}
它在我的电脑上编译得很好,但当我把它放在设备上时,我得到一个错误,说接口
IHelloWorld
找不到。我还没有找到任何类似的堆栈溢出


错误的原因可能是什么?有没有一种方法可以在我要传递到端点的类中声明接口,然后在“EndpointInterface”字段中引用它?

您使用的是哪个web框架?(Glassfish、JBoss/Wildfly等…?)我正在使用Jax-ws。