databinding problem with List from getAll() integrating mule 2.2.2 and appfuse 2.02

9 messages Options
Embed this post
Permalink
jackalista

databinding problem with List from getAll() integrating mule 2.2.2 and appfuse 2.02

Reply Threaded More More options
Print post
Permalink
Hi,

I was wondering if anybody here might know what's going with an exception I've got embedding mule ESB in an appfuse app.  First, mule itself uses CXF, and I made a version of appfuse work with CXF but this problem exists with both that and an unmodified appfuse that still uses XFire so I suspect that's irrelevant.  It's the miule CXF code that's blowing up on it, using both JAXB and Aegis databinding.  Aegis looks better for handling Collections and things along those lines so I'll show that exception:


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

Based on the following from this CXF article under the heading "Collections":

http://cwiki.apache.org/CXF20DOC/aegis-21.html

which says:
---------------------------------------------------------
"If you use a 'raw' collection type, Aegis will map it as a collection of xsd:any particles. If you want the WSDL to show it as a collection of some specific type, the easiest thing to do is to use Java generics instead of raw types. If, for some reason, you can't do that, you can use the componentType and keyType attributes of a property to specify the Java classes."
---------------------------------------------------------


The getAll() method which is part of appfuse core does return an untyped (no generics) java.util.List, doesn't it?  I'd have thought that Aegis would have mapped it as a collection of xsd:any as it says above but it's blowing up with that exception complaining about the component type of the List which looks kind of like what's in that article.  

I'm trying to set up code first dev with mule as is done with appfuse web services but am not sure what to do to fix this exception.  Does anyone know why xfire / xmlbeans in appfuse proper has no problem with this but Aegis is throwing up?  Do I need to add further annotations or different ones?  I'd like to get CXF under mule working the same basic way as xfire does under the standard appfuse dist but am not finding too many clear answers in what docs I've seen from the mule and CXF sites.  

Does anyone know the details about our xfire implementation regarding wsdl / XSD generation and mapping?  And / or can anybody recommend a very comprehensive CXF book / manual / tutorial / etc. that might shed some light on this?  I'd really like to get an appfuse mule starter app up but this needs to be resolved.  If you're interested in the nitty gritty it looks like the latest mule (2.2.2) includes CXF 2.1.5 which it uses for things like databinding and web services support.  I'm also open to input about how to set this up and will share the source, I'm trying to get a decent code first set up analogous to what exists now with xfire but am also interested in a wsdl first set up, feel free to speak up if you have opinions about how that might best be done and I might just do it for you.

--j
jackalista

Re: databinding problem with List from getAll() integrating mule 2.2.2 and appfuse 2.02

Reply Threaded More More options
Print post
Permalink
I ran full-source on a new dist to see how it's defined, I remembered incorrectly, the getAll() method returns a list with generics but they're parameterized, is this the problem?:

List<T> getAll();

public List<T> getAll() {
    return genericDao.getAll();
}

Where "T" is a type variable... I'm curious as to what had to be done to get xfire/xmlbeans to properly map this as maybe I can do the same thing with CXF/Aegis, does anybody know the details?  I didn't see anything in xfire-servlet.xml that seems to be related but I could be wrong.

--jack

jackalista wrote:
Hi,

I was wondering if anybody here might know what's going with an exception I've got embedding mule ESB in an appfuse app.  First, mule itself uses CXF, and I made a version of appfuse work with CXF but this problem exists with both that and an unmodified appfuse that still uses XFire so I suspect that's irrelevant.  It's the miule CXF code that's blowing up on it, using both JAXB and Aegis databinding.  Aegis looks better for handling Collections and things along those lines so I'll show that exception:


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

Based on the following from this CXF article under the heading "Collections":

http://cwiki.apache.org/CXF20DOC/aegis-21.html

which says:
---------------------------------------------------------
"If you use a 'raw' collection type, Aegis will map it as a collection of xsd:any particles. If you want the WSDL to show it as a collection of some specific type, the easiest thing to do is to use Java generics instead of raw types. If, for some reason, you can't do that, you can use the componentType and keyType attributes of a property to specify the Java classes."
---------------------------------------------------------


The getAll() method which is part of appfuse core does return an untyped (no generics) java.util.List, doesn't it?  I'd have thought that Aegis would have mapped it as a collection of xsd:any as it says above but it's blowing up with that exception complaining about the component type of the List which looks kind of like what's in that article.  

I'm trying to set up code first dev with mule as is done with appfuse web services but am not sure what to do to fix this exception.  Does anyone know why xfire / xmlbeans in appfuse proper has no problem with this but Aegis is throwing up?  Do I need to add further annotations or different ones?  I'd like to get CXF under mule working the same basic way as xfire does under the standard appfuse dist but am not finding too many clear answers in what docs I've seen from the mule and CXF sites.  

