You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Jason Botwick <jw...@gmail.com> on 2007/10/26 19:51:34 UTC

groovy/grails, CXF and generated classes

I'm trying to get a simple service client running against the following WSDL:


I used SoapUI 1.7.6 to generate the service classes, one of which is this:

@WebServiceClient(name = "api", targetNamespace =
"http://api.bronto.com", wsdlLocation =
"http://api.bronto.com/?q=mail_3&wsdl")
public class Api extends Service {

    private final static URL WSDL_LOCATION;
    private final static QName SERVICE = new
QName("http://api.bronto.com", "api");
    private final static QName ApiPort = new
QName("http://api.bronto.com", "apiPort");
    static {
        URL url = null;
        try {
            url = new URL("http://api.bronto.com/?q=mail_3&wsdl");
        } catch (MalformedURLException e) {
            System.err.println("Can not initialize the default wsdl
from http://api.bronto.com/?q=mail_3&wsdl");
            // e.printStackTrace();
        }
        WSDL_LOCATION = url;
    }

    public Api(URL wsdlLocation, QName serviceName) {
        super(wsdlLocation, serviceName);
    }

    public Api() {
        super(WSDL_LOCATION, SERVICE);
    }

    /**
     *
     * @return
     *     returns ApiPort
     */
    @WebEndpoint(name = "apiPort")
    public ApiPortType getApiPort() {
        return (ApiPortType)super.getPort(ApiPort, ApiPortType.class);
    }

}

But when I execute the following code in a brand new Grails app
(Grails 0.6, Groovy 1.1b):

I get the error below. Not even where to start looking to solve this
one (except Google, which I already tried). Any suggestions?

org.codehaus.groovy.runtime.InvokerInvocationException:
java.lang.RuntimeException:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in
class path resource [META-INF/cxf/cxf.xml]: 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
	at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:64)
	at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689)
	at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531)
	at groovy.lang.Closure.call(Closure.java:290)
	at groovy.lang.Closure.call(Closure.java:285)
	at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:526)
	at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:385)
	at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:240)
	at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:152)
	at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:88)
	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
	at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:241)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

Re: groovy/grails, CXF and generated classes

Posted by Willem Jiang <ni...@iona.com>.
Hi,

It may relate to your environments. Xerces should be the first one in 
the class path.
Can you list them, such as CXF version, JDK version ,Groovy's version ?
A simple test case will be helpful for debugging.

Willem.

