xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mitch Gitman <mgit...@gmail.com>
Subject xs:simpleType & intermittent NullPointerException
Date Tue, 06 Sep 2005 21:06:41 GMT
I'm running into the strangest issues with XMLBeans 1.0.4 when binding
against XML Schema simple types which I have defined. For example,
I've defined the following type:
  
  <xs:simpleType name="PhoneNumberType">
    <xs:restriction base="xs:string">
      <xs:pattern value="[0-9]{7,10}" />
    </xs:restriction>
  </xs:simpleType>      

Sometimes -- and yes, there's the rub, sometimes -- my JUnit tests
that hit the class bound to my PhoneNumberType generate the following
NullPointerException:
java.lang.NullPointerException at
org.apache.xmlbeans.impl.schema.SchemaPropertyImpl.getType(SchemaPropertyImpl.java:92)
at org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createElementType(SchemaTypeImpl.java:879)
at org.apache.xmlbeans.impl.values.XmlObjectBase.create_element_user(XmlObjectBase.java:842)
at
org.apache.xmlbeans.impl.store.Type.create_element_user(Type.java:112)
at org.apache.xmlbeans.impl.store.Splay.getType(Splay.java:3383) at
org.apache.xmlbeans.impl.store.Type.insertElement(Type.java:849) at
org.apache.xmlbeans.impl.store.Type.add_element_user(Type.java:837) at
com.foo. xmlbeans.impl.SearchCriteriaImpl.setPhoneNumber(SearchCriteriaImpl.java:336)
at
…

It looks like the NullPointerException is arising here in SchemaPropertyImpl:
    public SchemaType getType() {
        return _typeref.get();
    }
    
Any thoughts why this is happening, and why it is happening only intermittently?
Mime
View raw message