Does anyone know the details about our xfire implementation regarding wsdl / XSD generation and mapping?  And / or can anybody recommend a very comprehensive CXF book / manual / tutorial / etc. that might shed some light on this?  I'd really like to get an appfuse mule starter app up but this needs to be resolved.  If you're interested in the nitty gritty it looks like the latest mule (2.2.2) includes CXF 2.1.5 which it uses for things like databinding and web services support.  I'm also open to input about how to set this up and will share the source, I'm trying to get a decent code first set up analogous to what exists now with xfire but am also interested in a wsdl first set up, feel free to speak up if you have opinions about how that might best be done and I might just do it for you.

--j
mraible

Re: databinding problem with List from getAll() integrating mule 2.2.2 and appfuse 2.02

Reply Threaded More More options
Print post
Permalink
In reply to this post by jackalista
getAll returns a type T, so it is using Generics:

http://static.appfuse.org/appfuse-service/apidocs/org/appfuse/service/impl/GenericManagerImpl.html

Unfortunately, I don't have a lot of experience with CXF and generics,
so I don't know how to solve this.

Matt

On Tue, Oct 6, 2009 at 7:39 PM, jackalista <[hidden email]> wrote:

>
> Hi,
>
> I was wondering if anybody here might know what's going with an exception
> I've got embedding mule ESB in an appfuse app.  First, mule itself uses CXF,
> and I made a version of appfuse work with CXF but this problem exists with
> both that and an unmodified appfuse that still uses XFire so I suspect
> that's irrelevant.  It's the miule CXF code that's blowing up on it, using
> both JAXB and Aegis databinding.  Aegis looks better for handling
> Collections and things along those lines so I'll show that exception:
>
>
> 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
>
> Based on the following from this CXF article under the heading
> "Collections":
>
> http://cwiki.apache.org/CXF20DOC/aegis-21.html
>
> which says:
> ---------------------------------------------------------
> "If you use a 'raw' collection type, Aegis will map it as a collection of
> xsd:any particles. If you want the WSDL to show it as a collection of some
> specific type, the easiest thing to do is to use Java generics instead of
> raw types. If, for some reason, you can't do that, you can use the
> componentType and keyType attributes of a property to specify the Java
> classes."
> ---------------------------------------------------------
>
>
> The getAll() method which is part of appfuse core does return an untyped (no
> generics) java.util.List, doesn't it?  I'd have thought that Aegis would
> have mapped it as a collection of xsd:any as it says above but it's blowing
> up with that exception complaining about the component type of the List
> which looks kind of like what's in that article.
>
> I'm trying to set up code first dev with mule as is done with appfuse web
> services but am not sure what to do to fix this exception.  Does anyone know
> why xfire / xmlbeans in appfuse proper has no problem with this but Aegis is
> throwing up?  Do I need to add further annotations or different ones?  I'd
> like to get CXF under mule working the same basic way as xfire does under
> the standard appfuse dist but am not finding too many clear answers in what
> docs I've seen from the mule and CXF sites.
>
> Does anyone know the details about our xfire implementation regarding wsdl /
> XSD generation and mapping?  And / or can anybody recommend a very
> comprehensive CXF book / manual / tutorial / etc. that might shed some light
> on this?  I'd really like to get an appfuse mule starter app up but this
> needs to be resolved.  If you're interested in the nitty gritty it looks
> like the latest mule (2.2.2) includes CXF 2.1.5 which it uses for things
> like databinding and web services support.  I'm also open to input about how
> to set this up and will share the source, I'm trying to get a decent code
> first set up analogous to what exists now with xfire but am also interested
> in a wsdl first set up, feel free to speak up if you have opinions about how
> that might best be done and I might just do it for you.
>
> --j
> --
> View this message in context: http://www.nabble.com/databinding-problem-with-List-from-getAll%28%29-integrating-mule-2.2.2-and-appfuse-2.02-tp25778321s2369p25778321.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

jackalista

Re: databinding problem with List from getAll() integrating mule 2.2.2 and appfuse 2.02

Reply Threaded More More options
Print post
Permalink
Yep, I just ran full-source and discovered that, thanks... perhaps it's the parameterization that's causing the problem...?  Their web site is good for some things but a bit brief on others.  I'm going to have to dig further, you don't know any books that cover CXF well do you?  

The other thing that seems weird is that the xfire code creates XSD elements for all the domain objects and everything but none of the CXF databindings appear to do so.  Is there configuration to make xfire do that?  (So I could do analogous config for CXF/Aegis?).  I'd like to get CXF working the same ways as XFire.  Do you have to annotate your model classes to get them put in the wsdl?

tia,

--j

mraible wrote:
getAll returns a type T, so it is using Generics:

http://static.appfuse.org/appfuse-service/apidocs/org/appfuse/service/impl/GenericManagerImpl.html

Unfortunately, I don't have a lot of experience with CXF and generics,
so I don't know how to solve this.

Matt