Jason Botwick wrote:
> The Xerces 2.8.1 JAR is in the classpath. Do I also need some other 
> version of JAXP?
>
> I have seldom met an intelligent person whose views were not narrowed 
> and distorted by religion.
> ~ James Buchanan
>
>
> On Nov 1, 2007, at 3:31 AM, Willem Jiang wrote:
>
>> Hi,
>>
>> The exception is thrown from org.apache.cxf.wsdl11.WSDLManagerImpl 
>> which uses a DocumentBuilderFactory to load the WSDL.
>> You class path may do no include a right version of jaxp and you need 
>> to put the XecesImpl 2.8.1.jar in you class path.
>>
>> Willem.
>>
>> Jason Botwick wrote:
>>> It is . . . sorry, forgot to mention that.
>>>
>>> Any other suggestions?
>>>
>>> On Oct 27, 2007, at 11:37 PM, Willem2 wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>> It may relate to the Xerces Implementation.
>>>> CXF can work with xecesImpl 2.8.1 , please make sure this jar is in 
>>>> your
>>>> class path.
>>>>
>>>> Willem.
>>>>
>>>>
>>>> jwagon wrote:
>>>>>
>>>>> I'm trying to get a simple service client running against the 
>>>>> following
>>>>> WSDL:
>>>>>
>>>>>
>>>>> I used SoapUI 1.7.6 to generate the service classes, one of which 
>>>>> is this:
>>>>>
>>>>> @WebServiceClient(name = "api", targetNamespace =
>>>>> "http://api.bronto.com", wsdlLocation =
>>>>> "http://api.bronto.com/?q=mail_3&wsdl")
>>>>> public class Api extends Service {
>>>>>
>>>>>     private final static URL WSDL_LOCATION;
>>>>>     private final static QName SERVICE = new
>>>>> QName("http://api.bronto.com", "api");
>>>>>     private final static QName ApiPort = new
>>>>> QName("http://api.bronto.com", "apiPort");
>>>>>     static {
>>>>>         URL url = null;
>>>>>         try {
>>>>>             url = new URL("http://api.bronto.com/?q=mail_3&wsdl");
>>>>>         } catch (MalformedURLException e) {
>>>>>             System.err.println("Can not initialize the default wsdl
>>>>> from http://api.bronto.com/?q=mail_3&wsdl");
>>>>>             // e.printStackTrace();
>>>>>         }
>>>>>         WSDL_LOCATION = url;
>>>>>     }
>>>>>
>>>>>     public Api(URL wsdlLocation, QName serviceName) {
>>>>>         super(wsdlLocation, serviceName);
>>>>>     }
>>>>>
>>>>>     public Api() {
>>>>>         super(WSDL_LOCATION, SERVICE);
>>>>>     }
>>>>>
>>>>>     /**
>>>>>      *
>>>>>      * @return
>>>>>      *     returns ApiPort
>>>>>      */
>>>>>     @WebEndpoint(name = "apiPort")
>>>>>     public ApiPortType getApiPort() {
>>>>>         return (ApiPortType)super.getPort(ApiPort, 
>>>>> ApiPortType.class);
>>>>>     }
>>>>>
>>>>> }
>>>>>
>>>>> But when I execute the following code in a brand new Grails app
>>>>> (Grails 0.6, Groovy 1.1b):
>>>>>
>>>>> I get the error below. Not even where to start looking to solve this
>>>>> one (except Google, which I already tried). Any suggestions?
>>>>>
>>>>> org.codehaus.groovy.runtime.InvokerInvocationException:
>>>>> java.lang.RuntimeException:
>>>>> org.springframework.beans.factory.BeanCreationException: Error
>>>>> creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in
>>>>> class path resource [META-INF/cxf/cxf.xml]: 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
>>>>>     at
>>>>> org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:64) 
>>>>>
>>>>>     at
>>>>> org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) 
>>>>>
>>>>>     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689)
>>>>>     at 
>>>>> groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894)
>>>>>     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531)
>>>>>     at groovy.lang.Closure.call(Closure.java:290)
>>>>>     at groovy.lang.Closure.call(Closure.java:285)
>>>>>     at
>>>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:526) 
>>>>>
>>>>>     at
>>>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:385) 
>>>>>
>>>>>     at
>>>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:240) 
>>>>>
>>>>>     at
>>>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:152) 
>>>>>
>>>>>     at
>>>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:88) 
>>>>>
>>>>>     at
>>>>> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45) 
>>>>>
>>>>>     at
>>>>> org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:241) 
>>>>>
>>>>>     at
>>>>> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755) 
>>>>>
>>>>>     at
>>>>> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396) 
>>>>>
>>>>>     at
>>>>> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350) 
>>>>>
>>>>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>>>>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>>>
>>>>>
>>>>
>>>> -- 
>>>> View this message in context: 
>>>> http://www.nabble.com/groovy-grails%2C-CXF-and-generated-classes-tf4700854.html#a13449798 
>>>>
>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>>
>>>
>>>
>
>

Re: groovy/grails, CXF and generated classes

Posted by Jason Botwick <jw...@gmail.com>.
The Xerces 2.8.1 JAR is in the classpath. Do I also need some other  
version of JAXP?

I have seldom met an intelligent person whose views were not narrowed  
and distorted by religion.
~ James Buchanan


On Nov 1, 2007, at 3:31 AM, Willem Jiang wrote:

