You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Thomas Poetter (JIRA)" <ji...@apache.org> on 2008/07/04 17:53:31 UTC
[jira] Created: (AXIS2-3892) WebServiceStub crashes with
NullPointerException when web service function is called with null as
argument
WebServiceStub crashes with NullPointerException when web service function is called with null as argument
----------------------------------------------------------------------------------------------------------
Key: AXIS2-3892
URL: https://issues.apache.org/jira/browse/AXIS2-3892
Project: Axis 2.0 (Axis2)
Issue Type: Bug
Components: codegen
Affects Versions: 1.4
Environment: WinXP for AXIS client + server, Rampart 1.4
Reporter: Thomas Poetter
Call:
InterActiveResponse result = stub.GetInfo(null);
Crash in:
public InterActiveResponse GetInfo(InterActiveRequest interActiveRequest0)
env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
interActiveRequest0, // <-- value of interActiveRequest0: null => causes NullPointerException
optimizeContent(new javax.xml.namespace.QName("https://xxx/AccountInformation", "GetInfo")));
I know that one fix is to prevent the client to call the service with null as argument. However, I feel the client shouldn't crash in this case but return null without crashing or throw an IllegalArgumentException or a similar - less fatal and more meaningful exception than NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS2-3892) WebServiceStub crashes with
NullPointerException when web service function is called with null as
argument
Posted by "Thomas Poetter (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610615#action_12610615 ]
Thomas Poetter commented on AXIS2-3892:
---------------------------------------
When called this way:
InterActiveRequest request = new InterActiveRequest();
InterActiveResponse result = stub.GetInfo(request);
This exception is generated - this may be acceptable but failure could occur more gracefully and with a more meaningful exception:
Exception in thread "main" java.lang.RuntimeException: Can not serialize OM Element Envelope
at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:1057)
at java.lang.String.valueOf(Unknown Source)
at java.lang.StringBuffer.append(Unknown Source)
at org.apache.rampart.handler.WSDoAllSender.processMessage(WSDoAllSender.java:77)
at org.apache.rampart.handler.WSDoAllHandler.invoke(WSDoAllHandler.java:72)
at org.apache.axis2.engine.Phase.invoke(Phase.java:317)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:429)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at InterActiveWebClientRampart.AccountInformationServiceStub.GetInfo(AccountInformationServiceStub.java:199)
at InterActiveWebClientRampart.AccountInformationServiceCGClient.main(AccountInformationServiceCGClient.java:43)
Caused by: org.apache.axis2.databinding.ADBException: Property cannot be null!
at InterActiveWebClientRampart.AccountInformationServiceStub$InterActiveRequest.serialize(AccountInformationServiceStub.java:37935)
at InterActiveWebClientRampart.AccountInformationServiceStub$InterActiveRequest.serialize(AccountInformationServiceStub.java:37920)
at InterActiveWebClientRampart.AccountInformationServiceStub$InterActiveRequest$1.serialize(AccountInformationServiceStub.java:37905)
at org.apache.axis2.databinding.ADBDataSource.serialize(ADBDataSource.java:93)
at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:629)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:905)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:889)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:213)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:889)
at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:375)
at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:1051)
... 12 more
> WebServiceStub crashes with NullPointerException when web service function is called with null as argument
> ----------------------------------------------------------------------------------------------------------
>
> Key: AXIS2-3892
> URL: https://issues.apache.org/jira/browse/AXIS2-3892
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: codegen
> Affects Versions: 1.4
> Environment: WinXP for AXIS client + server, Rampart 1.4
> Reporter: Thomas Poetter
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Call:
> InterActiveResponse result = stub.GetInfo(null);
> Crash in:
> public InterActiveResponse GetInfo(InterActiveRequest interActiveRequest0)
> env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
> interActiveRequest0, // <-- value of interActiveRequest0: null => causes NullPointerException
> optimizeContent(new javax.xml.namespace.QName("https://xxx/AccountInformation", "GetInfo")));
> I know that one fix is to prevent the client to call the service with null as argument. However, I feel the client shouldn't crash in this case but return null without crashing or throw an IllegalArgumentException or a similar - less fatal and more meaningful exception than NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS2-3892) WebServiceStub crashes with
NullPointerException when web service function is called with null as
argument
Posted by "Thomas Poetter (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610610#action_12610610 ]
Thomas Poetter commented on AXIS2-3892:
---------------------------------------
To be complete: In the function
private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory,
InterActiveRequest param, boolean optimizeContent) throws org.apache.axis2.AxisFault {
this call leads to the crash because param (= null) is dereferenced:
emptyEnvelope.getBody().addChild(param.getOMElement(InterActiveRequest.MY_QNAME, factory));
> WebServiceStub crashes with NullPointerException when web service function is called with null as argument
> ----------------------------------------------------------------------------------------------------------
>
> Key: AXIS2-3892
> URL: https://issues.apache.org/jira/browse/AXIS2-3892
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: codegen
> Affects Versions: 1.4
> Environment: WinXP for AXIS client + server, Rampart 1.4
> Reporter: Thomas Poetter
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Call:
> InterActiveResponse result = stub.GetInfo(null);
> Crash in:
> public InterActiveResponse GetInfo(InterActiveRequest interActiveRequest0)
> env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
> interActiveRequest0, // <-- value of interActiveRequest0: null => causes NullPointerException
> optimizeContent(new javax.xml.namespace.QName("https://xxx/AccountInformation", "GetInfo")));
> I know that one fix is to prevent the client to call the service with null as argument. However, I feel the client shouldn't crash in this case but return null without crashing or throw an IllegalArgumentException or a similar - less fatal and more meaningful exception than NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS2-3892) WebServiceStub crashes with
NullPointerException when web service function is called with null as
argument
Posted by "Thomas Poetter (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611157#action_12611157 ]
Thomas Poetter commented on AXIS2-3892:
---------------------------------------
As an attempt of a workaround for the example in the last comment, I avoided throwing an exception "Property cannot be null" in InterActiveWebClientRampart.AccountInformationServiceStub and continued with execution. This leads to the following error dump:
Exception in thread "main" org.apache.axis2.AxisFault: Error in extracting message properties
at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:70)
at org.apache.axis2.engine.Phase.invoke(Phase.java:317)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:429)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at InterActiveWebClientRampart.AccountInformationServiceStub.GetInfo(AccountInformationServiceStub.java:199)
at InterActiveWebClientRampart.AccountInformationServiceCGClient.main(AccountInformationServiceCGClient.java:77)
Caused by: org.apache.rampart.RampartException: Error in extracting message properties
at org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:322)
at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:61)
at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:64)
... 8 more
Caused by: org.apache.ws.security.WSSecurityException: Error in converting SOAP Envelope to Document; nested exception is:
org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException
at org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.java:161)
at org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:158)
... 10 more
Caused by: org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249)
at org.apache.axiom.om.impl.dom.NodeImpl.build(NodeImpl.java:449)
at org.apache.axiom.om.impl.dom.DocumentImpl.build(DocumentImpl.java:488)
at org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.java:134)
... 11 more
Caused by: javax.xml.stream.XMLStreamException
at org.apache.axiom.om.impl.llom.OMStAXWrapper.updateLastNode(OMStAXWrapper.java:1054)
at org.apache.axiom.om.impl.llom.OMStAXWrapper.next(OMStAXWrapper.java:977)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:506)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:161)
... 14 more
> WebServiceStub crashes with NullPointerException when web service function is called with null as argument
> ----------------------------------------------------------------------------------------------------------
>
> Key: AXIS2-3892
> URL: https://issues.apache.org/jira/browse/AXIS2-3892
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: codegen
> Affects Versions: 1.4
> Environment: WinXP for AXIS client + server, Rampart 1.4
> Reporter: Thomas Poetter
> Assignee: Amila Chinthaka Suriarachchi
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Call:
> InterActiveResponse result = stub.GetInfo(null);
> Crash in:
> public InterActiveResponse GetInfo(InterActiveRequest interActiveRequest0)
> env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
> interActiveRequest0, // <-- value of interActiveRequest0: null => causes NullPointerException
> optimizeContent(new javax.xml.namespace.QName("https://xxx/AccountInformation", "GetInfo")));
> I know that one fix is to prevent the client to call the service with null as argument. However, I feel the client shouldn't crash in this case but return null without crashing or throw an IllegalArgumentException or a similar - less fatal and more meaningful exception than NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Assigned: (AXIS2-3892) WebServiceStub crashes with
NullPointerException when web service function is called with null as
argument
Posted by "Deepal Jayasinghe (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Deepal Jayasinghe reassigned AXIS2-3892:
----------------------------------------
Assignee: Amila Chinthaka Suriarachchi
> WebServiceStub crashes with NullPointerException when web service function is called with null as argument
> ----------------------------------------------------------------------------------------------------------
>
> Key: AXIS2-3892
> URL: https://issues.apache.org/jira/browse/AXIS2-3892
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: codegen
> Affects Versions: 1.4
> Environment: WinXP for AXIS client + server, Rampart 1.4
> Reporter: Thomas Poetter
> Assignee: Amila Chinthaka Suriarachchi
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Call:
> InterActiveResponse result = stub.GetInfo(null);
> Crash in:
> public InterActiveResponse GetInfo(InterActiveRequest interActiveRequest0)
> env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
> interActiveRequest0, // <-- value of interActiveRequest0: null => causes NullPointerException
> optimizeContent(new javax.xml.namespace.QName("https://xxx/AccountInformation", "GetInfo")));
> I know that one fix is to prevent the client to call the service with null as argument. However, I feel the client shouldn't crash in this case but return null without crashing or throw an IllegalArgumentException or a similar - less fatal and more meaningful exception than NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org