On Tue, Oct 6, 2009 at 7:39 PM, jackalista <jack@twaxx.com> wrote:
>
> Hi,
>
> I was wondering if anybody here might know what's going with an exception
> I've got embedding mule ESB in an appfuse app.  First, mule itself uses CXF,
> and I made a version of appfuse work with CXF but this problem exists with
> both that and an unmodified appfuse that still uses XFire so I suspect
> that's irrelevant.  It's the miule CXF code that's blowing up on it, using
> both JAXB and Aegis databinding.  Aegis looks better for handling
> Collections and things along those lines so I'll show that exception:
>
>
> 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
>
> Based on the following from this CXF article under the heading
> "Collections":
>
> http://cwiki.apache.org/CXF20DOC/aegis-21.html
>
> which says:
> ---------------------------------------------------------
> "If you use a 'raw' collection type, Aegis will map it as a collection of
> xsd:any particles. If you want the WSDL to show it as a collection of some
> specific type, the easiest thing to do is to use Java generics instead of
> raw types. If, for some reason, you can't do that, you can use the
> componentType and keyType attributes of a property to specify the Java
> classes."
> ---------------------------------------------------------
>
>
> The getAll() method which is part of appfuse core does return an untyped (no
> generics) java.util.List, doesn't it?  I'd have thought that Aegis would
> have mapped it as a collection of xsd:any as it says above but it's blowing
> up with that exception complaining about the component type of the List
> which looks kind of like what's in that article.
>
> I'm trying to set up code first dev with mule as is done with appfuse web
> services but am not sure what to do to fix this exception.  Does anyone know
> why xfire / xmlbeans in appfuse proper has no problem with this but Aegis is
> throwing up?  Do I need to add further annotations or different ones?  I'd
> like to get CXF under mule working the same basic way as xfire does under
> the standard appfuse dist but am not finding too many clear answers in what
> docs I've seen from the mule and CXF sites.
>
> Does anyone know the details about our xfire implementation regarding wsdl /
> XSD generation and mapping?  And / or can anybody recommend a very
> comprehensive CXF book / manual / tutorial / etc. that might shed some light
> on this?  I'd really like to get an appfuse mule starter app up but this
> needs to be resolved.  If you're interested in the nitty gritty it looks
> like the latest mule (2.2.2) includes CXF 2.1.5 which it uses for things
> like databinding and web services support.  I'm also open to input about how
> to set this up and will share the source, I'm trying to get a decent code
> first set up analogous to what exists now with xfire but am also interested
> in a wsdl first set up, feel free to speak up if you have opinions about how
> that might best be done and I might just do it for you.
>
> --j
> --
> View this message in context: http://www.nabble.com/databinding-problem-with-List-from-getAll%28%29-integrating-mule-2.2.2-and-appfuse-2.02-tp25778321s2369p25778321.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@appfuse.dev.java.net
> For additional commands, e-mail: users-help@appfuse.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@appfuse.dev.java.net
For additional commands, e-mail: users-help@appfuse.dev.java.net
jackalista

Re: databinding problem with List from getAll() integrating mule 2.2.2 and appfuse 2.02

Reply Threaded More More options
Print post
Permalink
In reply to this post by jackalista
I ran full-source on a new dist to see how it's defined, I remembered incorrectly, the getAll() method returns a list with generics but they're parameterized, is this the problem?:

List<T> getAll();

public List<T> getAll() {
    return genericDao.getAll();
}

Where "T" is a type variable... I'm curious as to what had to be done to get xfire/xmlbeans to properly map this as maybe I can do the same thing with CXF/Aegis, does anybody know the details?  I didn't see anything in xfire-servlet.xml that seems to be related but I could be wrong.

--jack

jackalista wrote:
Hi,

I was wondering if anybody here might know what's going with an exception I've got embedding mule ESB in an appfuse app.  First, mule itself uses CXF, and I made a version of appfuse work with CXF but this problem exists with both that and an unmodified appfuse that still uses XFire so I suspect that's irrelevant.  It's the miule CXF code that's blowing up on it, using both JAXB and Aegis databinding.  Aegis looks better for handling Collections and things along those lines so I'll show that exception:


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

Based on the following from this CXF article under the heading "Collections":

http://cwiki.apache.org/CXF20DOC/aegis-21.html

which says:
---------------------------------------------------------
"If you use a 'raw' collection type, Aegis will map it as a collection of xsd:any particles. If you want the WSDL to show it as a collection of some specific type, the easiest thing to do is to use Java generics instead of raw types. If, for some reason, you can't do that, you can use the componentType and keyType attributes of a property to specify the Java classes."
---------------------------------------------------------


The getAll() method which is part of appfuse core does return an untyped (no generics) java.util.List, doesn't it?  I'd have thought that Aegis would have mapped it as a collection of xsd:any as it says above but it's blowing up with that exception complaining about the component type of the List which looks kind of like what's in that article.  

I'm trying to set up code first dev with mule as is done with appfuse web services but am not sure what to do to fix this exception.  Does anyone know why xfire / xmlbeans in appfuse proper has no problem with this but Aegis is throwing up?  Do I need to add further annotations or different ones?  I'd like to get CXF under mule working the same basic way as xfire does under the standard appfuse dist but am not finding too many clear answers in what docs I've seen from the mule and CXF sites.  

