|
|
|
I gather from the empty "Fix Version/s" field that this patch did not make it to the 1.2 final?
This is fixed in SVN right now for 1.2.1. A build is here if you want to test:
Thankyou! 8 minutes is what I'd call excellent response time
I tried the snapshot jar and something has changed, as the previous ClassCastException from CollectionType has changed to this: 2006-09-04 17:57:46,242 [http-8180-Processor4] DEBUG org.codehaus.xfire.handler.HandlerPipeline - Invoking handler org.codehaus.xfire.handler.OutMessageSender i
n phase send
2006-09-04 17:57:46,266 [http-8180-Processor4] ERROR org.codehaus.xfire.service.binding.PostInvocationHandler - java.lang.NullPointerException
2006-09-04 17:57:46,269 [http-8180-Processor4] ERROR org.codehaus.xfire.handler.DefaultFaultHandler - Fault occurred!
java.lang.NullPointerException
at org.codehaus.xfire.aegis.type.basic.ObjectType.determineType(ObjectType.java:192)
at org.codehaus.xfire.aegis.type.basic.ObjectType.writeObject(ObjectType.java:165)
at org.codehaus.xfire.aegis.type.basic.ArrayType.writeValue(ArrayType.java:293)
at org.codehaus.xfire.aegis.type.collection.CollectionType.writeObject(CollectionType.java:103)
at org.codehaus.xfire.aegis.type.basic.BeanType.writeObject(BeanType.java:413)
at org.codehaus.xfire.aegis.AegisBindingProvider.writeParameter(AegisBindingProvider.java:194)
at org.codehaus.xfire.service.binding.AbstractBinding.writeParameter(AbstractBinding.java:273)
at org.codehaus.xfire.service.binding.WrappedBinding.writeMessage(WrappedBinding.java:89)
at org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerializer.java:80)
Its your lucky day I guess
http://xfire.codehaus.org/Mapping+collections Or are you using Java 5? If they're java5 collections, xfire should figure them out autmotically. I'm on Java 5 (Sun 1.5.0_07 on Debian Ubuntu), and basic collections mappings have worked all the time. I started with 1.1.1 and only now upgraded to 1.2 when the problem appeared with a new web service method.
Let's see if I can find out what is special about this failing case. XFire might be getting confused if you aren't specificying the inner collection's component type. I.e. do you have Collection<Collection> instead of Collection<Collection<Foo>> ?
When I try to use this patch I am getting the following excpetion:
Caused by: java.lang.NullPointerException at org.codehaus.xfire.aegis.type.basic.ObjectType.determineType(ObjectType.java:192) at org.codehaus.xfire.aegis.type.basic.ObjectType.writeObject(ObjectType.java:165) at org.codehaus.xfire.aegis.type.basic.ArrayType.writeValue(ArrayType.java:293) at org.codehaus.xfire.aegis.type.collection.CollectionType.writeObject(CollectionType.java:103) at org.codehaus.xfire.aegis.type.basic.BeanType.writeObject(BeanType.java:413) at org.codehaus.xfire.aegis.AegisBindingProvider.writeParameter(AegisBindingProvider.java:201) at org.codehaus.xfire.service.binding.AbstractBinding.writeParameter(AbstractBinding.java:273) at org.codehaus.xfire.service.binding.WrappedBinding.writeMessage(WrappedBinding.java:89) at org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerializer.java:80) at org.codehaus.xfire.transport.http.HttpChannel.writeWithoutAttachments(HttpChannel.java:56) at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.getByteArrayRequestEntity(CommonsHttpMessageSender.java:313) at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.send(CommonsHttpMessageSender.java:251) at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:123) at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48) at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75) ... 7 more I am using JDK 1.5 and my bean has definition like this: Collection<Entity> newEntities; with getter and setters. I define the service in spring xml file like this: <bean name="Saver" class="org.codehaus.xfire.spring.BeanService"> <property name="properties"> <map> <entry key="writeXsiType"> <value type="java.lang.Boolean">true</value> </entry> <entry key="overrideTypesList"> <list> <value>com.innovit.ice.core.domain.Entity</value> <value>com.innovit.ice.core.domain.Group</value> <value>com.innovit.ice.core.domain.User</value> <value>com.innovit.ice.core.domain.UserGroup</value> </list> </entry> </map> </property> <property name="serviceBean" ref="saver"/> <property name="serviceClass" value="com.innovit.ice.core.dao.ChangeSaver"/> <property name="name" value="Saver"/> </bean> I thing the issue is not solved. As this functionality is necessary for us, please solve the issue ASAP. I had the same problem as Behrang Javaherian;
I am using JDK 1.5 and xfire1.2.1;my bean has definition like this: Collection<Entity> newEntities; As the bellow: http://xfire.codehaus.org/Mapping+collections Java5 collections, xfire should figure them out autmotically. but error as bellow: Now , I have Solved the problem: like using java 1.4 ,configure collections like: just do it , then ok; reference by: so , i think xfire-aegis is not good supporting for jdk1.5, I have the same error with 1.2.1 when returning a List from a method with this interface...
@WebMethod I am using java 1.5.0_07, spring 1.2.8 and the jsr181 annotations. I do not have this error with 1.1.2, which works fine. Thus I cannot upgrade until this issue is resolved. Actually, my stack trace is not identical. Here it is, running in tomcat 5.5.17...
[2006-09-28 10:07:01,164] : ERROR : [http-8080-Processor25] : binding.PostInvocationHandler : java.lang.NullPointerException I have the same stack trace as that of James Burton's.
2006-09-28 18:21:43,180 [TP-Processor3] DEBUG HandlerPipeline - Invoking handler org.codehaus.xfire.soap.handler.SoapActionOutHandler in phase transport I tried defining the mapping explicitly for collection, but that doesnt seem to fix the issue. The 1.2.2 release fixed this problem for me.
Thanks! James Burton,
Did you have to provide mapping file or just swapping the jars fixed your problem. Can you explain the changes you made inorder to get the collections component working |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
XFIRE-545, but I will be applying this patch. Thanks!