ADB doesn't work very well with generic collections (List<Criterion>). Try to use arrays instead.
Andreas On Fri, Oct 8, 2010 at 11:18, Meet <[email protected]> wrote: > > Hi Friends, > > I have simple webservice as shown below. > public class RegionalWorkService { > Query query; > public void setWorks(Query qry){ > this.query=qry; > System.out.println("before setWorks..."); > for (Criterion criteria : query.getCriteria()) { > for (Param param : criteria.getParams()) { > System.out.println(param.getId()); > System.out.println(param.getValue()); > } > } > System.out.println("after setWorks..."); > } > } > > where, Query class has > private List<Criterion> pCriteria; > private List pParams; > and getter and setter methods. > > When i call this service i am getting following exception at server side > [ERROR] For input string: "" > java.lang.NumberFormatException: For input string: "" > at > java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) > at java.lang.Integer.parseInt(Integer.java:468) > at > weblogic.utils.http.HttpChunkInputStream.readChunkSize(HttpChunkInputStream.java:116) > at > weblogic.utils.http.HttpChunkInputStream.initChunk(HttpChunkInputStream.java:71) > at > weblogic.utils.http.HttpChunkInputStream.read(HttpChunkInputStream.java:142) > at > weblogic.utils.http.HttpChunkInputStream.read(HttpChunkInputStream.java:182) > at > weblogic.servlet.internal.ServletInputStreamImpl.read(ServletInputStreamImpl.java:222) > at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) > at java.io.BufferedInputStream.read1(BufferedInputStream.java:258) > at java.io.BufferedInputStream.read(BufferedInputStream.java:317) > at java.io.FilterInputStream.read(FilterInputStream.java:116) > at > org.apache.axiom.om.util.DetachableInputStream.read(DetachableInputStream.java:147) > at java.io.FilterInputStream.read(FilterInputStream.java:116) > at java.io.PushbackInputStream.read(PushbackInputStream.java:169) > at > org.apache.axis2.builder.BuilderUtil.getCharSetEncoding(BuilderUtil.java:290) > at > org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:55) > at > org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:197) > at > org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145) > at > org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:162) > at > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:142) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) > at > weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) > at > weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) > at > weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) > at > weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175) > at > weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498) > at > weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) > at weblogic.security.service.SecurityManager.runAs(Unknown Source) > at > weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180) > at > weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086) > at > weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406) > at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) > at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) > > AND this at client side > org.apache.axis2.AxisFault: Unknow type can not serialize > at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) > at > org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:83) > at > org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84) > at > org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499) > at > org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114) > at > org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096) > at > org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) > at > org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) > at > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) > at > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) > at > org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542) > at > org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:189) > at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75) > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:364) > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:208) > at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448) > at > org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:272) > at > org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) > at > com.netreach.services.RegionalWorkServiceStub.setWorks(RegionalWorkServiceStub.java:179) > at com.netreach.client.WorkClient.main(WorkClient.java:34) > Caused by: javax.xml.stream.XMLStreamException: Unknow type can not > serialize > at > org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(ConverterUtil.java:1449) > at > com.netreach.services.RegionalWorkServiceStub$Query.serialize(RegionalWorkServiceStub.java:1095) > at > com.netreach.services.RegionalWorkServiceStub$Query.serialize(RegionalWorkServiceStub.java:1017) > at > com.netreach.services.RegionalWorkServiceStub$SetWorks.serialize(RegionalWorkServiceStub.java:438) > at > com.netreach.services.RegionalWorkServiceStub$SetWorks.serialize(RegionalWorkServiceStub.java:358) > at > com.netreach.services.RegionalWorkServiceStub$SetWorks$1.serialize(RegionalWorkServiceStub.java:346) > at > org.apache.axis2.databinding.ADBDataSource.serialize(ADBDataSource.java:93) > at > org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerializeAndConsume(OMSourcedElementImpl.java:664) > at > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:918) > at > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:947) > at > org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:240) > at > org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:228) > at > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:947) > at > org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:471) > at > org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:79) > ... 18 more > > This is client code. > RegionalWorkServiceStub stub = new RegionalWorkServiceStub( > > "http://localhost:7001/axis2/services/RegionalWorkService"); > RegionalWorkServiceStub.SetWorks req = new > RegionalWorkServiceStub.SetWorks(); > com.netreach.services.RegionalWorkServiceStub.Query > query = new > com.netreach.services.RegionalWorkServiceStub.Query(); > > List<Criterion> criteria = new ArrayList<Criterion>(); > Criterion criterion = new Criterion(); > criterion.setId("TITLE_BEGINS"); > Param param = new Param(); > param.setId("TITLE"); > param.setValue("I LOVE YOU"); > List params = new ArrayList(); > params.add(param); > criterion.setParams(params); > criteria.add(criterion); > > query.setCriteria(criteria); > req.setQry(query); > > stub.setWorks(req); > > Any idea how to solve this? > Appreciate your help. > > Thanks, > Mitesh > -- > View this message in context: > http://old.nabble.com/org.apache.axis2.AxisFault%3A-Unknow-type-can-not-serialize-tp29913736p29913736.html > Sent from the Axis - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
