axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jake Goulding (JIRA)" <>
Subject [jira] Created: (AXIS2-3910) "Namespace URI may not be null" when parsing attributes
Date Mon, 14 Jul 2008 19:40:31 GMT
"Namespace URI may not be null" when parsing attributes

                 Key: AXIS2-3910
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
    Affects Versions: 1.4
            Reporter: Jake Goulding

org.apache.axis2.AxisFault: Namespace URI may not be null
 at org.apache.axis2.AxisFault.makeFault(
 at vivisimo.Stub.fromOM(
 at vivisimo.Stub.Simple(
 at Main.main(
Caused by: java.lang.IllegalArgumentException: Namespace URI may not be null
 at vivisimo.Stub$Document_type0$Factory.parse(
 at vivisimo.Stub$List_type0$Factory.parse(
 at vivisimo.Stub$Vce$Factory.parse(
 at vivisimo.Stub.fromOM( 

Looking at the code, it comes from this section: 

// now run through all any or extra attributes
// which were not reflected until now
for (int i=0; i < reader.getAttributeCount(); i++) {
 if (!handledAttributes.contains(reader.getAttributeLocalName(i))) {
   // this is an anyAttribute and we create
   // an OMAttribute for this attr =
         reader.getAttributeNamespace(i), reader.getAttributePrefix(i)),

The node that is causing the failure is:

<vce xmlns="urn:/vivisimo/velocity">
<list path="" num="118" level="0" start="0" per="10">
<document url="" rank="0"
source="USAToday" score="0.111111" context="v%3astate=%28root%29%7croot&amp;v%3aframe=tree&amp;subquery=id%3aNdoc1.30&amp;active%3d=root&amp;v%3asubsearch=1&amp;"

The problematic attribute is @context, which is not defined in my XSD.

In all, I think there are 2 problems:

1/ I don't actually have an anyAttribute in my schema, so I would have expected to see an
error similar to the "unexpected subelement" error.
2/ I don't think that this should cause my program to generate an exception in this manner.
According to the spec:

"The namespace name for an unprefixed attribute name always has no value." [1] 

On further reading of the spec, I think that this sentence makes it more clear what should

"Default namespace declarations do not apply directly to attribute names; the interpretation
of unprefixed attributes is determined by the element on which they appear"

That is, the code should be something like:

if (namespace uri of attribute == null)
  use namespace uri of containing element 


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:
For additional commands, e-mail:

View raw message