设为首页 加入收藏

TOP

dom4j:Adding text to an XML document must not be null(二)
2014-11-24 00:14:54 来源: 作者: 【 】 浏览:20
Tags:dom4j:Adding text XML document must not null
orker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IllegalArgumentException: Adding text to an XML document must not be null
at org.dom4j.DocumentFactory.createText(DocumentFactory.java:174)
at org.dom4j.tree.AbstractElement.addText(AbstractElement.java:899)
at org.dom4j.tree.AbstractElement.setText(AbstractElement.java:1120)
at com.dyst.tippe.util.XMLUtils.genQueryResponseXmlFor04C01(XMLUtils.java:132)
at com.dyst.tippe.service.impl.PunishProxyServiceHelper.handle(PunishProxyServiceHelper.java:95)
at com.dyst.tippe.service.impl.PunishProxyServiceImpl.queryObjectOut(PunishProxyServiceImpl.java:23)
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:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy12.queryObjectOut(Unknown Source)
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:597)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
... 32 more


解决:每一个element的test值都需要判断,建议写成方法

StringUtil类:


public static String replaceNullString(String str){
if(str == null ) return "";
else return str;
}


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇C语言中构造数据类型的初始化 下一篇org.xml.sax.SAXParseException: ..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: