Quantcast

[groovyWS] consuming a service

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[groovyWS] consuming a service

Toutanc
Hi!


I'm getting this error:
Exception Message: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory

I try to consume a soap service with groovyWS. I don't know where it comes from... The service is exposed with axis2 (in the same application).

---------------------------------------------------
Error 500: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in URL [jar:file:/home/jeremy/NetBeansProjects/backend/lib/groovyws-standalone-0.5.0.jar!/META-INF/cxf/cxf.fixml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory
Servlet: grails
URI: /projetIBD/grails/livre/show.dispatch
Exception Message: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in URL [jar:file:/home/jeremy/NetBeansProjects/backend/lib/groovyws-standalone-0.5.0.jar!/META-INF/cxf/cxf.fixml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory
Class: LivreController
At Line: [19]
Code Snippet:
18: def proxy = getProxy()
19: proxy.initialize()
20: println "proxy configuré"

---------------------------------------------------


Here's the exposed code:
---------------------------------------------------
    def Livre[] recherche (String  titre, String auteur) {
        def listeDeLivre = Livre.findAllByTitreLikeAndAuteurLike("%"+titre+"%", "%"+auteur+"%")
        return listeDeLivre

    }

---------------------------------------------------

and the action calling for it:
---------------------------------------------------

        def getProxy() {
                new WSClient("http://localhost:8080/projetIBD/services/livre?wsdl", this.class.classLoader)
        }
       
    def show = {
    println "Entrée dans Show Web Service"
    def proxy = getProxy()
        proxy.initialize()
        println "proxy configuré"
        def livreInstance = proxy.getLivre(params.id)

        println "Livre obtenu"
        if(!livreInstance) {
            flash.message = "Livre not found with id ${params.id}"
            redirect(action:list)
        }
        else { return [ livreInstance : livreInstance ] }
    }

---------------------------------------------------

Do you have any clue as to its origin ?
tog
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [groovyWS] consuming a service

tog
Hi

Can you consume this service for outside your application or do you get the same error ?

Cheers
Guillaume

On Fri, May 8, 2009 at 9:32 AM, Toutanc <[hidden email]> wrote:

Hi!


I'm getting this error:
Exception Message: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot
be cast to javax.xml.parsers.DocumentBuilderFactory

I try to consume a soap service with groovyWS. I don't know where it comes
from... The service is exposed with axis2 (in the same application).

---------------------------------------------------
Error 500: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in URL
[jar:file:/home/jeremy/NetBeansProjects/backend/lib/groovyws-standalone-0.5.0.jar!/META-INF/cxf/cxf.fixml]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw
exception; nested exception is java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to
javax.xml.parsers.DocumentBuilderFactory
Servlet: grails
URI: /projetIBD/grails/livre/show.dispatch
Exception Message: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot
be cast to javax.xml.parsers.DocumentBuilderFactory
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in URL
[jar:file:/home/jeremy/NetBeansProjects/backend/lib/groovyws-standalone-0.5.0.jar!/META-INF/cxf/cxf.fixml]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw
exception; nested exception is java.lang.ClassCastException:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to
javax.xml.parsers.DocumentBuilderFactory
Class: LivreController
At Line: [19]
Code Snippet:
18: def proxy = getProxy()
19: proxy.initialize()
20: println "proxy configuré"
---------------------------------------------------


Here's the exposed code:
---------------------------------------------------
   def Livre[] recherche (String  titre, String auteur) {
       def listeDeLivre =
Livre.findAllByTitreLikeAndAuteurLike("%"+titre+"%", "%"+auteur+"%")
       return listeDeLivre

   }
---------------------------------------------------

and the action calling for it:
---------------------------------------------------

       def getProxy() {
               new WSClient("http://localhost:8080/projetIBD/services/livre?wsdl",
this.class.classLoader)
       }

   def show = {
   println "Entrée dans Show Web Service"
       def proxy = getProxy()
       proxy.initialize()
       println "proxy configuré"
       def livreInstance = proxy.getLivre(params.id)

       println "Livre obtenu"
       if(!livreInstance) {
           flash.message = "Livre not found with id ${params.id}"
           redirect(action:list)
       }
       else { return [ livreInstance : livreInstance ] }
   }
---------------------------------------------------

Do you have any clue as to its origin ?
--
View this message in context: http://www.nabble.com/-groovyWS--consuming-a-service-tp23438619p23438619.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--

PGP KeyID: 1024D/47172155
FingerPrint: C739 8B3C 5ABF 127F CCFA  5835 F673 370B 4717 2155

http://cheztog.blogspot.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [groovyWS] consuming a service

Toutanc
Hi!

Thx for your reply!

I tested several things:

1/ soapUI
Everything is  working fine there. I can call my services without any problem

2/I copied the application and asked the second one to get the services from the first one. I get the same Exception as before (in the second "client-side" application)

3/I tried writing a small application using one domain class from my app and calling the web service. It seems to work ok but the data binding is not working:
---------------------------------------------------

Show Livre
Id: javax.xml.bind.JAXBElement@4611dca9
Titre: javax.xml.bind.JAXBElement@3eadff2f
Auteur: javax.xml.bind.JAXBElement@114c86cf
Ebook: javax.xml.bind.JAXBElement@372688e8

---------------------------------------------------


I used the same domain class with the call def livreInstance = proxy.getLivre(params.id)
I also tried to bind the data with a variable:
---------------------------------------------------
        def livreInte = proxy.getLivre(params.id)
        def livreInstance = new Livre()
        livreInstance.properties=livreInte
        livreInstance.save()

---------------------------------------------------
but all the fields were blank...

Any clues?
tog wrote
Hi

Can you consume this service for outside your application or do you get the
same error ?

Cheers
Guillaume

On Fri, May 8, 2009 at 9:32 AM, Toutanc <toutancartonfr@yahoo.fr> wrote:

[...]
--

PGP KeyID: 1024D/47172155
FingerPrint: C739 8B3C 5ABF 127F CCFA  5835 F673 370B 4717 2155

http://cheztog.blogspot.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [groovyWS] consuming a service

rhodebump-2
Couple of points.

I would NOT use domain classes as your message containers.  Yes, it's  
more work to create DTO's, but you will thank yourself one day.  Trust  
me.

How did you do your mappings?  I am consuming a grails-based web  
service that has aegis mappings with groovyws and aegis is working  
fine.  Anytime I see that "javax.xml.bind.JAXBElement@3eadff2f" stuff  
means I forget to map a property to a string.  Feel free to review the  
mappings here:  http://svn.codehaus.org/grails-plugins/grails-stitches/trunk/src/java/org/authsum/stitches/external/


HTH




On May 8, 2009, at 12:59 PM, Toutanc wrote:

>
> Hi!
>
> Thx for your reply!
>
> I tested several things:
>
> 1/ soapUI
> Everything is  working fine there. I can call my services without any
> problem
>
> 2/I copied the application and asked the second one to get the  
> services from
> the first one. I get the same Exception as before (in the second
> "client-side" application)
>
> 3/I tried writing a small application using one domain class from my  
> app and
> calling the web service. It seems to work ok but the data binding is  
> not
> working:
> ---------------------------------------------------
>
> Show Livre
> Id: javax.xml.bind.JAXBElement@4611dca9
> Titre: javax.xml.bind.JAXBElement@3eadff2f
> Auteur: javax.xml.bind.JAXBElement@114c86cf
> Ebook: javax.xml.bind.JAXBElement@372688e8
> ---------------------------------------------------
>
>
> I used the same domain class with the call def livreInstance =
> proxy.getLivre(params.id)
> I also tried to bind the data with a variable:
> ---------------------------------------------------
>        def livreInte = proxy.getLivre(params.id)
>        def livreInstance = new Livre()
>        livreInstance.properties=livreInte
>        livreInstance.save()
> ---------------------------------------------------
> but all the fields were blank...
>
> Any clues?
>
> tog wrote:
>>
>> Hi
>>
>> Can you consume this service for outside your application or do you  
>> get
>> the
>> same error ?
>>
>> Cheers
>> Guillaume
>>
>> On Fri, May 8, 2009 at 9:32 AM, Toutanc <[hidden email]>  
>> wrote:
>>
>> [...]
>> --
>>
>> PGP KeyID: 1024D/47172155
>> FingerPrint: C739 8B3C 5ABF 127F CCFA  5835 F673 370B 4717 2155
>>
>> http://cheztog.blogspot.com
>>
>>
>
> --
> View this message in context: http://www.nabble.com/-groovyWS--consuming-a-service-tp23438619p23449693.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [groovyWS] consuming a service

Toutanc
I followed that guide here: http://docs.codehaus.org/display/GROOVY/Using+the+Grails+XFire+plugin+and+GroovyWS

There did not seem to be any mapping to do...
I put the result in the same class as the server (I copied the file fom the server app). I thought fields were mapped automatically.

I can't find anything about mapping on the groovyWS page (apart from aegis).
Thw for the tip about DTOs :)

Toutanc


rhodebump wrote
Couple of points.

I would NOT use domain classes as your message containers.  Yes, it's  
more work to create DTO's, but you will thank yourself one day.  Trust  
me.

How did you do your mappings?  I am consuming a grails-based web  
service that has aegis mappings with groovyws and aegis is working  
fine.  Anytime I see that "javax.xml.bind.JAXBElement@3eadff2f" stuff  
means I forget to map a property to a string.  Feel free to review the  
mappings here:  http://svn.codehaus.org/grails-plugins/grails-stitches/trunk/src/java/org/authsum/stitches/external/


HTH




On May 8, 2009, at 12:59 PM, Toutanc wrote:

>
> Hi!
>
> Thx for your reply!
>
> I tested several things:
>
> 1/ soapUI
> Everything is  working fine there. I can call my services without any
> problem
>
> 2/I copied the application and asked the second one to get the  
> services from
> the first one. I get the same Exception as before (in the second
> "client-side" application)
>
> 3/I tried writing a small application using one domain class from my  
> app and
> calling the web service. It seems to work ok but the data binding is  
> not
> working:
> ---------------------------------------------------
>
> Show Livre
> Id: javax.xml.bind.JAXBElement@4611dca9
> Titre: javax.xml.bind.JAXBElement@3eadff2f
> Auteur: javax.xml.bind.JAXBElement@114c86cf
> Ebook: javax.xml.bind.JAXBElement@372688e8
> ---------------------------------------------------
>
>
> I used the same domain class with the call def livreInstance =
> proxy.getLivre(params.id)
> I also tried to bind the data with a variable:
> ---------------------------------------------------
>        def livreInte = proxy.getLivre(params.id)
>        def livreInstance = new Livre()
>        livreInstance.properties=livreInte
>        livreInstance.save()
> ---------------------------------------------------
> but all the fields were blank...
>
> Any clues?
>
> tog wrote:
>>
>> Hi
>>
>> Can you consume this service for outside your application or do you  
>> get
>> the
>> same error ?
>>
>> Cheers
>> Guillaume
>>
>> On Fri, May 8, 2009 at 9:32 AM, Toutanc <toutancartonfr@yahoo.fr> 
>> wrote:
>>
>> [...]
>> --
>>
>> PGP KeyID: 1024D/47172155
>> FingerPrint: C739 8B3C 5ABF 127F CCFA  5835 F673 370B 4717 2155
>>
>> http://cheztog.blogspot.com
>>
>>
>
> --
> View this message in context: http://www.nabble.com/-groovyWS--consuming-a-service-tp23438619p23449693.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

tog
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [groovyWS] consuming a service

tog
Bonjour

In that case:
> 3/I tried writing a small application using one domain class from my app and
> calling the web service. It seems to work ok but the data binding is not
> working:
> ---------------------------------------------------
>
>Show Livre
>Id:     javax.xml.bind.JAXBElement@4611dca9
>Titre:  javax.xml.bind.JAXBElement@3eadff2f
>Auteur:         javax.xml.bind.JAXBElement@114c86cf
>Ebook:  javax.xml.bind.JAXBElement@372688e8
>---------------------------------------------------

try Id.value, Ebook.value, ...

It should work.

Cheers
Guillaume

On Sat, May 9, 2009 at 9:02 PM, Toutanc <[hidden email]> wrote:

I followed that guide here:
http://docs.codehaus.org/display/GROOVY/Using+the+Grails+XFire+plugin+and+GroovyWS

There did not seem to be any mapping to do...
I put the result in the same class as the server (I copied the file fom the
server app). I thought fields were mapped automatically.

I can't find anything about mapping on the groovyWS page (apart from aegis).
Thw for the tip about DTOs :)

