[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axis-user-ja
Subject:    [jira] [Commented] (RAMPART-325) NullPointerException with UsernameToken Policy and MTOM Policy with
From:       "Giorgio Gallo (JIRA)" <jira () apache ! org>
Date:       2012-07-25 20:39:34
Message-ID: 470766852.102960.1343248774791.JavaMail.jiratomcat () issues-vm
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/RAMPART-325?page=com.atlassian.jira.plugin \
.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422592#comment-13422592 ] 

Giorgio Gallo commented on RAMPART-325:
---------------------------------------

Issue seems still there in 1.6.2.

An alternative fix would be to edit RampartPolicyData.getOptimizePartsConfig() \
implementation from

return rampartConfig.getOptimizeParts(); // may throw NPE as rampartConfig may be \
null

to

return rampartConfig == null ? null : rampartConfig.getOptimizeParts();


                
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: \
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more \
information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic