You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by kupkaj <ju...@gmail.com> on 2014/10/09 12:07:59 UTC

Configuring cxf bus for jax-ws endpoint

Hi,

I have a problem with bus configuration for my webservice endpoint.
Imagine simple service with one method (oneway). I'm trying to configure for
this service to use cxf-logging and cxf-reliableMessaging features.

This is content of working cxf-servlet configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:cxf="http://cxf.apache.org/core"
      xmlns:wsrm-policy="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
      xmlns:wsrm-mgr="http://cxf.apache.org/ws/rm/manager"
      xmlns:jaxws="http://cxf.apache.org/jaxws"
      xsi:schemaLocation="
        http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
        http://cxf.apache.org/policy
http://cxf.apache.org/schemas/policy.xsd
        http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
        http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">

  
   <import resource="classpath:META-INF/cxf/cxf.xml"/>
   <import resource="classpath:cxf.xml"/>
  
   <jaxws:endpoint id="wsrmdemo"
                  implementor="demo.wsrm.DemoServiceImpl"
                  address="/wsrmdemo"
                  /> 
  
   <cxf:bus name="busRM">
      <cxf:features>
         <cxf:logging/>
         <wsrm-mgr:reliableMessaging>
            <wsrm-policy:RMAssertion>
                <wsrm-policy:BaseRetransmissionInterval
Milliseconds="4000"/>           
                <wsrm-policy:AcknowledgementInterval Milliseconds="2000"/>          
            </wsrm-policy:RMAssertion> 
            <wsrm-mgr:sourcePolicy>
                <wsrm-mgr:sequenceTerminationPolicy maxLength="5"/>                    
            </wsrm-mgr:sourcePolicy>     
            <wsrm-mgr:destinationPolicy acceptOffers="false"/>            
         </wsrm-mgr:reliableMessaging>
      </cxf:features>
   </cxf:bus>
</beans>

- this is working fine. When I deploy service like this in Tomcat and
navigate to 
http://localhost:8080/demo
I can see this service being listed under "Available SOAP services" section.

But when I configure endpoint like this
   <jaxws:endpoint id="wsrmdemo"
                  implementor="demo.wsrm.DemoServiceImpl"
                  address="/wsrmdemo"
                  bus="busRM"/> 
and re-deploy, service dissapears from the list of available SOAP services.

So my questions are:
1. why is bus attribute "disabling" the whole endpoint
2. how to properly configure cxf bus for an endpoint

Thanks.

ps: don't know if it helps, but here is content of my web.xml file:
<?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
   
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:META-INF/cxf/cxf.xml</param-value>
  </context-param>
  
  <listener>
    
   
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
    
  <servlet>
    <servlet-name>CXFServlet</servlet-name>
   
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  
  <servlet-mapping>
    <servlet-name>CXFServlet</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>
  
  <session-config>
    <session-timeout>120</session-timeout>
  </session-config>
  
</web-app>



--
View this message in context: http://cxf.547215.n5.nabble.com/Configuring-cxf-bus-for-jax-ws-endpoint-tp5749707.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Configuring cxf bus for jax-ws endpoint

Posted by kupkaj <ju...@gmail.com>.
Additional information:
I'm using cxf framework version 2.7.10.
This error pops up in localhost.log file after I navigate to address for
displaying list of available web services (but it gets written in both cases
- with or without cxf bus configuration applied):
SEVERE: Servlet.service() for servlet [CXFServlet] in context with path
[/demo] threw exception
java.lang.IllegalStateException: getWriter() has already been called for
this response
	at
org.apache.catalina.connector.Response.getOutputStream(Response.java:602)
	at
org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:196)
	at
org.apache.cxf.transport.servlet.servicelist.ServiceListGeneratorServlet.renderStyleSheet(ServiceListGeneratorServlet.java:174)
	at
org.apache.cxf.transport.servlet.servicelist.ServiceListGeneratorServlet.service(ServiceListGeneratorServlet.java:89)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
	at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:170)
	at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:153)
	at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:167)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:211)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
	at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
	at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)





--
View this message in context: http://cxf.547215.n5.nabble.com/Configuring-cxf-bus-for-jax-ws-endpoint-tp5749707p5749708.html
Sent from the cxf-user mailing list archive at Nabble.com.