Struts Problem Report
Struts has detected an unhandled exception:
Messages: |
|
File: | weibo4j/http/PostParameter.java |
Line number: | 93 |
Stacktraces
org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException: java.lang.reflect.InvocationTargetException
org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException: java.lang.reflect.InvocationTargetException
org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:243) org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165) org.apache.struts2.json.JSONWriter.value(JSONWriter.java:131) org.apache.struts2.json.JSONWriter.add(JSONWriter.java:329) org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:228) org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165) org.apache.struts2.json.JSONWriter.value(JSONWriter.java:131) org.apache.struts2.json.JSONWriter.write(JSONWriter.java:99) org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:112) org.apache.struts2.json.JSONResult.execute(JSONResult.java:198)
java.lang.IllegalStateException: not a fileweibo4j.http.PostParameter.getContentType(PostParameter.java:93) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597)
一个困扰了我一天的问题,终究解决了,脑袋都大了,还睡觉那么完,就是没有给某个实体类初始化,不仅要把数据处理层初始化,每一个设置值的实体类也要初始化,否则这个问题就一直干扰着你。
PS:调试方式:eg:http://localhost:8080/weibo.com/user!userinfoJson.action
就可以看见完整的报错原因了,你必须把struts的调试模式打开