Java XML публикация конечной точки веб-службы - PullRequest
0 голосов
/ 27 мая 2020

При попытке завершить ie этот проект я получил ошибку

package services;

import javax.xml.ws.Endpoint;


public class Exporter {
    public static void main(String[] args) {
        Endpoint.publish("http://localhost:8979/michal/ourpeople",
                new PersonServiceImpl());
    }
}

Exception in thread "main" com.sun.xml.ws.model.RuntimeModelerException: class: Server.PersonService could not be found
at com.sun.xml.ws.model.RuntimeModeler.getPortTypeName(RuntimeModeler.java:1589)
at com.sun.xml.ws.model.RuntimeModeler.getPortTypeName(RuntimeModeler.java:1572)
at com.sun.xml.ws.server.EndpointFactory.create(EndpointFactory.java:227)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:134)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:548)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:530)
at com.sun.xml.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:304)
at com.sun.xml.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:217)
at com.sun.xml.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:111)
at javax.xml.ws.Endpoint.publish(Unknown Source)
at services.Exporter.main(Exporter.java:8)

Что означает эта ошибка и как заставить ее работать правильно? Вот интерфейс PersonService. PersonServiceImpl просто реализует его

package services;

import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
import javax.jws.soap.SOAPBinding.Use;

import ReqRes.PersonRequest;
import ReqRes.PersonResponse;

@WebService
@SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL)
public interface PersonService {

//public static String URI = "";

@WebMethod
public PersonResponse getPeople(PersonRequest request);

}

Что мне делать?

РЕДАКТИРОВАТЬ: я немного переформатирую интерфейс и запускаю его с @WebService (// name = "IPersonSerice" , // targetNamespace = "http: / michal / Composite" //) и то же самое для PErsonServiceImpl, но теперь у меня другое исключение

Exception in thread "main" java.lang.NoClassDefFoundError: 
org/glassfish/gmbal/ManagedObjectManager
at com.sun.xml.ws.server.EndpointFactory.create(EndpointFactory.java:307)

Caused by: java.lang.ClassNotFoundException: 
org.glassfish.gmbal.ManagedObjectManager
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 10 more
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...