It occurred to me that I might want to clarify what I'm asking, since it's a slightly complicated scenario. As my immediate exception is an aegis.DatabindingException, I was hoping somebody with good experience with CXF & aegis could look at my mapping file setup and / or annotations. Since they don't seem to be having any effect I suspect I'm doing something ignorant, as I am pretty inexperienced with CXF and Aegis.
Also, I'm pretty green to this code, is it foolish to try to expose the same service via mule *and* the web app? They are exposed at different addresses, but it's the same code, the mule service definition refers to the same spring bean successfully exposed by CXF and the web app. Do implementation details preclude exposing this same service via mule at a different address? The web app is successfully publishing the service at /services/FooService, but the mule configuration at /mule/FooService is hitting the binding exception. If I make a request of a /mule/* URL the mule servlet gets invoked but can't find the endpoint, I think because it failed o get properly created due to the binding exception. My goal is to integrate mule into appfuse (and mule embeds cxf), but perhaps I'm taking a misstep in my pursuit of this. Should I perhaps suppress the web app's publication of services? I'm not seeing any conflict with ports or anything unless that's somehow involved with this binding exception but I'm new to both mule and CXF (I have more experience with appfuse and want to exploit it's web app capabilities and add mule in). It's a common scenario to load mule in web apps but most of the code on the mule site has very rudimentary web apps while appfuse has fairly high production values by comparison, I want to add mule to that rich environment. I am at liberty to share the code, there's not any "client" IP involved (hence the FooService), if anybody's interested, I can post it or send it to you. Thanks, --jack jackalista wrote: > > Hi, > > I'm trying to integrate mule which uses CXF and Aegis under the hood into > a current appfuse dist and am running into a binding exception. I've set > the binding to use Aegis, and it looks like it's having trouble with a > service super class that features a method "getAll()" with a parameterized > List<T> return value where type variable T is set to a domaon model class > by the instantiating extending class. The method signature is here: > > List<T> getAll(); > > At run time, extending class FooManagerImpl which implements interface > FooManager, is instantiated and it's inherited getAll() method sig looks > like this (Foo.java is the the hibernate persistent domain model class): > > List<Foo> getAll(); > > I've tried to use both the standard appfuse dist which includes xfire and > I also tried replacing xfire with CXF in appfuse but both suffer the same > Aegis binding exception about a failure to map the List return value of > getAll(). I'm taking this to mean that mule is using CXF / Aegis > > I tried exposing the superclass getAll method directly in the subclass > interface and implementation and then put this annotation on it to try to > keep Aegis from trying to bind it but it had no effect. I followed docs > on annotations for this here: > > http://cwiki.apache.org/CXF20DOC/developing-a-service.html#DevelopingaService-DevelopingaServiceusingJAXWS > > The annotation, which was apparently ignored, looks like this, but the > wsdl still showed the getAll() method: > > @WebMethod(exclude = true) > public List<Foo> getAll(); > > I also tried to use an Aegis XML mapping file which I placed in the jar > alonside the interface class [see attached screendump] is called > FooManager.aegis.xml [the class it is to map is the service interface > FooManager.class / FooManager.java, etc.]. The mapping class looks like > this: > > <mappings> > <mapping name="FooManager"> > <method name="getAll"> > <return-type name="foos" > componentType="org.jackalista.integration.model.Foo"/> > </method> > </mapping> > </mappings> > > Docs on using mapping files is here (for aegis 2.1, as I'm using CXF > 2.1.5), see the section on "Services and Parameters": > > http://cwiki.apache.org/CXF20DOC/aegis-21.html > > > It seems that both the exlude annotation and the aegis mapping file are > both being oignored but as I'm new to boeth CXF and Aegis, it may be due > to use error. In the version of appfuse in which I replaced xfire with > cxf, I used the version of cxf that the latest mule apparently uses which > is 2.1.5. The web app *is* able to expose the same annotated service > interface and class properly as a web service and publishes the wsld at > localhost:8080/services/FooService?wsdl as would be expected. It looks > like appfuse and mule each have their own instance of CXF but I'm not sure > about that. While the web app and its CXF properly publish the web > service, mule and the CXF it uses are hitting an exception related to > Aegis trying to map the getAll() method and failing. > > The exception being thrown is: > > Caused by: org.apache.cxf.aegis.DatabindingException: Error initializing > parameters for operation > {http://service.integration.jackalista.org/}getAll: Cannot create mapping > for java.util.List, unspecified component type for method getAll parameter > -1 > > > Can anybody point me in the right direction? It seems like the aegis > mapping code is having trouble with the parameterized List<T> getAll() > return value where T = Foo.java at run time. I uploaded a small zip file > of relevant files if that helps... > http://www.nabble.com/file/p25831156/jarfile.and.scrn.dump.zip > jarfile.and.scrn.dump.zip I suspect that I may be doing something naive / > stupid with the mapping file, the annotation or may perhaps be approaching > this incorrectly, any help would be greatly appreciated, thanks. > > --jack > > > My mule config is loaded via the listener from web.xml, essentially I too > the bookstore demo code configuration and grafted it onto an appfuse dist. > Here's the service configuration for the service experiencing the binding > exception, FooService: > > > Fisrt I import my spring (2.5.6) applicationContext.xml with my service > interface & impl in it: > > <!-- import beans from appfuse applicationContext.xml --> > <spring:beans> > <spring:import resource="classpath:applicationContext.xml" /> > </spring:beans> > > Then, here's the service deinition > > <service name="FooService"> > <inbound> > <!-- Public interface --> > <cxf:inbound-endpoint address="cxf:http://0.0.0.0:8777/mule/foo"> > <cxf:databinding> > <spring:bean > class="org.apache.cxf.aegis.databinding.AegisDatabinding"/> > </cxf:databinding> > </cxf:inbound-endpoint> > > <!-- Administration interface --> > <inbound-endpoint address="servlet://foo"> > <transformers> > <!-- Convert request parameters to String object --> > <custom-transformer > class="org.jackalista.integration.service.transformers.HttpRequestToString"/> > </transformers> > <response-transformers> > <!-- Format response to be a nice HTML page --> > <custom-transformer > class="org.jackalista.integration.service.transformers.AddFooListResponse"/> > <!-- Force text/html, otherwise it falls back to request props, > which have form-encoded one --> > <transformer ref="setHtmlContentType"/> > </response-transformers> > </inbound-endpoint> > </inbound> > <pooled-component> > <!-- singleton-object > class="org.jackalista.integration.service.impl.FooManagerImpl" / --> > <spring-object bean="fooManager" /> > </pooled-component> > http://www.nabble.com/file/p25831156/aegis.binding.problem.zip > aegis.binding.problem.zip > -- View this message in context: http://www.nabble.com/cxf.aegis.DatabindingException%3A-Cannot-create-mapping-for-java.util.List%2C-unspecified-component-type-for-method-getAll-parameter--1-tp25831156p25836496.html Sent from the cxf-user mailing list archive at Nabble.com.
