Hi,

back from vacation I am still struggling with my litte problem on loading
the WSDL from file during runtime of my application...

Finally I've found the "buildServiceFromClass" logfile entry. As suggested,
I added "wsdlLocation" to my configuration in cxf-servlet.xml:


        <jaxws:endpoint id="FooService"
                wsdlLocation="Web-inf/wsdl/main.wsdl"
                implementor="#fooService"
                address="/FooService" />

Now the log says "buildServiceFromWSDL" - but now I get a "file not found"
error when I start Tomcat (see stacktrace below). It seems that my wsdl file
is lookup up in Tomcats "bin" directory? Is this a bug?

Thanks for any further hints,
Uwe


<stacktrace>

2008-06-03 10:27:53,729 ERROR
[org.springframework.web.context.ContextLoader] - Context initialization
failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'KonzessionsAbgabenSatzBereitstellen_v1': Invocation of init
method failed; nested exception is javax.xml.ws.WebServiceException:
org.apache.cxf.service.factory.ServiceConstructionException: Failed to
create service.
Caused by: 
javax.xml.ws.WebServiceException:
org.apache.cxf.service.factory.ServiceConstructionException: Failed to
create service.
        at
org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:258)
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:194)
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:380)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1240)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1205)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
.createBean(AbstractAutowireCapableBeanFactory.java:425)
....
Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
Failed to create service.
        at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:83)
        at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFrom
WSDL(ReflectionServiceFactoryBean.java:299)
        at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServic
eModel(ReflectionServiceFactoryBean.java:392)
        at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflectio
nServiceFactoryBean.java:180)
        at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFact
oryBean.java:163)
        at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Abst
ractWSDLBasedEndpointFactory.java:79)
        at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:114)
        at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.ja
va:160)
        at
org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:322)
        at
org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:244)
        ... 43 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
Problem parsing 'Web-inf/wsdl/main.wsdl'.: java.io.FileNotFoundException:
D:\ws\tools\apache-tomcat-5.5.17\bin\Web-inf\wsdl\main.wsdl (Das System kann
den angegebenen Pfad nicht finden)
        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.java:20
6)
        at
org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:170
)
        at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:81)
        ... 52 more
Caused by: java.io.FileNotFoundException:
D:\ws\tools\apache-tomcat-5.5.17\bin\Web-inf\wsdl\main.wsdl (Das System kann
den angegebenen Pfad nicht finden)
        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.java:7
0)
        at
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection
.java:161)
        at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(
XMLEntityManager.java:973)
        at
com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersi
on(XMLVersionDetector.java:184)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Con
figuration.java:798)
        at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Con
figuration.java:764)
        at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:14
8)
        at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:25
0)
        at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBu
ilderImpl.java:292)
        ... 58 more

</stacktrace>




