RE: Namespace map for WSDL generation (using JAXB).
I just wanted to add the trace in case that help someone: 9-Dec-2008 4:59:54 PM org.apache.cxf.transport.servlet.ServletController invoke WARNING: org.apache.cxf.transport.http.WSDLQueryHandler Exception caught writing response. org.apache.cxf.transport.http.WSDLQueryException: Exception occurred while trying to process http://localhost:8080/Pythia/services/Pythia?WSDL at org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHa ndler.java:214) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletControl ler.java:154) at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFSe rvlet.java:175) at org.apache.cxf.transport.servlet.AbstractCXFServlet.doGet(AbstractCXFSer vlet.java:157) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1 51) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:87 4) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc essConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint .java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow erWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:689) at java.lang.Thread.run(Thread.java:619) Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Can't find prefix for 'http://www.cdmv.com'. Namespace prefixes must be set on the Definition object using the addNamespace(...) method. at com.ibm.wsdl.util.xml.DOMUtils.getPrefix(Unknown Source) at com.ibm.wsdl.util.xml.DOMUtils.getQualifiedValue(Unknown Source) at com.ibm.wsdl.util.xml.DOMUtils.printQualifiedAttribute(Unknown Source) at com.ibm.wsdl.xml.WSDLWriterImpl.printParts(Unknown Source) at com.ibm.wsdl.xml.WSDLWriterImpl.printMessages(Unknown Source) at com.ibm.wsdl.xml.WSDLWriterImpl.printDefinition(Unknown Source) at com.ibm.wsdl.xml.WSDLWriterImpl.writeWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source) at org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHa ndler.java:171) ... 19 more 9-Dec-2008 4:59:54 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet CXFServlet threw exception javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Can't find prefix for 'http://www.cdmv.com'. Namespace prefixes must be set on the Definition object using the addNamespace(...) method. at com.ibm.wsdl.util.xml.DOMUtils.getPrefix(Unknown Source) at com.ibm.wsdl.util.xml.DOMUtils.getQualifiedValue(Unknown Source) at com.ibm.wsdl.util.xml.DOMUtils.printQualifiedAttribute(Unknown Source) at com.ibm.wsdl.xml.WSDLWriterImpl.printParts(Unknown Source) at com.ibm.wsdl.xml.WSDLWriterImpl.printMessages(Unknown Source) at com.ibm.wsdl.xml.WSDLWriterImpl.printDefinition(Unknown Source) at com.ibm.wsdl.xml.WSDLWriterImpl.writeWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source) at org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHa ndler.java:171) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletControl ler.java:154) at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFSe rvlet.java:175) at org.apache.cxf.transport.servlet.AbstractCXFServlet.doGet(AbstractCXFSer vlet.java:157) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :127) at
Re: Namespace map for WSDL generation (using JAXB).
Is there anyway you could package up your sample and send it in? Privately to me is fine as well. One other person ran into this, but I've never been able to reproduce it so I'm not really sure how to start debugging it. Dan On Tuesday 09 December 2008 1:49:36 pm Ducharme, Ugo wrote: Hi, I am migrating our webapps from apache-cxf-2.0.5-incubator to apache-cxf-2.1.3. Everything seems OK except for a problem, when I ask for a WSDL, it crashes with this message: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Can't find prefix for 'http://www.cdmv.com'. Namespace prefixes must be set on the Definition object using the addNamespace(...) method. My question is: how do I set a prefix to this namespace? I have this spring configuration that defines my web service: bean id=Pythia class=org.apache.cxf.jaxws.JaxWsServerFactoryBean init-method=create property name=serviceClass value=com.cdmv.pythia.PythiaImpl / property name=serviceBeanbean class=com.cdmv.pythia.PythiaImpl//property property name=address value=/Pythia/ property name=bus ref=cxf/ property name=dataBinding bean class=org.apache.cxf.jaxb.JAXBDataBinding property name=namespaceMap map entry key=http://www.cdmv.com; value=cdmv / /map /property /bean /property property name=inInterceptors list bean id=iStoreJaasInterceptor class=com.cdmv.cxf.IStoreJaasInterceptor depends-on=jaasConfiguration property name=loginContextName value=Pythia / property name=IStoreUrl bean class=org.springframework.jndi.JndiObjectFactoryBean property name=jndiName value=java:comp/env/iStore/url / /bean /property /bean /list /property property name=properties map entry key=jaxb.additionalContextClasses bean class=com.cdmv.jaxb.ClassArrayFactoryBean property name=classNames list valuecom.cdmv.jaas.BasePrincipal/value valuecom.cdmv.jaas.istore.IStorePrincipal/value valuecom.cdmv.jaas.istore.IStoreAuthenticatedPrincipal/value /list /property /bean /entry /map /property /bean Has you can see in this config, I tried to add the namespace prefix in the dataBindig definition but it does not work. This webservice is a Java first development using annotations. I tried to use the @XmlNs annotation but it does not help either. The http://www.cdmv.com namespace comes from the tree classes in the jaxb.additionalContextClasses property. I am sure it's just a matter of putting the right definition in the right place but I don't know where. -- Daniel Kulp [EMAIL PROTECTED] http://dankulp.com/blog