Uploaded image for project: 'Rampart'
  1. Rampart
  2. RAMPART-325

NullPointerException with UsernameToken Policy and MTOM Policy without Rampart Config in WSDL

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.5.1
    • Fix Version/s: None
    • Component/s: rampart-core
    • Labels:
      None
    • Environment:
      JDK 1.6.0_23, Windows

      Description

      Exception:

      16:56:01,973 INFO [STDOUT] [ERROR]
      java.lang.NullPointerException
      at org.apache.rampart.policy.RampartPolicyData.getOptimizePartsConfig(RampartPolicyData.java:952)
      at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:165)
      at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:64)
      at org.apache.axis2.engine.Phase.invoke(Phase.java:318)
      at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:254)
      at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:419)
      at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:43)
      at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
      at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)
      at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:173)
      at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:144)

      I think the problem is a missing rampart-config in the WSDL...but this additional configuration isn't really necessary for MTOM Policy together with UserName Token Security Policy. (no message signature or encryption involved)

      Possible Bugfix - it works in our case with this small change:

      In org.apache.rampart.MessageBuilder, Line 161, additional Null check:

      /*

      • Checking whether MTOMSerializable is there. If so set optimizeElement.
      • */
        if(rpd.isMTOMSerialize()){
        msgCtx.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
        RampartConfig rampartConfig = rpd.getRampartConfig();
        if (rampartConfig != null)
        Unknown macro: { OptimizePartsConfig config = rampartConfig.getOptimizeParts(); if (config != null) { MessageOptimizer.optimize(msgCtx.getEnvelope(), config.getExpressions(), config.getNamespaces()); } }

        }

        Attachments

        1. RAMPART-325.patch
          0.6 kB
          Suresh Attanayake

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              andrep Andre Pankraz
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: