Excellent! Thanks very much. Somehow -Eosv does not solve the problem.
So I put the nillable="true" in the element there, and it works.
Amila Suriarachchi wrote:
this means your object structure do not have loaded the required fault
elements.
see you schema there should be an element named fault without
minOccurs=0 or nillable=ture.
So ADB gives an exception because of this.
if you want to remove this use -Eosv when genrating the code.
Amia.
On 10/23/07, *Huitang Li* < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Hi,
I created a web service code based on a wsdl, and it is run in resin
3.1.3, and I have the soapmonitor activated. When a web service
client
sent a soap message to it, it threw the following exception:
java.lang.RuntimeException: Can not serialize OM Element Envelope
at
org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:916)
at
org.apache.axis2.handlers.soapmonitor.SOAPMonitorHandler.invoke(SOAPMonitorHandler.java:101)
at org.apache.axis2.engine.Phase.invoke (Phase.java:292)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
at
org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:442)
at
org.apache.axis2.transport.http.AxisServlet.handleFault
(AxisServlet.java:403)
at
org.apache.axis2.transport.http.AxisServlet.processAxisFault(AxisServlet.java:366)
at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:154)
at javax.servlet.http.HttpServlet.service (HttpServlet.java:153)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
at
com.caucho.server.security.SecurityFilterChain.doFilter
(SecurityFilterChain.java:134)
at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178)
at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:241)
at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:268)
at
com.caucho.server.port.TcpConnection.run(TcpConnection.java:586)
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java :690)
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:612)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.axis2.databinding.ADBException: Property
cannot be
null!
at test.Fault.serialize (Fault.java:95)
at test.Fault$1.serialize(Fault.java:80)
at
org.apache.axis2.databinding.ADBDataSource.serialize(ADBDataSource.java:82)
at
org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerializeAndConsume
(OMSourcedElementImpl.java:599)
at
org.apache.axiom.soap.impl.llom.SOAPFaultDetailImpl.internalSerialize(SOAPFaultDetailImpl.java:86)
at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java
:756)
at
org.apache.axiom.soap.impl.llom.SOAPFaultImpl.internalSerialize(SOAPFaultImpl.java:192)
at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:756)
at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize
(OMElementImpl.java:772)
at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:756)
at
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java
:210)
at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:756)
at
org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:345)
at
org.apache.axiom.om.impl.llom.OMElementImpl.toString
(OMElementImpl.java:913)
... 18 more
This exception will not be shown when all elements in the requesting
soap message are filled with non-empty (no-blankspace) values.
I notice that the exception is thrown from the following
axis2-generated
code:
public void serialize(final javax.xml.namespace.QName parentQName,
final org.apache.axiom.om.OMFactory factory,
org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter
xmlWriter)
throws javax.xml.stream.XMLStreamException,
org.apache.axis2.databinding.ADBException {
//We can safely assume an element has only one type associated
with it
if (localFault == null) {
throw new org.apache.axis2.databinding.ADBException(
"Property cannot be null!");
<======================== the line where the exception is thrown.
}
localFault.serialize(MY_QNAME, factory, xmlWriter);
}
My question is: In the line where the exception is thrown, why is the
parameter localFault null? How to make it as a non-null value?
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
--
Amila Suriarachchi,
WSO2 Inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]