[ http://jira.codehaus.org/browse/XFIRE-670?page=comments#action_78577 ] Asim Ranjha commented on XFIRE-670: -----------------------------------
I am having a similar issue. I have a class that contains an attribute of type of Object. I set a specific type of intance in it at runtime. I get an exception xfire fault: unable to write * name of object that I set at runtime* Type is unknown. I am using default Aegis bindings, in other words I have not defined a custom Aegies bindings file. The WSDL shows the object as anytype. I have tried setting a native java type: HashMap, ArrayList, etc, but get the same exception. But the primitive types seem to work ok, e.g. a String object. What am I doing wrong? > How to send Map where map componentType is unknown > -------------------------------------------------- > > Key: XFIRE-670 > URL: http://jira.codehaus.org/browse/XFIRE-670 > Project: XFire > Issue Type: Wish > Components: Aegis Module > Affects Versions: 1.2.1 > Environment: jdk1.5_06, Windows XP SP2, jboss4.0.2 > Reporter: Amaraa > Assigned To: Dan Diephouse > Fix For: 1.2.2 > > > i have a map. There is source code : > Map result = new HashMap(); > result.put("collection", collection); // Collection type is SomeDataBean with > username, password etc. > result.put("columns", columns); // Collection type is Long java.lang.Long > result.put("totalAmount", totalAmount); // Double > result.put("totalCount", new Integer(tolalCount)); > result.put("total", new Double(realTotal)); > This is a static map. Map key is string and map Component Type is Unknown How > to configure that .aegis.xml. > Just now i configured my .aegis.xml > <method name="getResult"> > <return-type keyType="java.lang.String" > componentType="java.lang.Object" /> > <parameter index="1" componentType="java.lang.Long" /> > <parameter index="2" componentType="java.lang.String" /> > <parameter index="3" componentType="java.lang.String" /> > <parameter index="4" componentType="java.lang.String" /> > <parameter index="5" componentType="java.lang.String" /> > <parameter index="6" componentType="java.lang.String" /> > <parameter index="7" componentType="java.lang.Long" /> > <parameter index="8" componentType="java.lang.Long" /> > </method> > And i have a error at the client. > org.codehaus.xfire.fault.XFireFault: Unable to write '{2=16, 4=1, 8=5, 9=2, > 6=4, 1=8, 3=10, 5=1}' [java.util.HashMap]. Type is unknown. > at > org.codehaus.xfire.aegis.type.basic.ObjectType.handleNullType(ObjectType.java:234) > at > org.codehaus.xfire.aegis.type.basic.ObjectType.writeObject(ObjectType.java:169) > at > org.codehaus.xfire.aegis.type.collection.MapType.writeObject(MapType.java:169) > 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.XFireServletChannel.sendViaServlet(XFireServletChannel.java:84) > at > org.codehaus.xfire.transport.http.XFireServletChannel.send(XFireServletChannel.java:43) > at > org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26) > at > org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) > at > org.codehaus.xfire.service.binding.PostInvocationHandler.invoke(PostInvocationHandler.java:36) > at > org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) > at > org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64) > at > org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38) > at > org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireServletController.java:287) > at > org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:130) > at > org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) > at > org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) > at > org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39) > at > org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153) > at > org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) > at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) > at > org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) > at java.lang.Thread.run(Thread.java:595) > How to solve it. Please help me. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
