[jboss-user] [JBossWS] - webmethod and object list return

atriano do-not-reply at jboss.com
Mon Jul 21 16:33:31 EDT 2008


hi, I want to make a webmethod that returns an object list

for example:

  | //class Person has a "name" attribute...
  | 
  |     @WebMethod
  |     public ArrayList getPool() {
  | 	ArrayList array=new ArrayList();
  |     	for(int i=0;i<5;i++){
  |     	     Person person=new Person("name"+i);
  |     	     array.add(person);
  |     	}
  |     	return array;
  |     }

when I run any webservice like this the console server throws an exception as follows:

ERROR [RequestHandlerImpl] Error processing web service request
  | org.jboss.ws.WSException: javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException
  |  - with linked exception:
  | [javax.xml.bind.JAXBException: class org.jboss.soa.esb.samples.quickstart.model.
  | Person nor any of its super class is known to this context.]
  |         at org.jboss.ws.WSException.rethrow(WSException.java:68)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:310)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:189)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:122)
  |         at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
  | ...
  | ...
  | ...

Can anybody help me?
thanks in advance,
Atriano


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165745#4165745

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165745



More information about the jboss-user mailing list