2 danlubin danlubin 于 2016.09.11 21:33 提问

net.sf.json.JSONException: 1C

严重: Servlet.service() for servlet [UserServlet] in context with path [/smbms] threw exception
net.sf.json.JSONException: java.lang.reflect.InvocationTargetException
at net.sf.json.JSONObject._fromBean(JSONObject.java:959)
at net.sf.json.JSONObject.fromObject(JSONObject.java:194)
at net.sf.json.JSONObject._processValue(JSONObject.java:2793)
at net.sf.json.JSONObject._setInternal(JSONObject.java:2817)
at net.sf.json.JSONObject.setValue(JSONObject.java:1527)
at net.sf.json.JSONObject._fromBean(JSONObject.java:946)
at net.sf.json.JSONObject.fromObject(JSONObject.java:194)
at net.sf.json.JSONArray._processValue(JSONArray.java:2562)
at net.sf.json.JSONArray.processValue(JSONArray.java:2593)
at net.sf.json.JSONArray.addValue(JSONArray.java:2580)
at net.sf.json.JSONArray._fromCollection(JSONArray.java:1084)
at net.sf.json.JSONArray.fromObject(JSONArray.java:147)
at net.sf.json.JSONArray.fromObject(JSONArray.java:129)
at cn.smbms.servlet.UserServlet.getUserList(UserServlet.java:108)
at cn.smbms.servlet.UserServlet.service(UserServlet.java:37)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1082)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:623)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2517)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2506)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.reflect.InvocationTargetException
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.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773)
at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1132)
at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686)
at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)
at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)
at net.sf.json.JSONObject._fromBean(JSONObject.java:931)
... 33 more
Caused by: java.lang.IllegalArgumentException
at java.sql.Date.getHours(Date.java:177)
... 43 more

2个回答

guwei4037
guwei4037   Ds   Rxr 2016.09.11 21:48

Caused by: java.lang.IllegalArgumentException
at java.sql.Date.getHours(Date.java:177)

日期格式的问题?java.util.Date?http://yoyang.iteye.com/blog/651895

danlubin
danlubin 怎么修改呀?
大约一年之前 回复
niaonao
niaonao   Rxr 2016.09.11 21:54

Caused by: java.lang.IllegalArgumentException
at java.sql.Date.getHours(Date.java:177)

java.lang.IllegalArgumentException 非法参数异常,非法参数就是用在此处的参数不正确,格式不正确什么的。

java.sql.Date.getHours(Date.java:177) 出错位置在 Date.java文件下的 177 行

InvocationTargetException 是一种包装由调用方法或构造方法所抛出异常的受查异常。这个异常并不是Eclipse插件开发特有的,而是标准JDK中的,它定义在 java.lang.reflect包下。在进行Java开发的时候很少会接触到这个异常,不过在进行Eclipse插件开发中则不同,很多API都声明抛出此类异常,因此必须对此异常进行处理。

Csdn user default icon
上传中...
上传图片
插入图片