Does anyone know the details about our xfire implementation regarding wsdl / XSD generation and mapping?  And / or can anybody recommend a very comprehensive CXF book / manual / tutorial / etc. that might shed some light on this?  I'd really like to get an appfuse mule starter app up but this needs to be resolved.  If you're interested in the nitty gritty it looks like the latest mule (2.2.2) includes CXF 2.1.5 which it uses for things like databinding and web services support.  I'm also open to input about how to set this up and will share the source, I'm trying to get a decent code first set up analogous to what exists now with xfire but am also interested in a wsdl first set up, feel free to speak up if you have opinions about how that might best be done and I might just do it for you.

--j
mraible

Re: databinding problem with List from getAll() integrating mule 2.2.2 and appfuse 2.02

Reply Threaded More More options
Print post
Permalink
AppFuse 2.0.2 used a separate service for webservices
(UserService.java) and didn't use the getAll() method. You could try
overriding it in your interface to return a specific type.

Matt

On Wed, Oct 7, 2009 at 1:46 PM, jackalista <[hidden email]> wrote:

>
> I ran full-source on a new dist to see how it's defined, I remembered
> incorrectly, the getAll() method returns a list with generics but they're
> parameterized, is this the problem?:
>
> List<T> getAll();
>
> public List<T> getAll() {
>    return genericDao.getAll();
> }
>
> Where "T" is a type variable... I'm curious as to what had to be done to get
> xfire/xmlbeans to properly map this as maybe I can do the same thing with
> CXF/Aegis, does anybody know the details?  I didn't see anything in
> xfire-servlet.xml that seems to be related but I could be wrong.
>
> --jack
>
>
> jackalista wrote:
>>
>> Hi,
>>
>> I was wondering if anybody here might know what's going with an exception
>> I've got embedding mule ESB in an appfuse app.  First, mule itself uses
>> CXF, and I made a version of appfuse work with CXF but this problem exists
>> with both that and an unmodified appfuse that still uses XFire so I
>> suspect that's irrelevant.  It's the miule CXF code that's blowing up on
>> it, using both JAXB and Aegis databinding.  Aegis looks better for
>> handling Collections and things along those lines so I'll show that
>> exception:
>>
>>
>> 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
>>
>> Based on the following from this CXF article under the heading
>> "Collections":
>>
>> http://cwiki.apache.org/CXF20DOC/aegis-21.html
>>
>> which says:
>> ---------------------------------------------------------
>> "If you use a 'raw' collection type, Aegis will map it as a collection of
>> xsd:any particles. If you want the WSDL to show it as a collection of some
>> specific type, the easiest thing to do is to use Java generics instead of
>> raw types. If, for some reason, you can't do that, you can use the
>> componentType and keyType attributes of a property to specify the Java
>> classes."
>> ---------------------------------------------------------
>>
>>
>> The getAll() method which is part of appfuse core does return an untyped
>> (no generics) java.util.List, doesn't it?  I'd have thought that Aegis
>> would have mapped it as a collection of xsd:any as it says above but it's
>> blowing up with that exception complaining about the component type of the
>> List which looks kind of like what's in that article.
>>
>> I'm trying to set up code first dev with mule as is done with appfuse web
>> services but am not sure what to do to fix this exception.  Does anyone
>> know why xfire / xmlbeans in appfuse proper has no problem with this but
>> Aegis is throwing up?  Do I need to add further annotations or different
>> ones?  I'd like to get CXF under mule working the same basic way as xfire
>> does under the standard appfuse dist but am not finding too many clear
>> answers in what docs I've seen from the mule and CXF sites.
>>
>> Does anyone know the details about our xfire implementation regarding wsdl
>> / XSD generation and mapping?  And / or can anybody recommend a very
>> comprehensive CXF book / manual / tutorial / etc. that might shed some
>> light on this?  I'd really like to get an appfuse mule starter app up but
>> this needs to be resolved.  If you're interested in the nitty gritty it
>> looks like the latest mule (2.2.2) includes CXF 2.1.5 which it uses for
>> things like databinding and web services support.  I'm also open to input
>> about how to set this up and will share the source, I'm trying to get a
>> decent code first set up analogous to what exists now with xfire but am
>> also interested in a wsdl first set up, feel free to speak up if you have
>> opinions about how that might best be done and I might just do it for you.
>>
>> --j
>>
>
> --
> View this message in context: http://www.nabble.com/databinding-problem-with-List-from-getAll%28%29-integrating-mule-2.2.2-and-appfuse-2.02-tp25778321s2369p25791241.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

jackalista

Re: databinding problem with List from getAll() integrating mule 2.2.2 and appfuse 2.02

Reply Threaded More More options
Print post
Permalink
Thx Matt, I'll take a look at that, I now have a full-src dist for such things set up.  

