Re: BeanPropertyTarget argument type mismatch WO5.4.3
Re: BeanPropertyTarget argument type mismatch WO5.4.3
- Subject: Re: BeanPropertyTarget argument type mismatch WO5.4.3
- From: Lachlan Deck <email@hidden>
- Date: Fri, 6 Feb 2009 03:49:41 +1100
Bug report with needed fix: Radar://6559319
Bug Report Title:
[Axis] NSTimestamp deserializers and serializers unregistered for
dateTime
Version WebObjects 5.4.3
05-Feb-2009 08:38 AM Lachlan Deck:
Summary:
Deserialization to NSTimestamp failing from axis dateTime / java.util.
[Gregorian]Calendar. The qname WOSoapConstants.NSTIMESTAMP_QNAME
doesn't match Constants.XSD_DATETIME. It's likely to have changed
definitions in axis - so support for both qnames is required.
Steps to Reproduce:
Create a stub with an NSTimestamp field (e.g., public NSTimestamp
created;).
register the class as a service, generate wsdl and so forth and in the
client app attempt to populate the field with a remote call.
Expected Results:
Expected WOTimeDeserializer[Factory] to be used for dateTime
deserialization.
Actual Results:
Turning up log4j logging for apache axis it turns out that the default
CalendarDeserializationFactory was getting called thus leading to a
ClassCastException when attempt to assign the value to the field
needing an NSTimestamp.
Regression:
WO5.3.3 with Axis 1.1 worked fine.
Notes:
Let me know if you need debug logging from axis.
Essentially, WOWSSupport declares MappingRegistryEntry mappings for
NSTimestamp - once for java.util.Calendar and again for NSTimestamp
both with the qname WOSoapConstants.NSTIMESTAMP_QNAME. There needs to
also be two additional mappings exactly the same but passing as the
qname the constant Constants.XSD_DATETIME.
I've tested this by running the following code during app start up...
which solves my problem.
List< MappingRegistryEntry > defaultMappingEntries = Arrays.asList(
new MappingRegistryEntry( NSTimestamp.class, Constants.XSD_DATETIME,
new WOTimeSerializerFactory(
NSTimestamp.class, Constants.XSD_DATETIME ), new
WOTimeDeserializerFactory( NSTimestamp.class,
Constants.XSD_DATETIME ) ),
new MappingRegistryEntry( NSTimestamp.class, Constants.XSD_DATETIME,
new WOTimeSerializerFactory(
java.util.Calendar.class, Constants.XSD_DATETIME ), new
WOTimeDeserializerFactory( java.util.Calendar.class,
Constants.XSD_DATETIME ) )
);
for ( MappingRegistryEntry entry : defaultMappingEntries )
{
WOWebServiceRegistrar
.registerFactoriesForClassWithQName( entry.serializerFactory(),
entry.deserializerFactory(), entry.mappedClass(), entry
.qName() );
}
On 05/02/2009, at 4:41 PM, Lachlan Deck wrote:
Hi there,
just testing updating an app from WO5.3.3 to WO5.4.3 (means Axis 1.1
-> 1.4).
Previously NSTimestamp fields were properly serialized/deserialized
but now it's failing (see stack trace below).
7916935 ERROR [WorkerThread8] (encoding.ser.BeanPropertyTarget, set,
135) -
Could not convert java.util.GregorianCalendar to bean field
'created', type com.webobjects.foundation.NSTimestamp
Any ideas what's changed in terms of [de]serialisation stuff for
NSTimestamp fields?
[2009-2-5 15:57:5 EST] <WorkerThread8> AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/
envelope/}Server.userException
faultSubcode:
faultString: java.lang.IllegalArgumentException: argument type
mismatch
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/
axis/}stackTrace:java.lang.IllegalArgumentException: argument type
mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org
.apache
.axis.utils.BeanPropertyDescriptor.set(BeanPropertyDescriptor.java:
142)
at
org
.apache
.axis.encoding.ser.BeanPropertyTarget.set(BeanPropertyTarget.java:75)
at
org
.apache
.axis.encoding.DeserializerImpl.valueComplete(DeserializerImpl.java:
249)
at
org
.apache
.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:509)
at
org
.apache
.axis
.encoding
.DeserializationContext.endElement(DeserializationContext.java:1087)
at
org
.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:
171)
at
org
.apache
.axis.message.MessageElement.publishToHandler(MessageElement.java:
1141)
at
org
.apache
.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:
369)
at
org
.apache
.axis
.encoding
.DeserializationContext.startElement(DeserializationContext.java:1048)
at
org
.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:
165)
at
org
.apache
.axis.message.MessageElement.publishToHandler(MessageElement.java:
1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:
236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at
org
.apache
.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:81)
at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:
323)
at
org
.apache
.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at
org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at
com
.webobjects
.appserver
._private.WOWebService.performActionNamed(WOWebService.java:437)
at
com
.webobjects
.appserver
._private
.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:
259)
at
com
.webobjects
.appserver
._private
.WOActionRequestHandler.handleRequest(WOActionRequestHandler.java:161)
at
com
.webobjects
.appserver
._private
.WOWebServiceRequestHandler
.handleRequest(WOWebServiceRequestHandler.java:109)
at
ish
.willowservices
.appserver
.ISHWebServiceRequestHandler
.handleRequest(ISHWebServiceRequestHandler.java:140)
at
com
.webobjects
.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
at
er
.extensions
.appserver
.ERXApplication.dispatchRequestImmediately(ERXApplication.java:1737)
at
er
.extensions
.appserver.ERXApplication.dispatchRequest(ERXApplication.java:1702)
at
com
.ish
.webobjects
.appserver.ISHApplication.dispatchRequest(ISHApplication.java:1021)
at
ish
.willowservices
.appserver.Application.dispatchRequest(Application.java:231)
at
com
.webobjects
.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
at
com
.webobjects
.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
at java.lang.Thread.run(Thread.java:613)
with regards,
--
Lachlan Deck
with regards,
--
Lachlan Deck
_______________________________________________
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