> Hi,
>
> The exception is thrown from org.apache.cxf.wsdl11.WSDLManagerImpl  
> which uses a DocumentBuilderFactory to load the WSDL.
> You class path may do no include a right version of jaxp and you  
> need to put the XecesImpl 2.8.1.jar in you class path.
>
> Willem.
>
> Jason Botwick wrote:
>> It is . . . sorry, forgot to mention that.
>>
>> Any other suggestions?
>>
>> On Oct 27, 2007, at 11:37 PM, Willem2 wrote:
>>
>>>
>>> Hi,
>>>
>>> It may relate to the Xerces Implementation.
>>> CXF can work with xecesImpl 2.8.1 , please make sure this jar is  
>>> in your
>>> class path.
>>>
>>> Willem.
>>>
>>>
>>> jwagon wrote:
>>>>
>>>> I'm trying to get a simple service client running against the  
>>>> following
>>>> WSDL:
>>>>
>>>>
>>>> I used SoapUI 1.7.6 to generate the service classes, one of  
>>>> which is this:
>>>>
>>>> @WebServiceClient(name = "api", targetNamespace =
>>>> "http://api.bronto.com", wsdlLocation =
>>>> "http://api.bronto.com/?q=mail_3&wsdl")
>>>> public class Api extends Service {
>>>>
>>>>     private final static URL WSDL_LOCATION;
>>>>     private final static QName SERVICE = new
>>>> QName("http://api.bronto.com", "api");
>>>>     private final static QName ApiPort = new
>>>> QName("http://api.bronto.com", "apiPort");
>>>>     static {
>>>>         URL url = null;
>>>>         try {
>>>>             url = new URL("http://api.bronto.com/?q=mail_3&wsdl");
>>>>         } catch (MalformedURLException e) {
>>>>             System.err.println("Can not initialize the default wsdl
>>>> from http://api.bronto.com/?q=mail_3&wsdl");
>>>>             // e.printStackTrace();
>>>>         }
>>>>         WSDL_LOCATION = url;
>>>>     }
>>>>
>>>>     public Api(URL wsdlLocation, QName serviceName) {
>>>>         super(wsdlLocation, serviceName);
>>>>     }
>>>>
>>>>     public Api() {
>>>>         super(WSDL_LOCATION, SERVICE);
>>>>     }
>>>>
>>>>     /**
>>>>      *
>>>>      * @return
>>>>      *     returns ApiPort
>>>>      */
>>>>     @WebEndpoint(name = "apiPort")
>>>>     public ApiPortType getApiPort() {
>>>>         return (ApiPortType)super.getPort(ApiPort,  
>>>> ApiPortType.class);
>>>>     }
>>>>
>>>> }
>>>>
>>>> But when I execute the following code in a brand new Grails app
>>>> (Grails 0.6, Groovy 1.1b):
>>>>
>>>> I get the error below. Not even where to start looking to solve  
>>>> this
>>>> one (except Google, which I already tried). Any suggestions?
>>>>
>>>> org.codehaus.groovy.runtime.InvokerInvocationException:
>>>> java.lang.RuntimeException:
>>>> org.springframework.beans.factory.BeanCreationException: Error
>>>> creating bean with name 'org.apache.cxf.wsdl.WSDLManager'  
>>>> defined in
>>>> class path resource [META-INF/cxf/cxf.xml]: 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
>>>>     at
>>>> org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke 
>>>> (ReflectionMetaMethod.java:64)
>>>>     at
>>>> org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke 
>>>> (MetaClassHelper.java:678)
>>>>     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java: 
>>>> 689)
>>>>     at groovy.lang.ExpandoMetaClass.invokeMethod 
>>>> (ExpandoMetaClass.java:894)
>>>>     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java: 
>>>> 531)
>>>>     at groovy.lang.Closure.call(Closure.java:290)
>>>>     at groovy.lang.Closure.call(Closure.java:285)
>>>>     at
>>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHe 
>>>> lper.handleAction(SimpleGrailsControllerHelper.java:526)
>>>>     at
>>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHe 
>>>> lper.executeAction(SimpleGrailsControllerHelper.java:385)
>>>>     at
>>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHe 
>>>> lper.handleURI(SimpleGrailsControllerHelper.java:240)
>>>>     at
>>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHe 
>>>> lper.handleURI(SimpleGrailsControllerHelper.java:152)
>>>>     at
>>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.h 
>>>> andleRequest(SimpleGrailsController.java:88)
>>>>     at
>>>> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter. 
>>>> handle(SimpleControllerHandlerAdapter.java:45)
>>>>     at
>>>> org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDi 
>>>> spatch(GrailsDispatcherServlet.java:241)
>>>>     at
>>>> org.springframework.web.servlet.DispatcherServlet.doService 
>>>> (DispatcherServlet.java:755)
>>>>     at
>>>> org.springframework.web.servlet.FrameworkServlet.processRequest 
>>>> (FrameworkServlet.java:396)
>>>>     at
>>>> org.springframework.web.servlet.FrameworkServlet.doGet 
>>>> (FrameworkServlet.java:350)
>>>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>>>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>>
>>>>
>>>
>>> -- 
>>> View this message in context: http://www.nabble.com/groovy-grails% 
>>> 2C-CXF-and-generated-classes-tf4700854.html#a13449798
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>
>>


