Generally, you would add a <wsdlLocation> element to the wsdlOption which 
would specify the location of the wsdl for runtime use.   Something like:

<wsdlLocation>/WEB-INF/wsdl/mywsdl.wsdl</wsdlLocation>


Dan




On Tue November 17 2009 10:00:20 am Hale,Katherine wrote:
> Hello CXF listserv!
> 
> I'm using version 2.2.4 of the CXF-Codegen-Plugin for Maven. I
> understand the error I'm getting, but I'm wondering if there's something
> I can do to avoid it. When we create our build, we use Maven to generate
> the CXF files. But in all environments except for local environments, we
> will actually deploy on a different machine than we build on. So when
> Mule/Spring start up my container and attempt initialize my CXF classes,
> I get a FileNotFoundException. Can I avoid this error and still use the
> WSDLArtifact WSDLOption? Our team has been getting around this problem
> by using a WSDL url instead, but this presents other problems that are a
> big pain. I figured I'd at least ask before assuming the URL was the
> only way.
> 
> Here's the Maven configuration that's causing the FileNotFoundException:
> 
>       <plugin>
>         <groupId>org.apache.cxf</groupId>
>         <artifactId>cxf-codegen-plugin</artifactId>
>         <version>2.2.4</version>
>         <executions>
>           <execution>
>             <id>generate-sources</id>
>             <phase>generate-sources</phase>
>             <configuration>
>               <sourceRoot>target/generated-sources/wsdl/</sourceRoot>
>               <wsdlOptions>
>                 <wsdlOption>
>                   <wsdlArtifact>
>                     <groupId>org.mycompany.MyService</groupId>
>                     <artifactId>MyService-interface</artifactId>
>                     <version>${MyServiceVersion}</version>
>                   </wsdlArtifact>
>                 </wsdlOption>
>               </wsdlOptions>
>             </configuration>
>             <goals>
>               <goal>wsdl2java</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
> 
> Just for reference, here's the stack trace of the exception that is
> produced.
> 
>       ERROR [WrapperListener_start_runner][2009-11-17 03:32:00,111]
> org.mule.config.spring.SpringXmlConfigurationBuilder
>               Configuration with
> "org.mule.config.spring.SpringXmlConfigurationBuilder" failed.
>       org.mule.api.lifecycle.InitialisationException: Initialisation
> Failure: Error creating bean with name 'blConn' defined in URL
> [file:/deployserver/ReportService/sandboxes/daily/deploy/mule/conf/mule-
> config.xml]: Invocation of init method failed; nested exception is
> javax.xml.ws.WebServiceException:
> org.apache.cxf.service.factory.ServiceConstructionException: Failed to
> create service.
>               at
> org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:76)
>               at
> org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistr
> y(SpringXmlConfigurationBuilder.java:98)
>               at
> org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringX
> mlConfigurationBuilder.java:69)
>               at
> org.mule.config.builders.AbstractConfigurationBuilder.configure(Abstract
> ConfigurationBuilder.java:39)
>               at
> org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(
> AbstractResourceConfigurationBuilder.java:78)
>               at
> org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMule
> ContextFactory.java:177)
>               at org.mule.MuleServer.initialize(MuleServer.java:351)
>               at org.mule.MuleServer.run(MuleServer.java:257)
>               at org.mule.MuleServer.start(MuleServer.java:244)
>               at
> org.mule.module.boot.MuleServerWrapper.start(MuleServerWrapper.java:48)
>               at
> org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:278
> 8)
>       Caused by:
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'blConn' defined in URL
> [file:/deployserver/ReportService/sandboxes/daily/deploy/mule/conf/mule-
> config.xml]: Invocation of init method failed; nested exception is
> javax.xml.ws.WebServiceException:
> org.apache.cxf.service.factory.ServiceConstructionException: Failed to
> create service.
>               at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
>               at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
>               at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory$1.run(AbstractAutowireCapableBeanFactory.java:409)
>               at java.security.AccessController.doPrivileged(Native
> Method)
>               at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.createBean(AbstractAutowireCapableBeanFactory.java:380)
>               at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObjec
> t(AbstractBeanFactory.java:264)
>               at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
> etSingleton(DefaultSingletonBeanRegistry.java:221)
>               at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(
> AbstractBeanFactory.java:261)
>               at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
> stractBeanFactory.java:185)
>               at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
> stractBeanFactory.java:164)
>               at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.pre
> InstantiateSingletons(DefaultListableBeanFactory.java:429)
>               at
> org.springframework.context.support.AbstractApplicationContext.finishBea
> nFactoryInitialization(AbstractApplicationContext.java:729)
>               at
> org.springframework.context.support.AbstractApplicationContext.refresh(A
> bstractApplicationContext.java:381)
>               at
> org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:8
> 7)
>               at
> org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:68)
>               ... 10 more
>       Caused by: javax.xml.ws.WebServiceException:
> org.apache.cxf.service.factory.ServiceConstructionException: Failed to
> create service.
>               at
> org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:149)
>               at
> org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl
> .java:65)
>               at javax.xml.ws.Service.<init>(Service.java:56)
>               at
> org.mycompany.myservice.MyService.<init>(MyService.java:48)
>               at
> org.mycompany.report.reportHelpers.MyConnection.connectToService(MyConne
> ction.java:64)
>               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>               at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> a:39)
>               at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:25)
>               at java.lang.reflect.Method.invoke(Method.java:597)
>               at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:14\
>       13)
>               at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1374)
>               at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
> tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
>               ... 24 more
>       Caused by:
> org.apache.cxf.service.factory.ServiceConstructionException: Failed to
> create service.
>               at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
> 93)
>               at
> org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:204)
>               at
> org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
>               ... 35 more
>       Caused by: javax.wsdl.WSDLException: WSDLException:
> faultCode=PARSER_ERROR: Problem parsing
> 'file:/buildserver/m2/repository/org/mycompany/MyService/MyService-inter
> face/1.01-SNAPSHOT/MyService-interface-1.01-SNAPSHOT.wsdl'.:
> java.io.FileNotFoundException:
> /buildserver/m2/repository/org/mycompany/MyService/MyService-interface/1
> .01-SNAPSHOT/MyService-interface-1.01-SNAPSHOT.wsdl (No such file or
> directory)
>               at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown
> Source)
>               at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown
> Source)
>               at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown
> Source)
>               at
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.jav
> a:210)
>               at
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java
> 
> :175)
> 
>               at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
> 91)
>               ... 37 more
>       Caused by: java.io.FileNotFoundException:
> /buildserver/m2/repository/org/mycompany/MyService/MyService-interface/1
> .01-SNAPSHOT/MyService-interface-1.01-SNAPSHOT.wsdl (No such file or
> directory)
>               at java.io.FileInputStream.open(Native Method)
>               at
> java.io.FileInputStream.<init>(FileInputStream.java:106)
>               at
> java.io.FileInputStream.<init>(FileInputStream.java:66)
>               at
> sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.ja
> va:70)
>               at
> sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnec
> tion.java:161)
>               at
> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
> Source)
>               at
> org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown
> Source)
>               at
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>               at
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>               at org.apache.xerces.parsers.XMLParser.parse(Unknown
> Source)
>               at org.apache.xerces.parsers.DOMParser.parse(Unknown
> Source)
>               at
> org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
>               ... 43 more
>       ERROR [WrapperListener_start_runner][2009-11-17 03:32:00,174]
> org.mule.MuleServer
> 
> Katherine Hale, SCJP
> Consultant | Columbus
> 
> Sogeti USA
> 8425 Pulsar Pl Ste 300 | Columbus, OH 43240
> www.us.sogeti.com <http://www.us.sogeti.com/>
> 

-- 
Daniel Kulp
[email protected]
http://www.dankulp.com/blog

Reply via email to