axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nolan Adrian <Adrian.No...@traventec.com>
Subject FW: Multi-Threaded Client Problem
Date Wed, 20 Aug 2003 16:23:40 GMT


Regards,
Adrian.


Adrian Nolan

Traventec
Galway Business Park,
Newcastle,
Galway,
Ireland.

Phone:     +353 (0)91 518729
Web:	www.traventec.com


>  -----Original Message-----
> From: 	Nolan Adrian  
> Sent:	19 August 2003 18:01
> To:	'axis-user@ws.apache.org'
> Subject:	Multi-Threaded Client Problem
> 
> Hi All - 
> 
> I'm new to AXIS and Web Services. I have read and followed the AXIS docs
> and simple examples, but have a problem with my own multi-threaded AXIS
> Test Client I created. I used the wsdl2java utility to generated the Java
> classes from a WSDL file that was given to me.
> 
> Basically I have a Test class and an inner class (Thread) that does the
> actual work of sending requests and receiving responses. Each Thread
> (Client) works in two modes [1] Reuses it's Web Object reference [2]
> Creates a new web object reference each time. I do this to test the cost
> of reusing the web object reference verses creating it each time.
> 
> This is a snippet of code from my inner class, the constructor creates the
> reusable mNvsClient web object reference, if I need to create it each time
> I call createWebServiceReference() directly.
> 
>       /**
>        * Constructor
>        * @param pThreadID Thread ID to use when reporting back the
> results.
>        */
>       public Worker(int pThreadID) {
> 
>          mWorkerThreadID = pThreadID;
>          
>          // Create the reusable Web Service Object
>          if (mReuseWebServiceObject) {
>             mNvsClient = createWebServiceReference();
>          }
>       }
> 
> 
>       /**
>        * Creates a new Web Service Object
>        * 
>        * @return Web Service Object Reference
>        */
>       private synchronized NVSGUSStub createWebServiceReference() {
>          NVSGUSStub client = null;    
>          try {
>             NVSGUS_Service nvsService = new NVSGUS_ServiceLocator();
>             client = (NVSGUSStub) nvsService.getNVSGUS();
>          }
>          catch (ServiceException e) {
>             e.printStackTrace();
>          }
>          return client;      
>       }
> 
> However, when I run my client with more than one thread (client) I get the
> following error repeated for different classes:
> 
> bash-2.03$ . runtest.sh
> Axis NVS Tests .............. started.
> Running: 2 clients, Reusing Web Services Object Reference: true
> - AxisClient [1] .............. Running
> - AxisClient [0] .............. Running
> - AxisClient [1] Sending Logon message ........ waiting for response
> - AxisClient [0] Sending Logon message ........ waiting for response
> - Internal Error occurred while build the property descriptors for
> test.dataclasses.Order
> java.lang.ArrayIndexOutOfBoundsException
>         at java.lang.System.arraycopy(Native Method)
>         at
> org.apache.axis.description.TypeDesc.getFields(TypeDesc.java:196)
>         at
> org.apache.axis.utils.BeanUtils.processPropertyDescriptors(BeanUtils.java:
> 255)
>         at org.apache.axis.utils.BeanUtils.getPd(BeanUtils.java:103)
>         at
> org.apache.axis.description.TypeDesc.getPropertyDescriptors(TypeDesc.java:
> 445)
>         at
> org.apache.axis.encoding.ser.BeanSerializerFactory.<init>(BeanSerializerFa
> ctory.java:88)
>         at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown
> Source)
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstr
> uctorAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>         at
> org.apache.axis.encoding.ser.BaseSerializerFactory.createFactory(BaseSeria
> lizerFactory.java:257)
>         at org.apache.axis.client.Call.registerTypeMapping(Call.java:2120)
>         at de.dbsystems.www.NVSGUSStub.createCall(Unknown Source)
>         at de.dbsystems.www.NVSGUSStub.logon(Unknown Source)
>         at
> de.start.sip.nvslink.AxisNvsTestClient$Worker.doLogonTest(AxisNvsTestClien
> t.java:431)
>         at
> de.start.sip.nvslink.AxisNvsTestClient$Worker.run(AxisNvsTestClient.java:3
> 50)
> 
> Am I doing something wrong ? How come it reports (Unknown Source) if I use
> more that one Client and yet works fine if I have a single client ?
> 
> Any help or pointers would be much appricated.
> 
> Regards,
> Adrian.
> 
> 
> Adrian Nolan
> 
> Traventec
> Galway Business Park,
> Newcastle,
> Galway,
> Ireland.
> 
> Phone:     +353 (0)91 518729
> Web:	www.traventec.com
> 
> 
************************************************************************
This e-mail and any files transmitted with it are confidential and may be
privileged and are intended solely for the individual named/ for the use of
the individual or entity to whom they are addressed.If you are not the
intended addressee, you should not disseminate, distribute or copy this
e-mail.Please notify the sender immediately if you have received this e-mail
by mistake and delete this e-mail from your system.If you are not the
intended recipient, you are notified that reviewing, disclosing, copying,
distributing or taking any action in reliance on the contents of this e-mail
is strictly prohibited.Please note that any views or opinions expressed in
this e-mail are solely those of the author and do not necessarily represent
those of Traventec Limited.E-mail transmission cannot be guaranteed to be
secure or error-free as information could be intercepted, corrupted, lost,
destroyed, or arrive late or incomplete.Traventec Limited therefore does not
accept liability for any errors or omissions in the contents of this
message, which arise as a result of e-mail transmission.The recipient should
check this e-mail and any attachments for the presence of viruses.This
e-mail has been swept for computer viruses however Traventec Limited accepts
no liability for any damage caused by any virus transmitted by this e-mail.

Mime
View raw message