You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Jason Pyeron (Jira)" <ji...@apache.org> on 2026/01/09 16:32:00 UTC
[jira] [Created] (CXF-9193) NPE in cxf-core-3.6.9.jar
Jason Pyeron created CXF-9193:
---------------------------------
Summary: NPE in cxf-core-3.6.9.jar
Key: CXF-9193
URL: https://issues.apache.org/jira/browse/CXF-9193
Project: CXF
Issue Type: Bug
Components: Core
Affects Versions: 3.6.9
Reporter: Jason Pyeron
{quote}java.lang.NullPointerException: Cannot invoke "String.isEmpty()" because the return value of "org.apache.cxf.staxutils.transform.DelegatingNamespaceContext.getPrefix(String)" is null
at org.apache.cxf.staxutils.transform.OutTransformWriter.writeDefaultNamespace(OutTransformWriter.java:143)
at org.apache.cxf.ws.rm.CapturingXMLWriter.writeDefaultNamespace(CapturingXMLWriter.java:176)
at org.apache.cxf.staxutils.StaxUtils.writeElement(StaxUtils.java:990)
at org.apache.cxf.staxutils.StaxUtils.writeElement(StaxUtils.java:925)
at org.apache.cxf.staxutils.StaxUtils.writeNode(StaxUtils.java:1062)
at org.apache.cxf.staxutils.StaxUtils.writeElement(StaxUtils.java:1027)
at org.apache.cxf.staxutils.StaxUtils.writeElement(StaxUtils.java:925)
at org.apache.cxf.staxutils.StaxUtils.writeNode(StaxUtils.java:1062)
at org.apache.cxf.staxutils.StaxUtils.writeElement(StaxUtils.java:1027)
at org.apache.cxf.staxutils.StaxUtils.writeElement(StaxUtils.java:925)
at org.apache.cxf.staxutils.StaxUtils.writeNode(StaxUtils.java:1062)
at org.apache.cxf.staxutils.StaxUtils.writeElement(StaxUtils.java:1027)
at org.apache.cxf.staxutils.StaxUtils.writeElement(StaxUtils.java:925)
at org.apache.cxf.staxutils.StaxUtils.writeNode(StaxUtils.java:1062)
at org.apache.cxf.staxutils.StaxUtils.writeNode(StaxUtils.java:1087)
at org.apache.cxf.databinding.source.XMLStreamDataWriter.writeNode(XMLStreamDataWriter.java:183)
at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:101)
at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:68)
at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:56)
at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:137)
at org.apache.cxf.wsdl.interceptors.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:90)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:304)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:217)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:555)
{quote}
patch
{quote}@@ -140,7 +140,8 @@ public class OutTransformWriter extends DelegatingXMLStreamWriter {
uri = value != null ? value : uri;
- if (writtenUris.get(0).contains(uri) && namespaceContext.getPrefix(uri).isEmpty()) {
+ String pref;
+ if (writtenUris.get(0).contains(uri) && ((pref=namespaceContext.getPrefix(uri)) == null || pref.isEmpty())) {
return;
}
super.writeDefaultNamespace(uri);
{quote}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)