Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-27325

[GSS](7.4.z) JBWS-4424 - Heavy load in CXF Service.getPort calls from a servlet causes performance issue

XMLWordPrintable

      Heavy load in CXF Service.getPort calls from a servlet, will cause performance issue from:

      https://github.com/apache/cxf/blob/main/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SOAPBindingUtil.java#L92

      @WebServlet(
          urlPatterns = {"/WSAccess"},
          asyncSupported = true
      )
      public class WSAccessServlet extends HttpServlet {
          public WSAccessServlet() {
          }
      
          protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              String endPointAddress = "http://localhost:8080/jaxws-retail/ProfileMgmtService/ProfileMgmt";
              QName serviceName = new QName("http://org.jboss.ws/samples/retail/profile", "ProfileMgmtService");
      
              try {
                  URL wsdlURL = new URL(endPointAddress + "?wsdl");
                  Service service = Service.create(wsdlURL, serviceName);
                  ProfileMgmt proxy = (ProfileMgmt)service.getPort(ProfileMgmt.class);
                  Customer customer = new Customer();
                  customer.setFirstName("JayƩ");
                  customer.setLastName("Boss");
                  customer.setCreditCardDetails("newbie");
                  DiscountRequest dRequest = new DiscountRequest();
                  dRequest.setCustomer(customer);
                  DiscountResponse dResponse = proxy.getCustomerDiscount(dRequest);
                  Customer responseCustomer = dResponse.getCustomer();
                  System.out.format("%s %s's discount is %.2f%n", responseCustomer.getFirstName(), responseCustomer.getLastName(), dResponse.getDiscount());
              } catch (Exception var12) {
                  var12.printStackTrace();
              }
      
          }
      } 

      The first trying load SOAP relevant class with current context loader(deployment classloader) always fail. This takes a lot of CPU time and throws other JDK exception when this is called with high concurrent requests.

              istudens@redhat.com Ivo Studensky
              rhn-support-aogburn Aaron Ogburn
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: