Re: Web Service fails: add is not a supported operation in com.webobjects.foundation.NSArray ?
Re: Web Service fails: add is not a supported operation in com.webobjects.foundation.NSArray ?
- Subject: Re: Web Service fails: add is not a supported operation in com.webobjects.foundation.NSArray ?
- From: Pascal Robert <email@hidden>
- Date: Wed, 10 Dec 2008 13:23:32 -0500
Maybe I doing something wrong, but I'm building a SOAP service with WO
5.4.3, and I go the same error.
Caused by: java.lang.UnsupportedOperationException: add is not a
supported operation in com.webobjects.foundation.NSArray
at com.webobjects.foundation.NSArray.add(NSArray.java:965)
at org.apache.axis.utils.JavaUtils.convert(JavaUtils.java:519)
at
org
.apache
.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:118)
at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:
323)
... 13 more
Method that I call :
public static NSMutableArray<Response> insertContacts(Header header,
NSArray<Contact> contacts, User user) {
NSMutableArray<Response> responses = new NSMutableArray<Response>();
for (Iterator<Contact> itContacts = contacts.iterator();
itContacts.hasNext();) {
responses.addObject(insertContact(header, itContacts.next(), user));
}
return responses;
}
Thee test client is built with Axis 1.4. I switched to
ArrayList<Response> and to List<Contact> and now it's working fine.
This is a bug specific to WebServices It is fixed in WO 5.4.2
Pierre
--
Pierre Frisch
email@hidden
On Apr 24, 2008, at 9:29, Chuck Hill wrote:
I think... This was a bug. The add() method to support Java
collections was added to NSArray as unimplemented BUT someone
forgot to add an implmentation of it to NSMutableArray. Oops. So
when you call add() on NSMutableArrary you get this message.
Wonder correctly implements this method as does some version of WO
5.4.
Chuck
On Apr 24, 2008, at 9:26 AM, Alan Ward wrote:
um, how about using an NSMutableArray? NSArray is immutable and
does not implement add.
Alan
On Apr 24, 2008, at 7:18 AM, Juergen Lorenz Simon wrote:
Hello all,
I'm trying to implement a simple web service. One of the
webservice operations takes an NSArray as parameter.
public static void foo(NSArray bar);
When the call is made, the following error pops up:
[2008-04-24 12:12:13 CEST] <WorkerThread8> AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/
envelope/}Server.userException
faultSubcode:
faultString: java.lang.UnsupportedOperationException: add is not
a supported operation in com.webobjects.foundation.NSArray
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:
java.lang.UnsupportedOperationException: add is not a supported
operation in com.webobjects.foundation.NSArray
at com.webobjects.foundation.NSArray.add(NSArray.java:965)
at org.apache.axis.utils.JavaUtils.convert(JavaUtils.java:465)
at
org
.apache
.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:
235)
at
org
.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:
333)
at
org
.apache
.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:
71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
at
org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:
481)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:323)
at
com
.webobjects
.appserver
._private.WOWebService.performActionNamed(WOWebService.java:375)
at
com
.webobjects
.appserver
._private
.WOActionRequestHandler
._handleRequest(WOActionRequestHandler.java:240)
at
com
.webobjects
.appserver
._private
.WOActionRequestHandler.handleRequest(WOActionRequestHandler.java:
142)
at
com
.webobjects
.appserver
._private
.WOWebServiceRequestHandler
.handleRequest(WOWebServiceRequestHandler.java:95)
at
com
.webobjects
.appserver.WOApplication.dispatchRequest(WOApplication.java:1306)
at
com
.webobjects
.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:173)
at
com
.webobjects
.appserver._private.WOWorkerThread.run(WOWorkerThread.java:254)
at java.lang.Thread.run(Thread.java:613)
{http://xml.apache.org/axis/}isRuntimeException: true
I was able to get this working by using ProjectWonder. Apparently
the NSArray class is patched
in PW and won't blow up when add(..) is called. Although we use
PW a lot anyway and thus have
a workaround, I would like to know if someone else had the
problem and eliminated it? Should I
use ordinary java collections (like List) in the parameters
instead of NSArray?
Thanks!
PS: WO 5.3 on OS X 10.5.2 (using woswitch.sh), Eclipse 3.3, PW4
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
-------------------------------------------------------
Pascal Robert
http://www.macti.ca
http://www.aircourriel.com
http://www.linkedin.com/in/macti
Skype: MacTICanada
AIM/iChat : MacTICanada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden