当前位置: 代码迷 >> Java Web开发 >> java.lang.IllegalArgumentException: argument type mismatch解决方案
  详细解决方案

java.lang.IllegalArgumentException: argument type mismatch解决方案

热度:5609   发布时间:2013-02-25 21:12:57.0
java.lang.IllegalArgumentException: argument type mismatch
这是控制台输出的
Java code
ERROR 01 六月 2010 14:28:48 [org.hibernate.property.BasicPropertyAccessor$BasicSetter] [set] - IllegalArgumentException in class: com.baidu.manageSystem.machineRoom.dto.UserRights, setter method of property: userCodeERROR 01 六月 2010 14:28:48 [org.hibernate.property.BasicPropertyAccessor$BasicSetter] [set] - expected type: com.baidu.manageSystem.machineRoom.dto.Users, actual value: java.lang.StringWARN  01 六月 2010 14:28:48 [org.apache.struts.action.RequestProcessor] [processException] - Unhandled Exception thrown: class org.springframework.orm.hibernate3.HibernateSystemExceptionERROR 01 六月 2010 14:28:48 [org.apache.catalina.core.StandardWrapperValve] [invoke] - Servlet.service() for servlet action threw exceptionjava.lang.IllegalArgumentException: argument type mismatch    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.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)    at org.hibernate.tuple.entity.AbstractEntityTuplizer.setIdentifier(AbstractEntityTuplizer.java:211)    at org.hibernate.tuple.entity.AbstractEntityTuplizer.instantiate(AbstractEntityTuplizer.java:353)    at org.hibernate.persister.entity.AbstractEntityPersister.instantiate(AbstractEntityPersister.java:3606)    at org.hibernate.impl.SessionImpl.instantiate(SessionImpl.java:1275)    at org.hibernate.impl.SessionImpl.instantiate(SessionImpl.java:1264)    at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1299)    at org.hibernate.loader.Loader.getRow(Loader.java:1206)    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:580)    at org.hibernate.loader.Loader.doQuery(Loader.java:701)    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)    at org.hibernate.loader.Loader.doList(Loader.java:2220)    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)    at org.hibernate.loader.Loader.list(Loader.java:2099)    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)    at org.springframework.orm.hibernate3.HibernateTemplate$29.doInHibernate(HibernateTemplate.java:849)    at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)    at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:840)    at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:832)    [color=#33CCCC]at com.baidu.manageSystem.machineRoom.dao.UserRightsDao.queryById(UserRightsDao.java:42)[/color]    [color=#FF0000]at com.baidu.manageSystem.machineRoom.controller.UserRightsAction.jurisdiction(UserRightsAction.java:67)[/color]    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.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)    at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)    at com.baidu.manageSystem.common.filter.EncodingFilter.doFilter(EncodingFilter.java:32)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)    at java.lang.Thread.run(Thread.java:619)
  相关解决方案