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

                 Key: RAMPART-325
                 URL: https://issues.apache.org/jira/browse/RAMPART-325
             Project: Rampart
          Issue Type: Bug
          Components: rampart-core
    Affects Versions: 1.5.1
         Environment: JDK 1.6.0_23, Windows
            Reporter: Andre Pankraz
            Priority: Critical


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) {
                                OptimizePartsConfig config = 
rampartConfig.getOptimizeParts();
                                if (config != null) {
                                        
MessageOptimizer.optimize(msgCtx.getEnvelope(),
                                                        
config.getExpressions(), config.getNamespaces());
                                }
                        }
        }


-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to