However, what would be preferable to such a tactic might be a non-intrusive fix via an XML mapping file, would it not?  Then, a mule/appfuse hybrid could remain a reusable starter app with mule, and you would simply have to add an Aegis XML mapping file to expose your existing mgr classes as mule services.  I'm pretty sure each service class, inheriting and parameterizing the getALL() from the GenericManager, could declare it in a Foo.aegis.xml mapping file, at least I'm going to try it.

It seems like Aegis is the better binding to use (and is easy to configure in mule) as it has support for Collections which are widely used in appfuse and it broke less severely than JAXB too but it's academic until it stops breaking, hopefully the mapping file will do it... Let me know what you think, I'm up to my ear lobes in it anyway so now's the time.

--j

mraible wrote:
AppFuse 2.0.2 used a separate service for webservices
(UserService.java) and didn't use the getAll() method. You could try
overriding it in your interface to return a specific type.

Matt

On Wed, Oct 7, 2009 at 1:46 PM, jackalista <jack@twaxx.com> wrote:
>
> I ran full-source on a new dist to see how it's defined, I remembered
> incorrectly, the getAll() method returns a list with generics but they're
> parameterized, is this the problem?:
>
> List<T> getAll();
>
> public List<T> getAll() {
>    return genericDao.getAll();
> }
>
> Where "T" is a type variable... I'm curious as to what had to be done to get
> xfire/xmlbeans to properly map this as maybe I can do the same thing with
> CXF/Aegis, does anybody know the details?  I didn't see anything in
> xfire-servlet.xml that seems to be related but I could be wrong.
>
> --jack
>
>
> jackalista wrote:
>>
>> Hi,
>>
>> I was wondering if anybody here might know what's going with an exception
>> I've got embedding mule ESB in an appfuse app.  First, mule itself uses
>> CXF, and I made a version of appfuse work with CXF but this problem exists
>> with both that and an unmodified appfuse that still uses XFire so I
>> suspect that's irrelevant.  It's the miule CXF code that's blowing up on
>> it, using both JAXB and Aegis databinding.  Aegis looks better for
>> handling Collections and things along those lines so I'll show that
>> exception:
>>
>>
>> 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
>>
>> Based on the following from this CXF article under the heading
>> "Collections":
>>
>> http://cwiki.apache.org/CXF20DOC/aegis-21.html
>>
>> which says:
>> ---------------------------------------------------------
>> "If you use a 'raw' collection type, Aegis will map it as a collection of
>> xsd:any particles. If you want the WSDL to show it as a collection of some
>> specific type, the easiest thing to do is to use Java generics instead of
>> raw types. If, for some reason, you can't do that, you can use the
>> componentType and keyType attributes of a property to specify the Java
>> classes."
>> ---------------------------------------------------------
>>
>>
>> The getAll() method which is part of appfuse core does return an untyped
>> (no generics) java.util.List, doesn't it?  I'd have thought that Aegis
>> would have mapped it as a collection of xsd:any as it says above but it's
>> blowing up with that exception complaining about the component type of the
>> List which looks kind of like what's in that article.
>>
>> I'm trying to set up code first dev with mule as is done with appfuse web
>> services but am not sure what to do to fix this exception.  Does anyone
>> know why xfire / xmlbeans in appfuse proper has no problem with this but
>> Aegis is throwing up?  Do I need to add further annotations or different
>> ones?  I'd like to get CXF under mule working the same basic way as xfire
>> does under the standard appfuse dist but am not finding too many clear
>> answers in what docs I've seen from the mule and CXF sites.
>>
>> Does anyone know the details about our xfire implementation regarding wsdl
>> / XSD generation and mapping?  And / or can anybody recommend a very
>> comprehensive CXF book / manual / tutorial / etc. that might shed some
>> light on this?  I'd really like to get an appfuse mule starter app up but
>> this needs to be resolved.  If you're interested in the nitty gritty it
>> looks like the latest mule (2.2.2) includes CXF 2.1.5 which it uses for
>> things like databinding and web services support.  I'm also open to input
>> about how to set this up and will share the source, I'm trying to get a
>> decent code first set up analogous to what exists now with xfire but am
>> also interested in a wsdl first set up, feel free to speak up if you have
>> opinions about how that might best be done and I might just do it for you.
>>
>> --j
>>
>
> --
> View this message in context: http://www.nabble.com/databinding-problem-with-List-from-getAll%28%29-integrating-mule-2.2.2-and-appfuse-2.02-tp25778321s2369p25791241.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@appfuse.dev.java.net
> For additional commands, e-mail: users-help@appfuse.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@appfuse.dev.java.net
For additional commands, e-mail: users-help@appfuse.dev.java.net
jackalista

Re: databinding problem with List from getAll() integrating mule 2.2.2 and appfuse 2.02

Reply Threaded More More options
Print post
Permalink
Hi,

I managed to resolve this, it turns out 3 things had to be changed:

