संभाल सकते हैं मैं जब मेरे आवेदन को तैनात करने की कोशिश कर निम्नलिखित अपवाद प्राप्त करने के लिए लग रहा था:java.util.List एक इंटरफेस है, और JAXB इंटरफेस
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
java.util.List is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at java.util.List
at private java.util.List foobar.alkohol.register.webservice.jaxws.GetRelationsFromPersonResponse._return
at foobar.alkohol.register.webservice.jaxws.GetRelationsFromPersonResponse
java.util.List does not have a no-arg default constructor.
this problem is related to the following location:
at java.util.List
at private java.util.List foobar.alkohol.register.webservice.jaxws.GetRelationsFromPersonResponse._return
at foobar.alkohol.register.webservice.jaxws.GetRelationsFromPersonResponse
मेरे कोड सिर्फ अच्छी तरह से काम जब तक मैं बदल सूची से वापसी प्रकार < सूची सूची में <RelationCanonical> >
यहाँ आंशिक वेब सेवा है:
@Name("relationService")
@Stateless
@WebService(name = "RelationService", serviceName = "RelationService")
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
public class RelationService implements RelationServiceLocal {
private boolean login(String username, String password) {
Identity.instance().setUsername(username);
Identity.instance().setPassword(password);
Identity.instance().login();
return Identity.instance().isLoggedIn();
}
private boolean logout() {
Identity.instance().logout();
return !Identity.instance().isLoggedIn();
}
@WebMethod
public List<List<RelationCanonical>> getRelationsFromPerson(@WebParam(name = "username")
String username, @WebParam(name = "password")
String password, @WebParam(name = "foedselsnummer")
String... foedselsnummer) {
......
......
......
}
मैंने @SOAP बाइंडिंग को हटाने और डिफ़ॉल्ट रूप से प्रयास करके भी कोशिश की है, लेकिन एक ही परिणाम होता है। किसी भी मदद
अद्यतन
मैं कुछ बाहर नोट करने के लिए चाहते हैं की सराहना। मैंने सभी सूची को ArrayList में बदल दिया, और फिर इसे संकलित किया। कारण मैं संकलित और काम नहीं करता क्योंकि यह अजीब व्यवहार करता है। मुझे टाइप का ऑब्जेक्ट मिलता है: RelationServiceStub.ArrayList लेकिन ऑब्जेक्ट को कोई तरीका नहीं मिला है या किसी सूची के रूप में व्यवहार नहीं करता है। मैंने इसे एक सूची में डालने की भी कोशिश की लेकिन यह काम नहीं किया।
ध्यान दें कि यह एक्सिस 2 और wsdl2java का उपयोग करने के बाद है, तो हाँ, अब यह संकलित है, लेकिन मुझे नहीं पता कि डेटा कैसे प्राप्त किया जाए।
हाँ मैं पहले से ही सवाल है कि मैं इस किया था में उल्लेख उपयोग कर सकते हैं, लेकिन यह अभी भी काम नहीं किया। अद्यतन पढ़ें –