Toutanc



rhodebump wrote:
>
> Couple of points.
>
> I would NOT use domain classes as your message containers.  Yes, it's
> more work to create DTO's, but you will thank yourself one day.  Trust
> me.
>
> How did you do your mappings?  I am consuming a grails-based web
> service that has aegis mappings with groovyws and aegis is working
> fine.  Anytime I see that "javax.xml.bind.JAXBElement@3eadff2f" stuff
> means I forget to map a property to a string.  Feel free to review the
> mappings here:
> http://svn.codehaus.org/grails-plugins/grails-stitches/trunk/src/java/org/authsum/stitches/external/
>
>
> HTH
>
>
>
>
> On May 8, 2009, at 12:59 PM, Toutanc wrote:
>
>>
>> Hi!
>>
>> Thx for your reply!
>>
>> I tested several things:
>>
>> 1/ soapUI
>> Everything is  working fine there. I can call my services without any
>> problem
>>
>> 2/I copied the application and asked the second one to get the
>> services from
>> the first one. I get the same Exception as before (in the second
>> "client-side" application)
>>
>> 3/I tried writing a small application using one domain class from my
>> app and
>> calling the web service. It seems to work ok but the data binding is
>> not
>> working:
>> ---------------------------------------------------
>>
>> Show Livre
>> Id:  javax.xml.bind.JAXBElement@4611dca9
>> Titre:       javax.xml.bind.JAXBElement@3eadff2f
>> Auteur:      javax.xml.bind.JAXBElement@114c86cf
>> Ebook:       javax.xml.bind.JAXBElement@372688e8
>> ---------------------------------------------------
>>
>>
>> I used the same domain class with the call def livreInstance =
>> proxy.getLivre(params.id)
>> I also tried to bind the data with a variable:
>> ---------------------------------------------------
>>        def livreInte = proxy.getLivre(params.id)
>>        def livreInstance = new Livre()
>>        livreInstance.properties=livreInte
>>        livreInstance.save()
>> ---------------------------------------------------
>> but all the fields were blank...
>>
>> Any clues?
>>
>> tog wrote:
>>>
>>> Hi
>>>
>>> Can you consume this service for outside your application or do you
>>> get
>>> the
>>> same error ?
>>>
>>> Cheers
>>> Guillaume
>>>
>>> On Fri, May 8, 2009 at 9:32 AM, Toutanc <[hidden email]>
>>> wrote:
>>>
>>> [...]
>>> --
>>>
>>> PGP KeyID: 1024D/47172155
>>> FingerPrint: C739 8B3C 5ABF 127F CCFA  5835 F673 370B 4717 2155
>>>
>>> http://cheztog.blogspot.com
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-groovyWS--consuming-a-service-tp23438619p23449693.html
>> Sent from the grails - user mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context: http://www.nabble.com/-groovyWS--consuming-a-service-tp23438619p23460323.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--

