Java.Lang.Assertion error when using apache beehive control and xmlBeans. (Doc ID 1141903.1)

Last updated on JUNE 09, 2016

Applies to:

Oracle Weblogic Server - Version: 9.2 and later   [Release: and later ]
Information in this document applies to any platform.

Goal

When the return object of the method is set to null and tried to return an XMLBean from a Web service below exception is thrown


java.lang.AssertionError
at org.apache.xmlbeans.impl.values.XmlObjectBase.build_text(XmlObjectBase.java:837)
at org.apache.xmlbeans.impl.store.Xobj.ensureOccupancy(Xobj.java:1694)
at org.apache.xmlbeans.impl.store.Xobj.copyNode(Xobj.java:1097)
at org.apache.xmlbeans.impl.store.Xobj.array_setter(Xobj.java:2430)
at org.apache.xmlbeans.impl.values.XmlComplexContentImpl.arraySetterHelper(XmlComplexContentImpl.java:1055)
at br.com.petrobras.ep.production.productioncontrol.productionlosses.schemas.impl.HistoricProductionLossListImpl.setHistoricProductionLossArray(HistoricProductionLossListImpl.java:119)
at br.Teste.hello(Teste.java:24)
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:585)
at weblogic.wsee.component.pojo.JavaClassComponent.invoke(JavaClassComponent.java:99)
at weblogic.wsee.ws.dispatch.server.ComponentHandler.handleRequest(ComponentHandler.java:64)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:127)
at weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDispatcher.java:85)
at weblogic.wsee.ws.WsSkel.inv


for Eg:

<xs:element name="TestSet">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
<xs:element name="More">
<xs:complexType>
<xs:sequence>
<xs:element name="MoreName" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

the following code will fail if assertions are enabled:

TestSetDocument doc = TestSetDocument.Factory.newInstance();
TestSet testSet = doc.addNewTestSet();

testSet.setMore(null);
testSet.setMore(null);
testSet.validate();

while it will succeed if assertions are disabled.

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms