I'd like to keep separate the, "my java xfire client doesn't work with lists" from the "my server doesn't let anyone use lists"
If xfire won't let clients consume services that have list parameters, that's one bug. (alluded to in the closing comments of XFIRE-509 with, "use this XXX to make your client, not YYYY" If the xfire _service_ won't let anyone set a list, I see that as a separate problem. Whichever one XFIRE-509 is, can we track them separately? Cheers, Karl P > -----Original Message----- > From: Deno Vichas [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 30, 2006 10:23 PM > To: [email protected] > Subject: RE: [xfire-user] xfire client using jaxb [was: help! > - spring2, jaxb2 config setup] > > Ok.. this is related the 509 bug. The comment by Dan doesn't > work and give me the stack trace below. > > > > ________________________________ > > From: Deno Vichas [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 30, 2006 1:07 PM > To: [email protected] > Subject: [xfire-user] xfire client using jaxb [was: help! - > spring2, jaxb2 config setup] > > > > I think my service is working as I get WSDL to generate. I > think the problem I'm having now is with my client code. > > > > If I use > > Service serviceModel = new > AnnotationServiceFactory().create(VehicleLookupServiceImpl.class); > > > > It complains about not having a setting for the array list > that jaxb created. So I did some search and found some other > with this same problem. one post said I need to use > > > > > > Service serviceModel = new > JaxbServiceFactory().create(VehicleLookupServiceImpl.class); > > > > > > But this gives me the stack trace below. At this point I'm > at a total lost. > > > > > > Thanks, > > deno > > > > > > > > 2006-11-29 12:30:40,393 ERROR > [org.apache.catalina.core.ContainerBase.[Catalina].[localhost] > .[/oracle].[dispatch]] - Servlet.service() for servlet > dispatch threw exception > > org.codehaus.xfire.XFireRuntimeException: Could not invoke > service.. Nested exception is > org.codehaus.xfire.fault.XFireFault: Could not marshall type. > > org.codehaus.xfire.fault.XFireFault: Could not marshall type. > > at > org.codehaus.xfire.jaxb2.JaxbType.writeObject(JaxbType.java:254) > > at > org.codehaus.xfire.aegis.AegisBindingProvider.writeParameter(A > egisBindingProvider.java:200) > > at > org.codehaus.xfire.service.binding.AbstractBinding.writeParame > ter(AbstractBinding.java:273) > > at > org.codehaus.xfire.service.binding.WrappedBinding.writeMessage > (WrappedBinding.java:89) > > at > org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerial > izer.java:80) > > at > org.codehaus.xfire.transport.http.HttpChannel.writeWithoutAtta > chments(HttpChannel.java:56) > > at > org.codehaus.xfire.transport.http.CommonsHttpMessageSender.get > ByteArrayRequestEntity(CommonsHttpMessageSender.java:313) > > at > org.codehaus.xfire.transport.http.CommonsHttpMessageSender.sen > d(CommonsHttpMessageSender.java:251) > > at > org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(Ht > tpChannel.java:123) > > at > org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel > .java:48) > > at > org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageS > ender.java:26) > > at > org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipel > ine.java:131) > > at > org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75) > > at org.codehaus.xfire.client.Client.invoke(Client.java:335) > > at > org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77) > > at > org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57) > > at $Proxy12.getVehicles(Unknown Source) > > at > com.autoreturn.web.VehicleLookupController.handle(VehicleLooku > pController.java:53) > > at > org.springframework.web.servlet.mvc.AbstractCommandController. > handleRequestInternal(AbstractCommandController.java:82) > > at > org.springframework.web.servlet.mvc.AbstractController.handleR > equest(AbstractController.java:153) > > at > org.springframework.web.servlet.mvc.SimpleControllerHandlerAda > pter.handle(SimpleControllerHandlerAdapter.java:45) > > at > org.springframework.web.servlet.DispatcherServlet.doDispatch(D > ispatcherServlet.java:806) > > at > org.springframework.web.servlet.DispatcherServlet.doService(Di > spatcherServlet.java:736) > > at > org.springframework.web.servlet.FrameworkServlet.processReques > t(FrameworkServlet.java:396) > > at > org.springframework.web.servlet.FrameworkServlet.doGet(Framewo > rkServlet.java:350) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilt > er(ApplicationFilterChain.java:252) > > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli > cationFilterChain.java:173) > > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardW > rapperValve.java:213) > > at > org.apache.catalina.core.StandardContextValve.invoke(StandardC > ontextValve.java:178) > > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHost > Valve.java:126) > > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport > Valve.java:105) > > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEn > gineValve.java:107) > > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdap > ter.java:148) > > at > org.apache.coyote.http11.Http11Processor.process(Http11Process > or.java:869) > > at > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHa > ndler.processConnection(Http11BaseProtocol.java:664) > > at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolT > cpEndpoint.java:527) > > at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(Le > aderFollowerWorkerThread.java:80) > > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( > ThreadPool.java:684) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: javax.xml.bind.JAXBException: > com.autoreturn.service.model.LookupVehiclesRequest nor any of > its super class is known to this context > > at > com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBCo > ntextImpl.java:446) > > at > com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSeria > lizer.java:447) > > at > com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImp > l.java:263) > > at > com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerI > mpl.java:143) > > at > org.codehaus.xfire.jaxb2.JaxbType.writeObject(JaxbType.java:249) > > ... 40 more > > > > > > > > > > > > > > > > > > ________________________________ > > From: Deno Vichas [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 29, 2006 12:34 PM > To: [email protected] > Subject: RE: [xfire-user] help! - spring2, jaxb2 config setup > > > > Honestly I'm not even fully sure what the remoting is used > for. I just want to create some soap services using sping2, > jaxb2, hibernate, and xfire. I did find my startup problem. > I'm now back to my original problem. Here's my client code I have; > > > > Service serviceModel = new > JaxbServiceFactory().create(VehicleLookupServiceImpl.class); > // some post I found on the net said I needed to use the > JaxbServiceFactory. > > //Service serviceModel = new > AnnotationServiceFactory().create(VehicleLookupServiceImpl.cla > ss); // this bitches about not having a setting for the > array list from jaxb. Argh! > > try { > > VehicleLookupService service = > (VehicleLookupService) new XFireProxyFactory().create(serviceModel, > > > > "http://localhost:8080/oracle/services/VehicleLookupService"); > > LookupVehiclesResponse r = > service.getVehicles(buildLookupVehiclesRequest(cmd)); > > pw.println(marshallRequest(r)); > > > > } catch (MalformedURLException e) { > > e.printStackTrace(); > > } > > > > > > 2006-11-29 12:30:40,393 ERROR > [org.apache.catalina.core.ContainerBase.[Catalina].[localhost] > .[/oracle].[dispatch]] - Servlet.service() for servlet > dispatch threw exception > > org.codehaus.xfire.XFireRuntimeException: Could not invoke > service.. Nested exception is > org.codehaus.xfire.fault.XFireFault: Could not marshall type. > > org.codehaus.xfire.fault.XFireFault: Could not marshall type. > > at > org.codehaus.xfire.jaxb2.JaxbType.writeObject(JaxbType.java:254) > > at > org.codehaus.xfire.aegis.AegisBindingProvider.writeParameter(A > egisBindingProvider.java:200) > > at > org.codehaus.xfire.service.binding.AbstractBinding.writeParame > ter(AbstractBinding.java:273) > > at > org.codehaus.xfire.service.binding.WrappedBinding.writeMessage > (WrappedBinding.java:89) > > at > org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerial > izer.java:80) > > at > org.codehaus.xfire.transport.http.HttpChannel.writeWithoutAtta > chments(HttpChannel.java:56) > > at > org.codehaus.xfire.transport.http.CommonsHttpMessageSender.get > ByteArrayRequestEntity(CommonsHttpMessageSender.java:313) > > at > org.codehaus.xfire.transport.http.CommonsHttpMessageSender.sen > d(CommonsHttpMessageSender.java:251) > > at > org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(Ht > tpChannel.java:123) > > at > org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel > .java:48) > > at > org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageS > ender.java:26) > > at > org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipel > ine.java:131) > > at > org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75) > > at org.codehaus.xfire.client.Client.invoke(Client.java:335) > > at > org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77) > > at > org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57) > > at $Proxy12.getVehicles(Unknown Source) > > at > com.autoreturn.web.VehicleLookupController.handle(VehicleLooku > pController.java:53) > > at > org.springframework.web.servlet.mvc.AbstractCommandController. > handleRequestInternal(AbstractCommandController.java:82) > > at > org.springframework.web.servlet.mvc.AbstractController.handleR > equest(AbstractController.java:153) > > at > org.springframework.web.servlet.mvc.SimpleControllerHandlerAda > pter.handle(SimpleControllerHandlerAdapter.java:45) > > at > org.springframework.web.servlet.DispatcherServlet.doDispatch(D > ispatcherServlet.java:806) > > at > org.springframework.web.servlet.DispatcherServlet.doService(Di > spatcherServlet.java:736) > > at > org.springframework.web.servlet.FrameworkServlet.processReques > t(FrameworkServlet.java:396) > > at > org.springframework.web.servlet.FrameworkServlet.doGet(Framewo > rkServlet.java:350) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilt > er(ApplicationFilterChain.java:252) > > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli > cationFilterChain.java:173) > > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardW > rapperValve.java:213) > > at > org.apache.catalina.core.StandardContextValve.invoke(StandardC > ontextValve.java:178) > > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHost > Valve.java:126) > > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport > Valve.java:105) > > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEn > gineValve.java:107) > > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdap > ter.java:148) > > at > org.apache.coyote.http11.Http11Processor.process(Http11Process > or.java:869) > > at > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHa > ndler.processConnection(Http11BaseProtocol.java:664) > > at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolT > cpEndpoint.java:527) > > at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(Le > aderFollowerWorkerThread.java:80) > > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( > ThreadPool.java:684) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: javax.xml.bind.JAXBException: > com.autoreturn.service.model.LookupVehiclesRequest nor any of > its super class is known to this context > > at > com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBCo > ntextImpl.java:446) > > at > com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSeria > lizer.java:447) > > at > com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImp > l.java:263) > > at > com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerI > mpl.java:143) > > at > org.codehaus.xfire.jaxb2.JaxbType.writeObject(JaxbType.java:249) > > ... 40 more > > > > > > > > > > > > Here's my POJO > > > > package com.autoreturn.service; > > > > import javax.jws.WebParam; > > import javax.jws.WebService; > > > > import com.autoreturn.service.model.LookupVehiclesRequest; > > import com.autoreturn.service.model.LookupVehiclesResponse; > > > > @WebService(name="VehicleLookupService", > > targetNamespace="http://oracle.autoreturn.com") > > public interface VehicleLookupService { > > > > public LookupVehiclesResponse > getVehicles(@WebParam(name="LookupVehiclesRequest") > LookupVehiclesRequest request); > > > > } > > > > ---- > > > > package com.autoreturn.service; > > > > import javax.jws.WebService; > > import javax.jws.soap.SOAPBinding; > > > > import com.autoreturn.dts.DTSLookupResponse; > > import com.autoreturn.dts.DTSManagerFactory; > > import com.autoreturn.manager.XmlConverter; > > import com.autoreturn.service.model.LookupVehiclesRequest; > > import com.autoreturn.service.model.LookupVehiclesResponse; > > > > @WebService( > > serviceName = "VehicleLookupService", > > endpointInterface = "com.autoreturn.service.VehicleLookupService" > > ) > > @SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.BARE) > > public class VehicleLookupServiceImpl implements > VehicleLookupService { > > private final DTSManagerFactory _dtsFactory; > > private final XmlConverter _xmlConverter; > > > > public VehicleLookupServiceImpl(DTSManagerFactory > dtsManagerFactory, XmlConverter xmlConverter) { > > _dtsFactory = dtsManagerFactory; > > _xmlConverter = xmlConverter; > > } > > > > public LookupVehiclesResponse > getVehicles(LookupVehiclesRequest request) { > > > > DTSLookupResponse dtsResponse = > _dtsFactory.lookupVehicle(request); > > return _xmlConverter.buildArLookupVehicleReponse(dtsResponse); > > > > } > > > > } > > > > > > ________________________________ > > From: Ruth, Brice D [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 29, 2006 11:34 AM > To: [email protected] > Subject: RE: [xfire-user] help! - spring2, jaxb2 config setup > > > > From the exception, it looks like the wrong bean is getting > passed in. What's your POJO that has the @WebService > annotation on it? ServiceBean is the XFire object that wraps > your POJO, from what I understand. > > > > I'm not familiar with the handler mapping stuff from Spring > remoting. We use a Jsr181BeanPostProcessor ... is there a > particular need for the Spring remoting? > > > > Cheers, > > Brice > > > > -----Original Message----- > From: Deno Vichas [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 29, 2006 11:34 AM > To: [email protected] > Subject: RE: [xfire-user] help! - spring2, jaxb2 config setup > > I tried something like that already using > org.codehaus.xfire.spring.remoting.XFireExporter, using your > sample I get on startup - > > > > 2006-11-29 09:27:13,817 ERROR > [org.springframework.web.context.ContextLoader] - Context > initialization failed > > org.springframework.beans.factory.BeanCreationException: > Error creating bean with name 'vehicleLookup' defined in > ServletContext resource [/WEB-INF/xfire-servlet.xml]: > Invocation of init method failed; nested exception is > org.codehaus.xfire.annotations.AnnotationException: Class > org.codehaus.xfire.spring.ServiceBean does not have a > WebService annotation > > Caused by: > > org.codehaus.xfire.annotations.AnnotationException: Class > org.codehaus.xfire.spring.ServiceBean does not have a > WebService annotation > > > > > > I'm using JSR181 to expose my service with > > > > <bean id="xfire.commonsAnnotations" > class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations"/> > > > > <bean id="handlerMapping" > class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping"> > > <property name="typeMappingRegistry" > ref="xfire.typeMappingRegistry"/> > > <property name="xfire" ref="xfire"/> > > <property name="webAnnotations" > ref="xfire.commonsAnnotations"/> > > </bean> > > > > <bean > class="org.springframework.web.servlet.handler.SimpleUrlHandle > rMapping"> > > <property name="urlMap"> > > <map> > > <entry key="/"> > > <ref bean="handlerMapping"/> > > </entry> > > </map> > > </property> > > </bean> > > > > > > Is this bad to try to do this? > > > > > > Thanks. > > deno > > > > > > ________________________________ > > From: Ruth, Brice D [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 29, 2006 6:56 AM > To: [email protected] > Subject: RE: [xfire-user] help! - spring2, jaxb2 config setup > > > > <!-- Initialize JAXB2 service factory --> > > <bean name="jaxbServiceFactory" > > class="org.codehaus.xfire.jaxb2.JaxbServiceFactory"> > > <constructor-arg ref="xfire.transportManager" /> > > </bean> > > > > <bean id="ewsng.TaskController.service" > class="org.codehaus.xfire.spring.ServiceBean"> > > <property name="serviceBean" ref="ewsng.taskController" > /> <!-- this is my POJO --> > > <property name="serviceFactory" ref="jaxbServiceFactory" /> > > </bean> > > > > -----Original Message----- > From: Deno Vichas [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 29, 2006 12:13 AM > To: [email protected] > Subject: RE: [xfire-user] help! - spring2, jaxb2 config setup > > > Have you imported the xfire spring config into your main > spring config? > > I didn't at when I posted that last stack trace. I'm > importing in my web.xml file > > > > Ok.. I've got the WSDL to generate! I think my problem is I > need to be using the jaxbServiceFactory but don't know how to > wire it up correct. > > > > Here's what my web.xml and xfire-servlet.xml files look like; > > > > <context-param> > > <param-name>log4jConfigLocation</param-name> > > > <param-value>/WEB-INF/log4j.properties</param-value> > > </context-param> > > <context-param> > > <param-name>log4jRefreshInterval</param-name> > > <param-value>1000</param-value> > > </context-param> > > <context-param> > > <param-name>contextConfigLocation</param-name> > > <param-value> > > /WEB-INF/applicationContext.xml > > /WEB-INF/xfire-servlet.xml > > classpath:org/codehaus/xfire/spring/xfire.xml > > </param-value> > > </context-param> > > > > <listener> > > > <listener-class>org.springframework.web.util.Log4jConfigListen > er</listener-class> > > </listener> > > > > <listener> > > > <listener-class>org.springframework.web.context.ContextLoaderL > istener</listener-class> > > </listener> > > > > <servlet> > > <servlet-name>dispatch</servlet-name> > > > <servlet-class>org.springframework.web.servlet.DispatcherServl > et</servlet-class> > > <load-on-startup>1</load-on-startup> > > </servlet> > > > > <servlet-mapping> > > <servlet-name>dispatch</servlet-name> > > <url-pattern>/*</url-pattern> > > </servlet-mapping> > > > > <!-- start Xfire --> > > <servlet> > > <servlet-name>XFireServlet</servlet-name> > > <servlet-class> > > org.codehaus.xfire.spring.XFireSpringServlet > > </servlet-class> > > </servlet> > > > > <servlet-mapping> > > <servlet-name>XFireServlet</servlet-name> > > <url-pattern>/servlet/XFireServlet/*</url-pattern> > > </servlet-mapping> > > > > <servlet-mapping> > > <servlet-name>XFireServlet</servlet-name> > > <url-pattern>/services/*</url-pattern> > > </servlet-mapping> > > <!-- end: XFire --> > > > > * - - - - - - - > > > > xfire-servlet.xml > > > > <?xml version="1.0" encoding="UTF-8"?> > > <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" > "http://www.springframework.org/dtd/spring-beans.dtd"> > > <beans> > > > > <bean id="vehicleLookup" > class="com.autoreturn.service.VehicleLookupServiceImpl" > > > <constructor-arg index="0" ref="DTSManager" /> > > <constructor-arg index="1" ref="XmlConverter" /> > > </bean> > > > > <bean name="jaxbServiceFactory" > class="org.codehaus.xfire.jaxb2.JaxbServiceFactory"> > > <constructor-arg ref="xfire.transportManager"/> > > </bean> > > > > > > <bean id="xfire.commonsAnnotations" > class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations"/> > > > > <bean id="handlerMapping" > class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping"> > > <property name="typeMappingRegistry"> > > <ref bean="xfire.typeMappingRegistry"/> > > </property> > > <property name="xfire"> > > <ref bean="xfire"/> > > </property> > > <property name="webAnnotations"> > > <ref bean="xfire.commonsAnnotations"/> > > </property> > > </bean> > > > > <bean > class="org.springframework.web.servlet.handler.SimpleUrlHandle > rMapping"> > > <property name="urlMap"> > > <map> > > <entry key="/"> > > <ref bean="handlerMapping"/> > > </entry> > > </map> > > </property> > > </bean> > > > > </beans> > > --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
