[
https://issues.apache.org/jira/browse/AXIS2-5751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Vasile Bucur updated AXIS2-5751:
--------------------------------
Description:
Test code:
{code:java}
public class CustomError {
private Error code;
private Object detail;
// constructors
// getters and setters
}
..
new CustomError(code41); // detail is null
{code}
in adb:
{code:title=BeanUtil.java}
Object value;
if (readMethod != null) {
readMethod.setAccessible(true);
value = readMethod.invoke(beanObject); // value is null
} else {
throw new AxisFault("Property '" + propertyName + "' in bean class '"
+ beanClass.getName() + "'is not
readable.");
}
......
......
}else {
addTypeQname(elemntNameSpace, propertyQnameValueList, property,
beanName, processingDocLitBare);
if (Object.class.equals(ptype)) {
//this is required to match this element prefix as
//root element's prefix.
QName qNamefortheType = (QName) typeTable
.getComplexSchemaMap().get(
getClassName(beanClass));
OMFactory fac = OMAbstractFactory.getOMFactory();
QName elementName;
OMElement element;
if (elemntNameSpace != null) {
elementName = new QName(
elemntNameSpace.getNamespaceURI(),
property.getName(),
qNamefortheType.getPrefix());
} else {
elementName = new QName(property.getName());
}
if(SimpleTypeMapper.isSimpleType(value)){
element = fac.createOMElement(elementName);
element.addChild(fac.createOMText(SimpleTypeMapper
.getStringValue(value)));
}else{
// value is null !!!
XMLStreamReader xr = BeanUtil.getPullParser(value,
elementName, typeTable, qualified, false);
{code}
{code:title=BeanUtil.java}
public static XMLStreamReader getPullParser(Object beanObject,
QName beanName,
TypeTable typeTable,
boolean qualified,
boolean processingDocLitBare) {
Class beanClass = beanObject.getClass(); // NullPointerException
..............
{code}
was:
Test code:
{code:java}
public class CustomError {
private Error code;
private Object detail;
// constructors
// getters and setters
}
..
new CustomError(code41); // detail is null
{code}
in adb:
{code:java}
Object value;
if (readMethod != null) {
readMethod.setAccessible(true);
value = readMethod.invoke(beanObject); // value is null
} else {
throw new AxisFault("Property '" + propertyName + "' in bean class '"
+ beanClass.getName() + "'is not
readable.");
}
......
......
}else {
addTypeQname(elemntNameSpace, propertyQnameValueList, property,
beanName, processingDocLitBare);
if (Object.class.equals(ptype)) {
//this is required to match this element prefix as
//root element's prefix.
QName qNamefortheType = (QName) typeTable
.getComplexSchemaMap().get(
getClassName(beanClass));
OMFactory fac = OMAbstractFactory.getOMFactory();
QName elementName;
OMElement element;
if (elemntNameSpace != null) {
elementName = new QName(
elemntNameSpace.getNamespaceURI(),
property.getName(),
qNamefortheType.getPrefix());
} else {
elementName = new QName(property.getName());
}
if(SimpleTypeMapper.isSimpleType(value)){
element = fac.createOMElement(elementName);
element.addChild(fac.createOMText(SimpleTypeMapper
.getStringValue(value)));
}else{
// value is null !!!
XMLStreamReader xr = BeanUtil.getPullParser(value,
elementName, typeTable, qualified, false);
{code}
{code:title=BeanUtil.java}
public static XMLStreamReader getPullParser(Object beanObject,
QName beanName,
TypeTable typeTable,
boolean qualified,
boolean processingDocLitBare) {
Class beanClass = beanObject.getClass(); // NullPointerException
..............
{code}
> Databinding- BeanUtil.getPullParser() throws NullPointerException
> -----------------------------------------------------------------
>
> Key: AXIS2-5751
> URL: https://issues.apache.org/jira/browse/AXIS2-5751
> Project: Axis2
> Issue Type: Bug
> Components: adb
> Affects Versions: 1.7.1
> Reporter: Vasile Bucur
>
> Test code:
> {code:java}
> public class CustomError {
> private Error code;
> private Object detail;
> // constructors
> // getters and setters
> }
> ..
> new CustomError(code41); // detail is null
> {code}
> in adb:
> {code:title=BeanUtil.java}
> Object value;
> if (readMethod != null) {
> readMethod.setAccessible(true);
> value = readMethod.invoke(beanObject); // value is null
> } else {
> throw new AxisFault("Property '" + propertyName + "' in bean class '"
> + beanClass.getName() + "'is not
> readable.");
> }
> ......
> ......
> }else {
> addTypeQname(elemntNameSpace, propertyQnameValueList, property,
> beanName, processingDocLitBare);
> if (Object.class.equals(ptype)) {
> //this is required to match this element prefix as
> //root element's prefix.
> QName qNamefortheType = (QName) typeTable
> .getComplexSchemaMap().get(
> getClassName(beanClass));
> OMFactory fac = OMAbstractFactory.getOMFactory();
> QName elementName;
> OMElement element;
> if (elemntNameSpace != null) {
> elementName = new QName(
> elemntNameSpace.getNamespaceURI(),
> property.getName(),
> qNamefortheType.getPrefix());
> } else {
> elementName = new QName(property.getName());
> }
>
> if(SimpleTypeMapper.isSimpleType(value)){
> element = fac.createOMElement(elementName);
> element.addChild(fac.createOMText(SimpleTypeMapper
> .getStringValue(value)));
> }else{
> // value is null !!!
> XMLStreamReader xr = BeanUtil.getPullParser(value,
> elementName, typeTable, qualified,
> false);
> {code}
> {code:title=BeanUtil.java}
> public static XMLStreamReader getPullParser(Object beanObject,
> QName beanName,
> TypeTable typeTable,
> boolean qualified,
> boolean processingDocLitBare)
> {
> Class beanClass = beanObject.getClass(); // NullPointerException
> ..............
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]