Announcement Announcement Module
No announcement yet.
@Oneway impossible with Spring and CXF? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • @Oneway impossible with Spring and CXF?

    The javax.jws.Oneway annotation tells the run time that it can optimize the execution of the method by not waiting for a response and by not reserving any resources to process a response.
    * Method returns void
    * Method has no parameters that implement the Holder interface
    * Method does not not throw any exceptions that can be passed back to a consumer

    The following code snippet satisfies all these prerequisites put Oneway has no effect either (I'm not allowed to post [a t] in my first post here in the forum... :

    WebService(name = "LockService", targetNamespace = "foo")
    public interface LockService {
    public void oneWayTest();
    public class LockServiceImpl implements LockService {
        public void oneWayTest() {
            try {
            } catch (InterruptedException e) {
                System.out.println("+++++++++ Interrupted exception");

    <!-- Bean -->
    <bean id="lockService" class="foo.service.LockServiceImpl"/>
    <!-- Endpoints -->
    <jaxws:endpoint id="lockServiceEndpoint" implementor="#lockService" address="/LockService" />
    Somewhere else I read: If you are configuring a Web service for which you have an ServiceEndpoint Interface, you have to insert the Oneway annotation in the SEI. If you insert it in the implementation bean, it will not be processed.
    For Spring and CXF I must define an interface so I inserted the annotation in the interface.
    But my jaxws:endpoint refers to my Impl-class, where ther's no annotation. It doesn't help to insert it in the interface AND in the Impl.
    So, is it impossible to use this annotation?

  • #2
    This was a CXF bug, which is now fixed on trunk/2.1.x.