Я пытаюсь сделать следующий скрипт: Пример 35.18. Ограничения вхождения
Я написал точно такой же код в примере:
@XmlType(name = "ClubEvent", propOrder = {
"memberNameOrGuestName"
})
public class ClubEvent {
@XmlElementRefs({
@XmlElementRef(name = "GuestName", type = JAXBElement.class),
@XmlElementRef(name = "MemberName", type = JAXBElement.class)
})
protected List<JAXBElement<String>> memberNameOrGuestName;
public List<JAXBElement<String>> getMemberNameOrGuestName() {
if (memberNameOrGuestName == null) {
memberNameOrGuestName = new ArrayList<JAXBElement<String>>();
}
return this.memberNameOrGuestName;
}
}
Но у меня возникает ошибка при попытке запустить приложение Spring Boot:
Caused by: javax.xml.ws.WebServiceException: java.lang.IllegalArgumentException: can't parse argument number: ''{0}''
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:375)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:255)
at it.uirnet.pcso.adapter.apiservicemanager.configuration.WebServiceConfig.endpoint(WebServiceConfig.java:83)
at it.uirnet.pcso.adapter.apiservicemanager.configuration.WebServiceConfig$$EnhancerBySpringCGLIB$$7b1da06a.CGLIB$endpoint$2(<generated>)
at it.uirnet.pcso.adapter.apiservicemanager.configuration.WebServiceConfig$$EnhancerBySpringCGLIB$$7b1da06a$$FastClassBySpringCGLIB$$5cfa9528.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
at it.uirnet.pcso.adapter.apiservicemanager.configuration.WebServiceConfig$$EnhancerBySpringCGLIB$$7b1da06a.endpoint(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
Мой проект работает с Spring Boot с Apache CXF 3.2.7. В классе конфигурации это код, например, конечная точка:
@Bean(name = "ship")
public Endpoint endpoint() {
EndpointImpl endpoint = new EndpointImpl(bus(), new ShipImpl(shipDAO, callerDAO));
endpoint.publish("/ship");
return endpoint;
}