cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jackalista <j...@twaxx.com>
Subject cxf.aegis.DatabindingException: Cannot create mapping for java.util.List, unspecified component type for method getAll parameter -1
Date Sat, 10 Oct 2009 05:13:58 GMT

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-tp25831156p25831156.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message