Re: groovy/grails, CXF and generated classes

Posted by Willem Jiang <ni...@iona.com>.
Hi,

The exception is thrown from org.apache.cxf.wsdl11.WSDLManagerImpl which 
uses a DocumentBuilderFactory to load the WSDL.
You class path may do no include a right version of jaxp and you need to 
put the XecesImpl 2.8.1.jar in you class path.

Willem.

Jason Botwick wrote:
> It is . . . sorry, forgot to mention that.
>
> Any other suggestions?
>
> On Oct 27, 2007, at 11:37 PM, Willem2 wrote:
>
>>
>> Hi,
>>
>> It may relate to the Xerces Implementation.
>> CXF can work with xecesImpl 2.8.1 , please make sure this jar is in your
>> class path.
>>
>> Willem.
>>
>>
>> jwagon wrote:
>>>
>>> I'm trying to get a simple service client running against the following
>>> WSDL:
>>>
>>>
>>> I used SoapUI 1.7.6 to generate the service classes, one of which is 
>>> this:
>>>
>>> @WebServiceClient(name = "api", targetNamespace =
>>> "http://api.bronto.com", wsdlLocation =
>>> "http://api.bronto.com/?q=mail_3&wsdl")
>>> public class Api extends Service {
>>>
>>>     private final static URL WSDL_LOCATION;
>>>     private final static QName SERVICE = new
>>> QName("http://api.bronto.com", "api");
>>>     private final static QName ApiPort = new
>>> QName("http://api.bronto.com", "apiPort");
>>>     static {
>>>         URL url = null;
>>>         try {
>>>             url = new URL("http://api.bronto.com/?q=mail_3&wsdl");
>>>         } catch (MalformedURLException e) {
>>>             System.err.println("Can not initialize the default wsdl
>>> from http://api.bronto.com/?q=mail_3&wsdl");
>>>             // e.printStackTrace();
>>>         }
>>>         WSDL_LOCATION = url;
>>>     }
>>>
>>>     public Api(URL wsdlLocation, QName serviceName) {
>>>         super(wsdlLocation, serviceName);
>>>     }
>>>
>>>     public Api() {
>>>         super(WSDL_LOCATION, SERVICE);
>>>     }
>>>
>>>     /**
>>>      *
>>>      * @return
>>>      *     returns ApiPort
>>>      */
>>>     @WebEndpoint(name = "apiPort")
>>>     public ApiPortType getApiPort() {
>>>         return (ApiPortType)super.getPort(ApiPort, ApiPortType.class);
>>>     }
>>>
>>> }
>>>
>>> But when I execute the following code in a brand new Grails app
>>> (Grails 0.6, Groovy 1.1b):
>>>
>>> I get the error below. Not even where to start looking to solve this
>>> one (except Google, which I already tried). Any suggestions?
>>>
>>> org.codehaus.groovy.runtime.InvokerInvocationException:
>>> java.lang.RuntimeException:
>>> org.springframework.beans.factory.BeanCreationException: Error
>>> creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in
>>> class path resource [META-INF/cxf/cxf.xml]: 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
>>>     at
>>> org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:64) 
>>>
>>>     at
>>> org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) 
>>>
>>>     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689)
>>>     at 
>>> groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894)
>>>     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531)
>>>     at groovy.lang.Closure.call(Closure.java:290)
>>>     at groovy.lang.Closure.call(Closure.java:285)
>>>     at
>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:526) 
>>>
>>>     at
>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:385) 
>>>
>>>     at
>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:240) 
>>>
>>>     at
>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:152) 
>>>
>>>     at
>>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:88) 
>>>
>>>     at
>>> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45) 
>>>
>>>     at
>>> org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:241) 
>>>
>>>     at
>>> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755) 
>>>
>>>     at
>>> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396) 
>>>
>>>     at
>>> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350) 
>>>
>>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>
>>>
>>
>> -- 
>> View this message in context: 
>> http://www.nabble.com/groovy-grails%2C-CXF-and-generated-classes-tf4700854.html#a13449798 
>>
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>
>

