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 "toby cabot (JIRA)" <ax...@ws.apache.org> on 2005/08/23 16:14:08 UTC
[jira] Created: (AXIS-2189) empty boolean attribute -> NPE
empty boolean attribute -> NPE
------------------------------
Key: AXIS-2189
URL: http://issues.apache.org/jira/browse/AXIS-2189
Project: Apache Axis
Type: Bug
Components: Serialization/Deserialization
Versions: 1.2.1
Environment: Fedora Core 2
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
Reporter: toby cabot
Priority: Minor
If a document has a boolean attribute, an empty instance of that attribute will trigger a NullPointerException during deserialization. For example, one of the schemas I use has
<attribute name="reportIfEmpty" type="xsd:boolean" default="false" />
If the inbound document contains
<reportSpec reportIfEmpty="" reportName="1" reportOnlyOnChange="false">
then I get
{http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.axis.utils.BeanPropertyDescriptor.set(BeanPropertyDescriptor.java:142)
at org.apache.axis.encoding.ser.BeanDeserializer.onStartElement(BeanDeserializer.java:464)
at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
at org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:154)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:148)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
at org.apache.geronimo.jetty.JettyServletHolder.handle(JettyServletHolder.java:100)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:832)
at org.mortbay.jetty.servlet.JSR154Filter.doFilter(JSR154Filter.java:171)
at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:823)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:623)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
at org.mortbay.http.HttpServer.service(HttpServer.java:954)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (AXIS-2189) empty boolean attribute -> NPE
Posted by "toby cabot (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXIS-2189?page=comments#action_12319717 ]
toby cabot commented on AXIS-2189:
----------------------------------
The problem seems to be a disagreement between BeanDeserializer.java and SimpleDeserializer.java. SimpleDeserializer.makeValue() hits
if (source.length() == 0 && typeDesc == null) {
return null;
}
which causes it to return null, but then later BeanDeserializer.onStartElement() hits
if (constructorToUse == null) {
bpd.set(value, val);
} else {
// add value for our constructor
if (constructorTarget == null) {
constructorTarget = new ConstructorTarget(constructorToUse, this);
}
constructorTarget.set(val);
}
and since constructorToUse is null it calls BeanPropertyDescriptor.set() which NPE's because of the null "val".
> empty boolean attribute -> NPE
> ------------------------------
>
> Key: AXIS-2189
> URL: http://issues.apache.org/jira/browse/AXIS-2189
> Project: Apache Axis
> Type: Bug
> Components: Serialization/Deserialization
> Versions: 1.2.1
> Environment: Fedora Core 2
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
> Reporter: toby cabot
> Priority: Minor
>
> If a document has a boolean attribute, an empty instance of that attribute will trigger a NullPointerException during deserialization. For example, one of the schemas I use has
> <attribute name="reportIfEmpty" type="xsd:boolean" default="false" />
> If the inbound document contains
> <reportSpec reportIfEmpty="" reportName="1" reportOnlyOnChange="false">
> then I get
> {http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at org.apache.axis.utils.BeanPropertyDescriptor.set(BeanPropertyDescriptor.java:142)
> at org.apache.axis.encoding.ser.BeanDeserializer.onStartElement(BeanDeserializer.java:464)
> at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
> at org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:154)
> at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
> at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
> at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
> at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
> at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
> at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:148)
> at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
> at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
> at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
> at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
> at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
> at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
> at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
> at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
> at org.apache.geronimo.jetty.JettyServletHolder.handle(JettyServletHolder.java:100)
> at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:832)
> at org.mortbay.jetty.servlet.JSR154Filter.doFilter(JSR154Filter.java:171)
> at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:823)
> at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
> at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:623)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
> at org.mortbay.http.HttpServer.service(HttpServer.java:954)
> at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
> at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
> at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
> at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
> at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (AXIS-2189) empty boolean attribute -> NPE
Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXIS-2189?page=comments#action_12319719 ]
Davanum Srinivas commented on AXIS-2189:
----------------------------------------
toby,
could i pester u to submit a patch against latest CVS? :)
-- dims
> empty boolean attribute -> NPE
> ------------------------------
>
> Key: AXIS-2189
> URL: http://issues.apache.org/jira/browse/AXIS-2189
> Project: Apache Axis
> Type: Bug
> Components: Serialization/Deserialization
> Versions: 1.2.1
> Environment: Fedora Core 2
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
> Reporter: toby cabot
> Priority: Minor
> Attachments: axis-empty-boolean-patch.txt
>
> If a document has a boolean attribute, an empty instance of that attribute will trigger a NullPointerException during deserialization. For example, one of the schemas I use has
> <attribute name="reportIfEmpty" type="xsd:boolean" default="false" />
> If the inbound document contains
> <reportSpec reportIfEmpty="" reportName="1" reportOnlyOnChange="false">
> then I get
> {http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at org.apache.axis.utils.BeanPropertyDescriptor.set(BeanPropertyDescriptor.java:142)
> at org.apache.axis.encoding.ser.BeanDeserializer.onStartElement(BeanDeserializer.java:464)
> at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
> at org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:154)
> at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
> at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
> at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
> at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
> at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
> at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:148)
> at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
> at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
> at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
> at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
> at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
> at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
> at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
> at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
> at org.apache.geronimo.jetty.JettyServletHolder.handle(JettyServletHolder.java:100)
> at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:832)
> at org.mortbay.jetty.servlet.JSR154Filter.doFilter(JSR154Filter.java:171)
> at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:823)
> at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
> at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:623)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
> at org.mortbay.http.HttpServer.service(HttpServer.java:954)
> at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
> at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
> at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
> at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
> at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (AXIS-2189) empty boolean attribute -> NPE
Posted by "toby cabot (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXIS-2189?page=comments#action_12319721 ]
toby cabot commented on AXIS-2189:
----------------------------------
Sorry Dims, you're so darn speedy that I didn't see your response before I added my patch ;) My patch is against 1.2.1 so I'll upgrade to HEAD and resubmit.
> empty boolean attribute -> NPE
> ------------------------------
>
> Key: AXIS-2189
> URL: http://issues.apache.org/jira/browse/AXIS-2189
> Project: Apache Axis
> Type: Bug
> Components: Serialization/Deserialization
> Versions: 1.2.1
> Environment: Fedora Core 2
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
> Reporter: toby cabot
> Priority: Minor
> Attachments: axis-empty-boolean-patch.txt
>
> If a document has a boolean attribute, an empty instance of that attribute will trigger a NullPointerException during deserialization. For example, one of the schemas I use has
> <attribute name="reportIfEmpty" type="xsd:boolean" default="false" />
> If the inbound document contains
> <reportSpec reportIfEmpty="" reportName="1" reportOnlyOnChange="false">
> then I get
> {http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at org.apache.axis.utils.BeanPropertyDescriptor.set(BeanPropertyDescriptor.java:142)
> at org.apache.axis.encoding.ser.BeanDeserializer.onStartElement(BeanDeserializer.java:464)
> at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
> at org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:154)
> at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
> at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
> at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
> at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
> at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
> at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:148)
> at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
> at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
> at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
> at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
> at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
> at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
> at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
> at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
> at org.apache.geronimo.jetty.JettyServletHolder.handle(JettyServletHolder.java:100)
> at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:832)
> at org.mortbay.jetty.servlet.JSR154Filter.doFilter(JSR154Filter.java:171)
> at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:823)
> at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
> at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:623)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
> at org.mortbay.http.HttpServer.service(HttpServer.java:954)
> at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
> at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
> at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
> at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
> at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (AXIS-2189) empty boolean attribute -> NPE
Posted by "toby cabot (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXIS-2189?page=all ]
toby cabot updated AXIS-2189:
-----------------------------
Attachment: axis-empty-boolean-patch.txt
here's a version of the patch that applies to the HEAD and includes a unit test
> empty boolean attribute -> NPE
> ------------------------------
>
> Key: AXIS-2189
> URL: http://issues.apache.org/jira/browse/AXIS-2189
> Project: Apache Axis
> Type: Bug
> Components: Serialization/Deserialization
> Versions: 1.2.1
> Environment: Fedora Core 2
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
> Reporter: toby cabot
> Priority: Minor
> Attachments: axis-empty-boolean-patch.txt, axis-empty-boolean-patch.txt
>
> If a document has a boolean attribute, an empty instance of that attribute will trigger a NullPointerException during deserialization. For example, one of the schemas I use has
> <attribute name="reportIfEmpty" type="xsd:boolean" default="false" />
> If the inbound document contains
> <reportSpec reportIfEmpty="" reportName="1" reportOnlyOnChange="false">
> then I get
> {http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at org.apache.axis.utils.BeanPropertyDescriptor.set(BeanPropertyDescriptor.java:142)
> at org.apache.axis.encoding.ser.BeanDeserializer.onStartElement(BeanDeserializer.java:464)
> at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
> at org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:154)
> at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
> at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
> at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
> at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
> at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
> at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:148)
> at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
> at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
> at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
> at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
> at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
> at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
> at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
> at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
> at org.apache.geronimo.jetty.JettyServletHolder.handle(JettyServletHolder.java:100)
> at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:832)
> at org.mortbay.jetty.servlet.JSR154Filter.doFilter(JSR154Filter.java:171)
> at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:823)
> at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
> at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:623)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
> at org.mortbay.http.HttpServer.service(HttpServer.java:954)
> at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
> at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
> at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
> at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
> at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (AXIS-2189) empty boolean attribute -> NPE
Posted by "toby cabot (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXIS-2189?page=all ]
toby cabot updated AXIS-2189:
-----------------------------
Attachment: axis-empty-boolean-patch.txt
This is a workaround, but I don't think it's a fix. I added an explicit check that throws a NumberFormatException if the boolean is empty. There's already code in makeBasicValue() that throws if it can't parse the boolean, so I guess this acceptable behavior. The result is still pretty ugly, i.e. stack traces in the log and result messages with "java.lang" in them, but at least they indicate a bad boolean rather than an NPE.
> empty boolean attribute -> NPE
> ------------------------------
>
> Key: AXIS-2189
> URL: http://issues.apache.org/jira/browse/AXIS-2189
> Project: Apache Axis
> Type: Bug
> Components: Serialization/Deserialization
> Versions: 1.2.1
> Environment: Fedora Core 2
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
> Reporter: toby cabot
> Priority: Minor
> Attachments: axis-empty-boolean-patch.txt
>
> If a document has a boolean attribute, an empty instance of that attribute will trigger a NullPointerException during deserialization. For example, one of the schemas I use has
> <attribute name="reportIfEmpty" type="xsd:boolean" default="false" />
> If the inbound document contains
> <reportSpec reportIfEmpty="" reportName="1" reportOnlyOnChange="false">
> then I get
> {http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at org.apache.axis.utils.BeanPropertyDescriptor.set(BeanPropertyDescriptor.java:142)
> at org.apache.axis.encoding.ser.BeanDeserializer.onStartElement(BeanDeserializer.java:464)
> at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
> at org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:154)
> at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
> at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
> at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
> at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
> at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
> at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:148)
> at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
> at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
> at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
> at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
> at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
> at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
> at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
> at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
> at org.apache.geronimo.jetty.JettyServletHolder.handle(JettyServletHolder.java:100)
> at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:832)
> at org.mortbay.jetty.servlet.JSR154Filter.doFilter(JSR154Filter.java:171)
> at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:823)
> at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
> at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:623)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
> at org.mortbay.http.HttpServer.service(HttpServer.java:954)
> at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
> at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
> at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
> at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
> at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira