0 Replies Latest reply on May 14, 2010 9:27 AM by Balasaheb Aher

    How to get DeliveryChannel/ComponentContext in "jaxws:endpoint" service?

    Balasaheb Aher Newbie

      Hi All,

       

      I am evaluating the service mix 4.2.

       

      So I tried the following example.

      examples\cxf-osgi

       

      To check the performance of calling 2 services I created copy of this example as

      examples\cxf-osgi1

       

      Now "cxf-osgi" is calling the "cxf-osgi1" over the http URL as given in the sample code.

      examples\cxf-osgi\src\main\java\org\apache\servicemix\samples\cxf_osgi\Client.java.

       

      This runs good for 10 caller threads. and 10000 external requests.

       

      But if the caller threads are made more than 20 then it starts failing after some time with following exception.

       

      java.net.BindException: Address already in use: connect

              at java.net.PlainSocketImpl.socketConnect(Native Method)

              at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)

              at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)

              at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)

              at java.net.Socket.connect(Socket.java:519)

              at java.net.Socket.connect(Socket.java:469)

              at sun.net.NetworkClient.doConnect(NetworkClient.java:157)

              at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)

              at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)

              at sun.net.www.http.HttpClient.(HttpClient.java:233)

              at sun.net.www.http.HttpClient.New(HttpClient.java:306)

              at sun.net.www.http.HttpClient.New(HttpClient.java:323)

              at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:788)

              at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:729)

              at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:654)

              at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:832)

       

       

      I also tried

      ComponentContext context;

      DeliveryChannel channel;

       

      to send the InOut message using "channel.sendSync(inOut);"

       

      But I am getting the channel of context as null.

       

      What is the right way of calling the "cxf-osgi" example service from other service?

      How we can get the DeliveryChannel or ComponentContext in "jaxws:endpoint" service to call the other service?

       

       

      Regards

      -Balu