Re: groovy/grails, CXF and generated classes

Posted by Jason Botwick <jw...@gmail.com>.
It is . . . sorry, forgot to mention that.

Any other suggestions?

On Oct 27, 2007, at 11:37 PM, Willem2 wrote:

>
> Hi,
>
> It may relate to the Xerces Implementation.
> CXF can work with xecesImpl 2.8.1 , please make sure this jar is in  
> your
> class path.
>
> Willem.
>
>
> jwagon wrote:
>>
>> I'm trying to get a simple service client running against the  
>> following
>> WSDL:
>>
>>
>> I used SoapUI 1.7.6 to generate the service classes, one of which  
>> is this:
>>
>> @WebServiceClient(name = "api", targetNamespace =
>> "http://api.bronto.com", wsdlLocation =
>> "http://api.bronto.com/?q=mail_3&wsdl")
>> public class Api extends Service {
>>
>>     private final static URL WSDL_LOCATION;
>>     private final static QName SERVICE = new
>> QName("http://api.bronto.com", "api");
>>     private final static QName ApiPort = new
>> QName("http://api.bronto.com", "apiPort");
>>     static {
>>         URL url = null;
>>         try {
>>             url = new URL("http://api.bronto.com/?q=mail_3&wsdl");
>>         } catch (MalformedURLException e) {
>>             System.err.println("Can not initialize the default wsdl
>> from http://api.bronto.com/?q=mail_3&wsdl");
>>             // e.printStackTrace();
>>         }
>>         WSDL_LOCATION = url;
>>     }
>>
>>     public Api(URL wsdlLocation, QName serviceName) {
>>         super(wsdlLocation, serviceName);
>>     }
>>
>>     public Api() {
>>         super(WSDL_LOCATION, SERVICE);
>>     }
>>
>>     /**
>>      *
>>      * @return
>>      *     returns ApiPort
>>      */
>>     @WebEndpoint(name = "apiPort")
>>     public ApiPortType getApiPort() {
>>         return (ApiPortType)super.getPort(ApiPort,  
>> ApiPortType.class);
>>     }
>>
>> }
>>
>> But when I execute the following code in a brand new Grails app
>> (Grails 0.6, Groovy 1.1b):
>>
>> I get the error below. Not even where to start looking to solve this
>> one (except Google, which I already tried). Any suggestions?
>>
>> org.codehaus.groovy.runtime.InvokerInvocationException:
>> java.lang.RuntimeException:
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in
>> class path resource [META-INF/cxf/cxf.xml]: 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
>> 	at
>> org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke 
>> (ReflectionMetaMethod.java:64)
>> 	at
>> org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke 
>> (MetaClassHelper.java:678)
>> 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689)
>> 	at groovy.lang.ExpandoMetaClass.invokeMethod 
>> (ExpandoMetaClass.java:894)
>> 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531)
>> 	at groovy.lang.Closure.call(Closure.java:290)
>> 	at groovy.lang.Closure.call(Closure.java:285)
>> 	at
>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelp 
>> er.handleAction(SimpleGrailsControllerHelper.java:526)
>> 	at
>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelp 
>> er.executeAction(SimpleGrailsControllerHelper.java:385)
>> 	at
>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelp 
>> er.handleURI(SimpleGrailsControllerHelper.java:240)
>> 	at
>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelp 
>> er.handleURI(SimpleGrailsControllerHelper.java:152)
>> 	at
>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.han 
>> dleRequest(SimpleGrailsController.java:88)
>> 	at
>> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.ha 
>> ndle(SimpleControllerHandlerAdapter.java:45)
>> 	at
>> org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDisp 
>> atch(GrailsDispatcherServlet.java:241)
>> 	at
>> org.springframework.web.servlet.DispatcherServlet.doService 
>> (DispatcherServlet.java:755)
>> 	at
>> org.springframework.web.servlet.FrameworkServlet.processRequest 
>> (FrameworkServlet.java:396)
>> 	at
>> org.springframework.web.servlet.FrameworkServlet.doGet 
>> (FrameworkServlet.java:350)
>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/groovy-grails% 
> 2C-CXF-and-generated-classes-tf4700854.html#a13449798
> Sent from the cxf-user mailing list archive at Nabble.com.
>


