You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by tsunpo <ts...@yahoo.com> on 2009/07/17 15:17:34 UTC

Re: Service Construction Exception for second jaxws:endpoint listed in Spring config file

Hi,

I am new to CXF and I also have similar problem. 

It seems I cannot have multiple endpoints per servlet. 
Was wondering did u find out the solution yet?

Here is my code:
1. cxf.xml
<beans>
  ...
  <jaxws:endpoint id="example1"
    implementor="com.example.business.Example1"
    serviceName="Example1Service"
    address="/Example1WS">
  </jaxws:endpoint>
  
  <jaxws:endpoint id="example2"
    implementor="com.example.business.Example2"
    serviceName="Example2Service"
    address="/Example2WS">
  </jaxws:endpoint>
</beans>

2. I DO can visit both:
http://localhost:8080/example/services/Example1WS
http://localhost:8080/example/services/Example2WS

3. My Client.java
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.setServiceClass(Example1.class);
factory.setAddress(url + "/Example1WS");

Example1 client = (Example1) factory.create();
client.doSomething();

4. Error meeages:
Exception in thread "AWT-EventQueue-0" javax.xml.ws.soap.SOAPFaultException:
Could not send Message.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:141)
at $Proxy47.doSomething(Unknown Source)

And Tomcat said:
Servlet transport factory already registered

5. However, if I remove "Example2" endpoint in "cxf.xml", re-start Tomcat
and it works fine.

Can I have more than one endpoint per servlet?

Please advise,
George



Nick Heudecker wrote:
> 
> This one has me stumped.  Here's what my Spring config looks like, with
> some
> anonymized class names:
> 
>     <jaxws:endpoint id="foo" address="/foo" implementor="#fooService"
> implementorClass="com.example.FooServiceImpl">
>         <jaxws:dataBinding>
>             <ref bean="jaxbDataBinding"/>
>         </jaxws:dataBinding>
>     </jaxws:endpoint>
>     <jaxws:endpoint id="bar" address="/bar" implementor="#barService"
> implementorClass="com.example.BarServiceImpl">
>         <jaxws:dataBinding>
>             <ref bean="jaxbDataBinding"/>
>         </jaxws:dataBinding>
>     </jaxws:endpoint>
> 
> With "bar" listed second, I get the following exception:
> 
> Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
> Service class com.example.BarServer method serviceStatusNotification part
> {
> http://www.scte.org/schemas/130-4/2008a/cis}request cannot be mapped to
> schema. Check for use of a JAX-WS-specific type without the JAX-WS service
> factory bean.
> 
> The "serviceStatusNotification" method is the first method listed in the
> class.  If I swap the config and list foo second, I get the exact same
> error
> for the first method name in the FooService interface.
> 
> No idea what's causing this.  I'm on CXF 2.2.1.  Any help is appreciated.
> 
> Thanks for your time.
> 
> -Nick
> 
> 

-- 
View this message in context: http://www.nabble.com/Service-Construction-Exception-for-second-jaxws%3Aendpoint-listed-in--Spring-config-file-tp23556357p24534295.html
Sent from the cxf-user mailing list archive at Nabble.com.