PGP KeyID: 1024D/47172155
FingerPrint: C739 8B3C 5ABF 127F CCFA  5835 F673 370B 4717 2155

http://cheztog.blogspot.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [groovyWS] consuming a service

Rocks
In reply to this post by Toutanc
Hi,

Did you manage to work out this issue? I have the same problem - I can consume a web service via groovyws ok, and I can expose a web service using xfire plugin.  But when I use both in the same application I get the same error you do:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in URL [jar:file:/home/myProject/lib/groovyws-standalone-0.5.0.jar!/META-INF/cxf/cxf.fixml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory


Toutanc wrote
Hi!


I'm getting this error:
Exception Message: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory

I try to consume a soap service with groovyWS. I don't know where it comes from... The service is exposed with axis2 (in the same application).

---------------------------------------------------
Error 500: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in URL [jar:file:/home/jeremy/NetBeansProjects/backend/lib/groovyws-standalone-0.5.0.jar!/META-INF/cxf/cxf.fixml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory
Servlet: grails
URI: /projetIBD/grails/livre/show.dispatch
Exception Message: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in URL [jar:file:/home/jeremy/NetBeansProjects/backend/lib/groovyws-standalone-0.5.0.jar!/META-INF/cxf/cxf.fixml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory
Class: LivreController
At Line: [19]
Code Snippet:
18: def proxy = getProxy()
19: proxy.initialize()
20: println "proxy configuré"

---------------------------------------------------


Here's the exposed code:
---------------------------------------------------
    def Livre[] recherche (String  titre, String auteur) {
        def listeDeLivre = Livre.findAllByTitreLikeAndAuteurLike("%"+titre+"%", "%"+auteur+"%")
        return listeDeLivre

    }

---------------------------------------------------

and the action calling for it:
---------------------------------------------------

        def getProxy() {
                new WSClient("http://localhost:8080/projetIBD/services/livre?wsdl", this.class.classLoader)
        }
       
    def show = {
    println "Entrée dans Show Web Service"
    def proxy = getProxy()
        proxy.initialize()
        println "proxy configuré"
        def livreInstance = proxy.getLivre(params.id)

        println "Livre obtenu"
        if(!livreInstance) {
            flash.message = "Livre not found with id ${params.id}"
            redirect(action:list)
        }
        else { return [ livreInstance : livreInstance ] }
    }

---------------------------------------------------

Do you have any clue as to its origin ?
Loading...