Re: groovy/grails, CXF and generated classes

Posted by Willem2 <ni...@iona.com>.
Hi,

It may relate to the Xerces Implementation.
CXF can work with xecesImpl 2.8.1 , please make sure this jar is in your
class path.

Willem.


jwagon wrote:
> 
> I'm trying to get a simple service client running against the following
> WSDL:
> 
> 
> I used SoapUI 1.7.6 to generate the service classes, one of which is this:
> 
> @WebServiceClient(name = "api", targetNamespace =
> "http://api.bronto.com", wsdlLocation =
> "http://api.bronto.com/?q=mail_3&wsdl")
> public class Api extends Service {
> 
>     private final static URL WSDL_LOCATION;
>     private final static QName SERVICE = new
> QName("http://api.bronto.com", "api");
>     private final static QName ApiPort = new
> QName("http://api.bronto.com", "apiPort");
>     static {
>         URL url = null;
>         try {
>             url = new URL("http://api.bronto.com/?q=mail_3&wsdl");
>         } catch (MalformedURLException e) {
>             System.err.println("Can not initialize the default wsdl
> from http://api.bronto.com/?q=mail_3&wsdl");
>             // e.printStackTrace();
>         }
>         WSDL_LOCATION = url;
>     }
> 
>     public Api(URL wsdlLocation, QName serviceName) {
>         super(wsdlLocation, serviceName);
>     }
> 
>     public Api() {
>         super(WSDL_LOCATION, SERVICE);
>     }
> 
>     /**
>      *
>      * @return
>      *     returns ApiPort
>      */
>     @WebEndpoint(name = "apiPort")
>     public ApiPortType getApiPort() {
>         return (ApiPortType)super.getPort(ApiPort, ApiPortType.class);
>     }
> 
> }
> 
> But when I execute the following code in a brand new Grails app
> (Grails 0.6, Groovy 1.1b):
> 
> I get the error below. Not even where to start looking to solve this
> one (except Google, which I already tried). Any suggestions?
> 
> org.codehaus.groovy.runtime.InvokerInvocationException:
> java.lang.RuntimeException:
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in
> class path resource [META-INF/cxf/cxf.xml]: 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
> 	at
> org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:64)
> 	at
> org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678)
> 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689)
> 	at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894)
> 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531)
> 	at groovy.lang.Closure.call(Closure.java:290)
> 	at groovy.lang.Closure.call(Closure.java:285)
> 	at
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:526)
> 	at
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:385)
> 	at
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:240)
> 	at
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:152)
> 	at
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:88)
> 	at
> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
> 	at
> org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:241)
> 	at
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755)
> 	at
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
> 	at
> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> 
> 

-- 
View this message in context: http://www.nabble.com/groovy-grails%2C-CXF-and-generated-classes-tf4700854.html#a13449798
Sent from the cxf-user mailing list archive at Nabble.com.