> -----Ursprüngliche Nachricht-----
> Von: Daniel Kulp [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 14. Mai 2008 17:54
> An: [email protected]
> Betreff: Re: CXF delivers transformed WSDL on ?wsdl Request
> 
> 
> 
> On May 14, 2008, at 9:08 AM, Maurer Uwe wrote:
> > Thanks for your hints - however: it still does not work.
> >
> > First: I did not find any log messages about "buildServiceFromClass" 
> > or "buildServiceFromWSDL" in catalina.out.
> 
> 
> Hmm...   that's not good.   Can you grep through all the 
> files in logs  
> for those strings?    Do you have some setting or something that is  
> changing the default java.util.logging log levels?    That's very  
> strange.
> 
> 
> > Second:
> > I replaced the configuration in cxf-servlet.xml
> >
> > <jaxws:endpoint id="FooService"
> >     implementor="#fooService"
> >     address="/FooService">
> > </jaxws:endpoint>
> >
> > with a new one like:
> >
> >
> > <jaxws:endpoint id="FooService"
> >     implementor="#fooService"
> >     wsdlLocation="wsdl/main.wsdl"
> >     createdFromAPI="false"
> >     address="/FooService">
> > </jaxws:endpoint>
> >
> > The service seems to start but when I try to access the service and
> > to read
> > the URL, I get a text saying "No service was found." There are no  
> > error
> > messages in catalina.out however.
> >
> 
> Where is the WSDL in the war?   Usually, it would be in WEB-INF/wsdl  
> or similar in which case the location should be specified as WEB-INF/ 
> wsdl/main.wsdl.
> 
> Dan
> 
> 
> 
> 
> > Any hints? Thanks in advance.
> >
> > --
> > Uwe Maurer
> > Software Architect / SIS OIBKV
> >
> > ____EnBW Systeme Infrastruktur Support GmbH
> > Tel.: +49 (7 21) 63- 1 45 17
> > Mobil: +49 (175) 2 28 98 34
> > mailto:[EMAIL PROTECTED]
> >
> >
> >> -----Ursprüngliche Nachricht-----
> >> Von: Daniel Kulp [mailto:[EMAIL PROTECTED]
> >> Gesendet: Dienstag, 13. Mai 2008 17:49
> >> An: [email protected]
> >> Betreff: Re: CXF delivers transformed WSDL on ?wsdl Request
> >>
> >>
> >>
> >> In the catalina.out file or other log file, can you look for lines 
> >> that look something like:
> >>
> >> May 12, 2008 1:06:07 PM 
> >> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> >> buildServiceFromClass
> >>
> >> or
> >>
> >> May 12, 2008 1:06:07 PM 
> >> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> >> buildServiceFromWSDL
> >>
> >>
> >> The second is what we want to see.   In the first case, it
> >> builds the
> >> WSDL based on the annotations in the class and such.   The second
> >> should be using the wsdl properly.     If you see the
> >> buildServiceFromClass form, you'll need to update the 
> spring config 
> >> (or annotations) to specify the wsdlLocation.
> >>
> >>
> >> Dan
> >>
> >>
> >>
> >>
> >> On May 13, 2008, at 8:52 AM, Maurer Uwe wrote:
> >>
> >>> Hi,
> >>>
> >>> I am developing a "contract first" webservice using CXF 
> on Tomcat. 
> >>> The WSDL file is originally built by SAP Netweaver and consists of
> >> three files:
> >>>
> >>> ./main.wsdl
> >>>   - defines <wsdl:service> and imports
> >> ./bindings/Http_document.wsdl
> >>> via <wsdl:import> ./bindings/Http_document.wsdl
> >>>   - defines <wsdl:binding> and imports 
> >>> ../porttypes/Http_fooservice_document.wsdl
> >>> ./porttypes/http_fooservice_document.wsdl
> >>>   - defines <wsdl:types>
> >>>
> >>> I impleneted my service using a JAXB binding generated from the 
> >>> WSDL2Java tool. I deploy the three files in a war in WEB-INF/wsdl
> >> directory. The
> >>> service itselfs runs - BUT:
> >>>
> >>> A request with parameter ?wsdl returns a different WSDL
> >> file than the
> >>> original. There are only two files left:
> >>>
> >>> One defining <wsdl:service> and <wsdl:types> and another
> >> includes one
> >>> defining <wsdl:binding>. Also some names (Faults) differ. 
> This leads 
> >>> to compatibility problems with the service clients.
> >>>
> >>> Can anyone explain this behaviour to me?
> >>> How can I manage, that the original WSDLs are delivered
> >> through the ?
> >>> wsdl
> >>> request?
> >>>
> >>> Yours,
> >>> Uwe
> >>
> >> ---
> >> Daniel Kulp
> >> [EMAIL PROTECTED]
> >> http://www.dankulp.com/blog
> >>
> >>
> >>
> >>
> >>
> 
> ---
> Daniel Kulp
> [EMAIL PROTECTED]
> http://www.dankulp.com/blog
> 
> 
> 
> 
> 

Reply via email to