axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shameera Rathnayaka <shameerai...@gmail.com>
Subject Re: axis2 arraylist/array issues
Date Thu, 05 Sep 2013 13:37:26 GMT
Hi Serge,

I may able to help you, Could you provide a sample request that you sent.
And also mention how did you generate requests? eg: stub or SOAP UI or
Service Client ?

Thanks,
Shameera.


On Mon, Sep 2, 2013 at 8:31 PM, Serge Perepel <serge@american-data.com>wrote:

>  Hi,
>
>
>
> I’m using axis2 1.7.0SNAPSHOT and finding two problems.
>
>
>
> First when I’m having ArrayList in my class, for example:
>
>
>
> public class VEntryData{
>
>     protected List<ViewEntryItem> items;
>
>
>
>     public List<ViewEntryItem> getItems() {
>
>         if (items == null) {
>
>             items = new ArrayList<ViewEntryItem>();
>
>         }
>
>         return this.items;
>
>     }
>
> }
>
>
>
> My service functions look like this:
>
>
>
> public VEntryData getVED(){
>
>     return ved;
>
> }
>
>
>
> public void setVED(VEntryData ved){
>
>     this.ved = ved;
>
> }
>
>
>
> In this scenario the getVED() works fine and when I do setVED() from the
> client I pass a valid list but on the server side I get null for items
> field.
>
>
>
>
> //========================================================================================
>
> In the second scenario I use plain array:
>
>
>
> public class VEntryData{
>
>     protected ViewEntryItem[] items;
>
>
>
>     public ViewEntryItem[] getItems() {
>
>         if (this.items == null) {
>
>             return new ViewEntryItem[ 0 ] ;
>
>         }
>
>         ViewEntryItem[] retVal = new ViewEntryItem[this.items.length] ;
>
>         System.arraycopy(this.items, 0, retVal, 0, this.items.length);
>
>         return (retVal);
>
>     }
>
>
>
>     public ViewEntryItem getItems(int idx) {
>
>         if (this.items == null) {
>
>             throw new IndexOutOfBoundsException();
>
>         }
>
>         return this.items[idx];
>
>     }
>
>
>
>     public int getRedLength() {
>
>         if (this.items == null) {
>
>             return  0;
>
>         }
>
>         return this.items.length;
>
>     }
>
> }
>
>
>
> My service functions are the same as in previous case. In this scenario
> the getVED() produces the error:
>
>
>
> [ERROR]
>
> *java.lang.NullPointerException*
>
>      at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(*
> BeanUtil.java:255*)
>
>      at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(*
> BeanUtil.java:97*)
>
>      at
> org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.processProperties(
> *ADBXMLStreamReaderImpl.java:989*)
>
>      at
> org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.next(*
> ADBXMLStreamReaderImpl.java:848*)
>
>      at org.apache.axis2.util.StreamWrapper.next(*StreamWrapper.java:71*)
>
>      at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(*
> StAXOMBuilder.java:682*)
>
>      at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(*
> StAXOMBuilder.java:190*)
>
>      at org.apache.axiom.om.impl.common.OMContainerHelper.build(*
> OMContainerHelper.java:140*)
>
>      at org.apache.axiom.om.impl.llom.OMElementImpl.build(*
> OMElementImpl.java:699*)
>
>      at org.apache.axiom.om.impl.llom.OMElementImpl.detach(*
> OMElementImpl.java:678*)
>
>      at org.apache.axiom.om.impl.common.OMContainerHelper.addChild(*
> OMContainerHelper.java:101*)
>
>      at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(*
> OMElementImpl.java:231*)
>
>      at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(*
> OMElementImpl.java:227*)
>
>      at org.apache.axis2.rpc.receivers.RPCUtil.processResponse(*
> RPCUtil.java:134*)
>
>      at
> org.apache.axis2.rpc.receivers.RPCUtil.processResponseAsDocLitWrapped(*
> RPCUtil.java:533*)
>
>      at
> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(*
> RPCMessageReceiver.java:159*)
>
>      at
> org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(
> *AbstractInOutMessageReceiver.java:40*)
>
>      at org.apache.axis2.receivers.AbstractMessageReceiver.receive(*
> AbstractMessageReceiver.java:106*)
>
>      at org.apache.axis2.engine.AxisEngine.receive(*AxisEngine.java:169*)
>
>      at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> *HTTPTransportUtils.java:176*)
>
>      at org.apache.axis2.transport.http.AxisServlet.doPost(*
> AxisServlet.java:163*)
>
>      at javax.servlet.http.HttpServlet.service(*HttpServlet.java:647*)
>
>      at javax.servlet.http.HttpServlet.service(*HttpServlet.java:728*)
>
>      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(*
> ApplicationFilterChain.java:305*)
>
>      at org.apache.catalina.core.ApplicationFilterChain.doFilter(*
> ApplicationFilterChain.java:210*)
>
>      at org.apache.catalina.core.StandardWrapperValve.invoke(*
> StandardWrapperValve.java:222*)
>
>      at org.apache.catalina.core.StandardContextValve.invoke(*
> StandardContextValve.java:123*)
>
>      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(*
> AuthenticatorBase.java:472*)
>
>      at org.apache.catalina.core.StandardHostValve.invoke(*
> StandardHostValve.java:171*)
>
>      at org.apache.catalina.valves.ErrorReportValve.invoke(*
> ErrorReportValve.java:99*)
>
>      at org.apache.catalina.valves.AccessLogValve.invoke(*
> AccessLogValve.java:947*)
>
>      at org.apache.catalina.core.StandardEngineValve.invoke(*
> StandardEngineValve.java:118*)
>
>      at org.apache.catalina.connector.CoyoteAdapter.service(*
> CoyoteAdapter.java:408*)
>
>      at org.apache.coyote.http11.AbstractHttp11Processor.process(*
> AbstractHttp11Processor.java:1009*)
>
>      at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(*
> AbstractProtocol.java:589*)
>
>      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(*
> JIoEndpoint.java:310*)
>
>      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>
>      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>
>      at java.lang.Thread.run(Unknown Source)
>
>
>
> If anybody know how to battle those issues please help me.
>
>
>
>
>
> Serge Perepel
> Software Developer | American Data
> p. 800.464.9942 | f. 608.643.2314
> serge@american-data.com | www.american-data.com
>



-- 
Best Regards,
Shameera Rathnayaka.

email: shameera AT apache.org , shameerainfo AT gmail.com
Blog : http://shameerarathnayaka.blogspot.com/

Mime
View raw message