1. Apparently the CXFServlet and the MuleRESTReceiverServlet don't play nice together. I'm not shocked about this but I am disappointed; I wanted to run services both from mule and from the web app but it looks like that may not be possible.  You must take the CXFServlet (or most likely the XFire servlet too) out of your web.xml and remove the mapping and map the mule receiver servlet to /services/*.

2. Similarly, thou shalt not declare any endpoints via CXF means (again, likely also true of xfire), at least not via cxf-servlet.xml. I had this declaration in cxf-servlet.xml but needed to comment it out, as CXF will publish it even with the CXFServlet not in play:

<!--
<jaxws:endpoint
id="FooService"
implementor="#fooManager"
address="/FooService" >
</jaxws:endpoint>
-->

3. The above two were not shocking, I had doubts from the get-go about running both CXF and mule servlets together in the same web app but this last part surprised me. I had found an example on the mule site showing how to change the databinding. The example shows an inbound-endpoint with CXF prefix, instead of the prefix-less inbound-endpoint I found in the bookstore example. It didn't seem like I could change the binding to aegis without using the prefix but when I used the prefix I got a MalformedEndpointException... but if I remove the cxf prefix (and also the binding directive), it works fine... ?!?!?  I haven't any deep detail on that yet but I'll try to come back and update this to make it easier for the next guy... the mule example webapp code is no where near as functional nor as pretty as appfuse so I want to get this working to facilitate building mule web apps.  The problematic and working config for the mule endpoint are here...

This structure throws a MalformedEndpointException:

<cxf:inbound-endpoint address="cxf:http://0.0.0.0:8888/services/FooService">
<cxf:databinding>
<spring:bean class="org.apache.cxf.aegis.databinding.AegisDatabinding"/>
</cxf:databinding>
</cxf:inbound-endpoint>

This structure does not throw any exceptions and the web app loads:

<inbound-endpoint address="cxf:http://0.0.0.0:8888/services/FooService"/>


-=j=-


jackalista wrote:
Thx Matt, I'll take a look at that, I now have a full-src dist for such things set up.  

However, what would be preferable to such a tactic might be a non-intrusive fix via an XML mapping file, would it not?  Then, a mule/appfuse hybrid could remain a reusable starter app with mule, and you would simply have to add an Aegis XML mapping file to expose your existing mgr classes as mule services.  I'm pretty sure each service class, inheriting and parameterizing the getALL() from the GenericManager, could declare it in a Foo.aegis.xml mapping file, at least I'm going to try it.

It seems like Aegis is the better binding to use (and is easy to configure in mule) as it has support for Collections which are widely used in appfuse and it broke less severely than JAXB too but it's academic until it stops breaking, hopefully the mapping file will do it... Let me know what you think, I'm up to my ear lobes in it anyway so now's the time.

--j

mraible wrote:
AppFuse 2.0.2 used a separate service for webservices
(UserService.java) and didn't use the getAll() method. You could try
overriding it in your interface to return a specific type.

Matt

On Wed, Oct 7, 2009 at 1:46 PM, jackalista <jack@twaxx.com> wrote:
>
> I ran full-source on a new dist to see how it's defined, I remembered
> incorrectly, the getAll() method returns a list with generics but they're
> parameterized, is this the problem?:
>
> List<T> getAll();
>
> public List<T> getAll() {
>    return genericDao.getAll();
> }
>
> Where "T" is a type variable... I'm curious as to what had to be done to get
> xfire/xmlbeans to properly map this as maybe I can do the same thing with
> CXF/Aegis, does anybody know the details?  I didn't see anything in
> xfire-servlet.xml that seems to be related but I could be wrong.
>
> --jack
>
>
> jackalista wrote:
>>
>> Hi,
>>
>> I was wondering if anybody here might know what's going with an exception
>> I've got embedding mule ESB in an appfuse app.  First, mule itself uses
>> CXF, and I made a version of appfuse work with CXF but this problem exists
>> with both that and an unmodified appfuse that still uses XFire so I
>> suspect that's irrelevant.  It's the miule CXF code that's blowing up on
>> it, using both JAXB and Aegis databinding.  Aegis looks better for
>> handling Collections and things along those lines so I'll show that
>> exception:
>>
>>
>> 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
>>
>> Based on the following from this CXF article under the heading
>> "Collections":
>>
>> http://cwiki.apache.org/CXF20DOC/aegis-21.html
>>
>> which says:
>> ---------------------------------------------------------
>> "If you use a 'raw' collection type, Aegis will map it as a collection of
>> xsd:any particles. If you want the WSDL to show it as a collection of some
>> specific type, the easiest thing to do is to use Java generics instead of
>> raw types. If, for some reason, you can't do that, you can use the
>> componentType and keyType attributes of a property to specify the Java
>> classes."
>> ---------------------------------------------------------
>>
>>
>> The getAll() method which is part of appfuse core does return an untyped
>> (no generics) java.util.List, doesn't it?  I'd have thought that Aegis
>> would have mapped it as a collection of xsd:any as it says above but it's
>> blowing up with that exception complaining about the component type of the
>> List which looks kind of like what's in that article.
>>
>> I'm trying to set up code first dev with mule as is done with appfuse web
>> services but am not sure what to do to fix this exception.  Does anyone
>> know why xfire / xmlbeans in appfuse proper has no problem with this but
>> Aegis is throwing up?  Do I need to add further annotations or different
>> ones?  I'd like to get CXF under mule working the same basic way as xfire
>> does under the standard appfuse dist but am not finding too many clear
>> answers in what docs I've seen from the mule and CXF sites.
>>
>> Does anyone know the details about our xfire implementation regarding wsdl
>> / XSD generation and mapping?  And / or can anybody recommend a very
>> comprehensive CXF book / manual / tutorial / etc. that might shed some
>> light on this?  I'd really like to get an appfuse mule starter app up but
>> this needs to be resolved.  If you're interested in the nitty gritty it
>> looks like the latest mule (2.2.2) includes CXF 2.1.5 which it uses for
>> things like databinding and web services support.  I'm also open to input
>> about how to set this up and will share the source, I'm trying to get a
>> decent code first set up analogous to what exists now with xfire but am
>> also interested in a wsdl first set up, feel free to speak up if you have
>> opinions about how that might best be done and I might just do it for you.
>>
>> --j
>>
>
> --
> View this message in context: http://www.nabble.com/databinding-problem-with-List-from-getAll%28%29-integrating-mule-2.2.2-and-appfuse-2.02-tp25778321s2369p25791241.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@appfuse.dev.java.net
> For additional commands, e-mail: users-help@appfuse.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@appfuse.dev.java.net
For additional commands, e-mail: users-help@appfuse.dev.java.net
mraible

Re: databinding problem with List from getAll() integrating mule 2.2.2 and appfuse 2.02

Reply Threaded More More options
Print post
Permalink
FYI ... it looks like CXF 2.3 will support automatic discovery of
@WebService annotations.

https://issues.apache.org/jira/browse/CXF-1355

Matt

On Mon, Oct 12, 2009 at 7:06 PM, jackalista <[hidden email]> wrote:

>
> Hi,
>
> I managed to resolve this, it turns out 3 things had to be changed:
>
> 1. Apparently the CXFServlet and the MuleRESTReceiverServlet don't play nice
> together. I'm not shocked about this but I am disappointed; I wanted to run
> services both from mule and from the web app but it looks like that may not
> be possible.  You must take the CXFServlet (or most likely the XFire servlet
> too) out of your web.xml and remove the mapping and map the mule receiver
> servlet to /services/*.
>
> 2. Similarly, thou shalt not declare any endpoints via CXF means (again,
> likely also true of xfire), at least not via cxf-servlet.xml. I had this
> declaration in cxf-servlet.xml but needed to comment it out, as CXF will
> publish it even with the CXFServlet not in play:
>
> <!--
> <jaxws:endpoint
> id="FooService"
> implementor="#fooManager"
> address="/FooService" >
> </jaxws:endpoint>
> -->
>
> 3. The above two were not shocking, I had doubts from the get-go about
> running both CXF and mule servlets together in the same web app but this
> last part surprised me. I had found an example on the mule site showing how
> to change the databinding. The example shows an inbound-endpoint with CXF
> prefix, instead of the prefix-less inbound-endpoint I found in the bookstore
> example. It didn't seem like I could change the binding to aegis without
> using the prefix but when I used the prefix I got a
> MalformedEndpointException... but if I remove the cxf prefix (and also the
> binding directive), it works fine... ?!?!?  I haven't any deep detail on
> that yet but I'll try to come back and update this to make it easier for the
> next guy... the mule example webapp code is no where near as functional nor
> as pretty as appfuse so I want to get this working to facilitate building
> mule web apps.  The problematic and working config for the mule endpoint are
> here...
>
> This structure throws a MalformedEndpointException:
>
> <cxf:inbound-endpoint address="cxf:http://0.0.0.0:8888/services/FooService">
> <cxf:databinding>
> <spring:bean class="org.apache.cxf.aegis.databinding.AegisDatabinding"/>
> </cxf:databinding>
> </cxf:inbound-endpoint>
>
> This structure does not throw any exceptions and the web app loads:
>
> <inbound-endpoint address="cxf:http://0.0.0.0:8888/services/FooService"/>
>
>
> -=j=-
>
>
>
> jackalista wrote:
>>
>> Thx Matt, I'll take a look at that, I now have a full-src dist for such
>> things set up.
>>
>> However, what would be preferable to such a tactic might be a
>> non-intrusive fix via an XML mapping file, would it not?  Then, a
>> mule/appfuse hybrid could remain a reusable starter app with mule, and you
>> would simply have to add an Aegis XML mapping file to expose your existing
>> mgr classes as mule services.  I'm pretty sure each service class,
>> inheriting and parameterizing the getALL() from the GenericManager, could
>> declare it in a Foo.aegis.xml mapping file, at least I'm going to try it.
>>
>> It seems like Aegis is the better binding to use (and is easy to configure
>> in mule) as it has support for Collections which are widely used in
>> appfuse and it broke less severely than JAXB too but it's academic until
>> it stops breaking, hopefully the mapping file will do it... Let me know
>> what you think, I'm up to my ear lobes in it anyway so now's the time.
>>
>> --j
>>
>>
>> mraible wrote:
>>>
>>> AppFuse 2.0.2 used a separate service for webservices
>>> (UserService.java) and didn't use the getAll() method. You could try
>>> overriding it in your interface to return a specific type.
>>>
>>> Matt
>>>
>>> On Wed, Oct 7, 2009 at 1:46 PM, jackalista <[hidden email]> wrote:
>>>>
>>>> I ran full-source on a new dist to see how it's defined, I remembered
>>>> incorrectly, the getAll() method returns a list with generics but
>>>> they're
>>>> parameterized, is this the problem?:
>>>>
>>>> List<T> getAll();
>>>>
>>>> public List<T> getAll() {
>>>>    return genericDao.getAll();
>>>> }
>>>>
>>>> Where "T" is a type variable... I'm curious as to what had to be done to
>>>> get
>>>> xfire/xmlbeans to properly map this as maybe I can do the same thing
>>>> with
>>>> CXF/Aegis, does anybody know the details?  I didn't see anything in
>>>> xfire-servlet.xml that seems to be related but I could be wrong.
>>>>
>>>> --jack
>>>>
>>>>
>>>> jackalista wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I was wondering if anybody here might know what's going with an
>>>>> exception
>>>>> I've got embedding mule ESB in an appfuse app.  First, mule itself uses
>>>>> CXF, and I made a version of appfuse work with CXF but this problem
>>>>> exists
>>>>> with both that and an unmodified appfuse that still uses XFire so I
>>>>> suspect that's irrelevant.  It's the miule CXF code that's blowing up
>>>>> on
>>>>> it, using both JAXB and Aegis databinding.  Aegis looks better for
>>>>> handling Collections and things along those lines so I'll show that
>>>>> exception:
>>>>>
>>>>>
>>>>> 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
>>>>>
>>>>> Based on the following from this CXF article under the heading
>>>>> "Collections":
>>>>>
>>>>> http://cwiki.apache.org/CXF20DOC/aegis-21.html
>>>>>
>>>>> which says:
>>>>> ---------------------------------------------------------
>>>>> "If you use a 'raw' collection type, Aegis will map it as a collection
>>>>> of
>>>>> xsd:any particles. If you want the WSDL to show it as a collection of
>>>>> some
>>>>> specific type, the easiest thing to do is to use Java generics instead
>>>>> of
>>>>> raw types. If, for some reason, you can't do that, you can use the
>>>>> componentType and keyType attributes of a property to specify the Java
>>>>> classes."
>>>>> ---------------------------------------------------------
>>>>>
>>>>>
>>>>> The getAll() method which is part of appfuse core does return an
>>>>> untyped
>>>>> (no generics) java.util.List, doesn't it?  I'd have thought that Aegis
>>>>> would have mapped it as a collection of xsd:any as it says above but
>>>>> it's
>>>>> blowing up with that exception complaining about the component type of
>>>>> the
>>>>> List which looks kind of like what's in that article.
>>>>>
>>>>> I'm trying to set up code first dev with mule as is done with appfuse
>>>>> web
>>>>> services but am not sure what to do to fix this exception.  Does anyone
>>>>> know why xfire / xmlbeans in appfuse proper has no problem with this
>>>>> but
>>>>> Aegis is throwing up?  Do I need to add further annotations or
>>>>> different
>>>>> ones?  I'd like to get CXF under mule working the same basic way as
>>>>> xfire
>>>>> does under the standard appfuse dist but am not finding too many clear
>>>>> answers in what docs I've seen from the mule and CXF sites.
>>>>>
>>>>> Does anyone know the details about our xfire implementation regarding
>>>>> wsdl
>>>>> / XSD generation and mapping?  And / or can anybody recommend a very
>>>>> comprehensive CXF book / manual / tutorial / etc. that might shed some
>>>>> light on this?  I'd really like to get an appfuse mule starter app up
>>>>> but
>>>>> this needs to be resolved.  If you're interested in the nitty gritty it
>>>>> looks like the latest mule (2.2.2) includes CXF 2.1.5 which it uses for
>>>>> things like databinding and web services support.  I'm also open to
>>>>> input
>>>>> about how to set this up and will share the source, I'm trying to get a
>>>>> decent code first set up analogous to what exists now with xfire but am
>>>>> also interested in a wsdl first set up, feel free to speak up if you
>>>>> have
>>>>> opinions about how that might best be done and I might just do it for
>>>>> you.
>>>>>
>>>>> --j
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/databinding-problem-with-List-from-getAll%28%29-integrating-mule-2.2.2-and-appfuse-2.02-tp25778321s2369p25791241.html
>>>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/databinding-problem-with-List-from-getAll%28%29-integrating-mule-2.2.2-and-appfuse-2.02-tp25778321s2369p25865663.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]